package cn.newfeifan.mall.module.distri.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum IntegralTypeEnum {
    RED_INTEGRAL(1, "红色积分"),
    YELLOW_INTEGRAL(2, "黄色积分"),
    GREEN_INTEGRAL(3, "绿色积分");

    private final Integer type;
    private final String name;

    public static IntegralTypeEnum getIntegralTypeEnumByType(int status) {
        for (IntegralTypeEnum integralTypeEnum : IntegralTypeEnum.values()) {
            if (integralTypeEnum.getType() == status) {
                return integralTypeEnum;
            }
        }
        return null;
    }
}
