package com.cool.store.enums.point;

import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: ShopAreaTypeEnum
 * @Description:商圈类型
 * @date 2024-03-26 16:08
 */
public enum ShopAreaTypeEnum {

    //1.社区商圈 2.综合商圈 3.商业商圈 4.学校商圈 5.医院商圈 6.农贸商圈 7.纯人流商圈 8.办公商圈
    SHOP_AREA_TYPE_1(1, "社区商圈"),
    SHOP_AREA_TYPE_2(2, "综合商圈"),
    SHOP_AREA_TYPE_3(3, "商业商圈"),
    SHOP_AREA_TYPE_4(4, "学校商圈"),
    SHOP_AREA_TYPE_5(5, "医院商圈"),
    SHOP_AREA_TYPE_6(6, "农贸商圈"),
    SHOP_AREA_TYPE_7(7, "纯人流商圈"),
    SHOP_AREA_TYPE_8(8, "办公商圈"),
    ;

    private Integer code;

    private String desc;

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

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


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

}
