package org.springblade.common.enums;

import lombok.Getter;

/**
 * 优惠券类型枚举
 */
@Getter
public enum IntegralSourceEnum {
	SIGN_IN("签到", 1),
	RECOMMEND("推荐", 2),
	BE_RECOMMEND("被推荐", 3),
	LOTTERY("抽奖", 4);
	private String name;
	private Integer value;

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

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