package com.cool.store.enums.prepare.newStore;

import com.cool.store.enums.ThirdRegionTypeEnum;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * 社区类型
 */
public enum BusinessDistrictEnum {

    COMMUNITY(10,"社区型"),
    COMMERCIAL_STREET(20,"商业街边型"),
    SCHOOL(30,"学校型"),
    CBD_OFFICE(40,"CBD/办公型"),
    HOSPITAL(60,"医院型"),
    VEGETABLE_MARKET(70,"-菜场型"),


    ;

    private Integer code;
    private String desc;

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

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static final Map<Integer, BusinessDistrictEnum> map
            = Arrays.stream(values()).collect(Collectors.toMap(BusinessDistrictEnum::getCode, Function.identity()));

    public static BusinessDistrictEnum getByCode(Integer code) {
        return map.get(code);
    }
}
