package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: NearBusinessConditionEnum
 * @Description:周边业态经营情况(100米内)
 * @date 2024-03-26 16:08
 */
public enum NearBusinessConditionEnum {

    //1.运营状况良好 2.运营状况一般 3.运营状况差
    NEAR_BUSINESS_CONDITION_1(1, "经营状况良好", 3),
    NEAR_BUSINESS_CONDITION_2(2, "经营状况一般", 2),
    NEAR_BUSINESS_CONDITION_3(3, "经营状况差", 1)
    ;
    ;

    private Integer code;

    private String desc;

    private Integer score;

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

}
