package com.cool.store.enums.point;

import java.util.Objects;

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

    //1.餐饮连锁店或6家以上餐饮店 2.普通餐饮店 3.无餐饮店
    NEAR_REPAST_1(1, "餐饮连锁店或6家以上餐饮店", 4),
    NEAR_REPAST_2(2, "普通餐饮店", 3),
    NEAR_REPAST_3(3, "无餐饮店", 1),
    ;

    private Integer code;

    private String desc;

    private Integer score;

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

}
