package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: CompeteBusinessCapacityEnum
 * @Description:竞争对手经营能力
 * @date 2024-03-26 16:08
 */
public enum CompeteBusinessCapacityEnum {

    // 1.非常好 2.好 3.一般 4.差
    COMPETITOR_BUSINESS_CAPACITY_1(1, "非常好", 0),
    COMPETITOR_BUSINESS_CAPACITY_2(2, "好", 1),
    COMPETITOR_BUSINESS_CAPACITY_3(3, "一般", 3),
    COMPETITOR_BUSINESS_CAPACITY_4(4, "差", 4),
    ;

    private Integer code;

    private String desc;

    private Integer score;

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


}
