package com.cool.store.enums.point;

import java.util.Objects;

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

    //1.小业态品牌店3家以上 2.小业态普通店3家以上 3.普通小业态店3家以下 4.无小业态店
    NEAR_NEIGHBOR_1(1, "小业态品牌店3家以上", 4),
    NEAR_NEIGHBOR_2(2, "小业态普通店3家以上", 2),
    NEAR_NEIGHBOR_3(3, "普通小业态店3家以下", 1),
    NEAR_NEIGHBOR_4(4, "无小业态店", 1),
    ;

    private Integer code;

    private String desc;

    private Integer score;

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



}
