package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: FarmerMarketEnum
 * @Description:聚客点农贸市场
 * @date 2024-03-26 16:08
 */
public enum GatherGuestFarmerMarketEnum {

    //1.是 2.否
    GATHER_GUEST_FARMER_MARKET_1(1, "是", 5),
    GATHER_GUEST_FARMER_MARKET_2(2, "否", 3),
    ;

    private Integer code;

    private String desc;

    private Integer score;

    GatherGuestFarmerMarketEnum(Integer code, String desc, Integer score) {
        this.code = code;
        this.desc = desc;
        this.score = score;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getScore() {
        return score;
    }

    public static GatherGuestFarmerMarketEnum getByCode(Integer code) {
        if(Objects.isNull(code)){
            return null;
        }
        for (GatherGuestFarmerMarketEnum value : GatherGuestFarmerMarketEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}
