package org.springblade.common.enums;

import lombok.Getter;

/**
 * 优惠券状态枚举
 */
@Getter
public enum CouponStateEnum {
	UNUSED("未使用", 1),
	USED("已使用", 2),
	EXPIRED("已过期", 3);
	private String name;
	private Integer value;

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

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