package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: BussinessStateEnum
 * @Description:目前经营情况
 * @date 2024-03-26 16:08
 */
public enum BussinessStateEnum {

    // 1:营业中 2:空铺
    BUSSINESS_STATE_1(1, "营业中"),
    BUSSINESS_STATE_2(2, "空铺"),
    ;

    private Integer code;

    private String desc;

    BussinessStateEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static BussinessStateEnum getByCode(Integer code) {
        if(Objects.isNull(code)){
            return null;
        }
        for (BussinessStateEnum bussinessStateEnum : BussinessStateEnum.values()) {
            if (bussinessStateEnum.getCode().equals(code)) {
                return bussinessStateEnum;
            }
        }
        return null;
    }

}
