package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: StoreOutlookEnum
 * @Description:门店观赡
 * @date 2024-03-26 16:08
 */
public enum StoreOutlookEnum {

    //1.观赡非常好 2.观赡一般 3.观赡差
    STORE_OUTLOOK_1(1, "观赡非常好", 4),
    STORE_OUTLOOK_2(2, "观赡一般", 3),
    STORE_OUTLOOK_3(2, "观赡差", 2),
    ;

    private Integer code;

    private String desc;

    private Integer score;

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

}
