package org.springblade.common.enums;

import lombok.Getter;

/**
 * 优惠券类型枚举
 */
@Getter
public enum CouponTypeEnum {
	PLATFORM("平台", 1),
	MERCHANT("商家", 2),
	GOODS("商品", 3);
	private String name;
	private Integer value;

	CouponTypeEnum(String name, Integer value) {
		this.name = name;
		this.value = value;
	}

	public static String getNameByValue(Integer value) {
		for (CouponTypeEnum orderTypeEnum : CouponTypeEnum.values()) {
			if (orderTypeEnum.value.equals(value)) {
				return orderTypeEnum.getName();
			}
		}
		return "未知";
	}
}
