package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: CompeteTypeEnum
 * @Description:竞争对手性质
 * @date 2024-03-26 16:08
 */
public enum CompeteTypeEnum {

    // 1.连锁店 2.强势单店 3.经营散户 4.小型摊贩
    WANT_SHOP_SIZE_1(1, "连锁店", 1),
    WANT_SHOP_SIZE_2(2, "强势单店", 2),
    WANT_SHOP_SIZE_3(3, "经营散户", 3),
    WANT_SHOP_SIZE_4(4, "小型摊贩", 5),
    ;

    private Integer code;

    private String desc;

    private Integer score;

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

}
