package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: NearCompeteEnum
 * @Description:周边(100m内)餐饮店
 * @date 2024-03-26 16:08
 */
public enum NearCompeteEnum {

    //1.品牌水果店2家以上 2.品牌水果店1家及以上 3.夫妻水果店1家及以上 4.无水果店
    NEAR_COMPETITOR_1(1, "品牌水果店2家以上", 1),
    NEAR_COMPETITOR_2(2, "品牌水果店1家及以上", 2),
    NEAR_COMPETITOR_3(3, "夫妻水果店1家及以上", 2),
    NEAR_COMPETITOR_4(4, "无水果店", 3)
    ;

    private Integer code;

    private String desc;

    private Integer score;

    NearCompeteEnum(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 NearCompeteEnum getByCode(Integer code) {
        if(Objects.isNull(code)){
            return null;
        }
        for (NearCompeteEnum nearCompeteEnum : NearCompeteEnum.values()) {
            if (nearCompeteEnum.getCode().equals(code)) {
                return nearCompeteEnum;
            }
        }
        return null;
    }

}
