package com.platform.enums;

/**
 * @author abnerhou
 * @date 2020/9/16 10:19
 * @desciption
 */
public enum  BrandTypeEnum {
    CLOTHES(0 , "服装"),
    FURNITURE(1 , "家居"),
    DIGITAL(2 , "数码"),
    ENTERTAINMENT(3 , "美妆"),
    OTHERS(4 , "其他"),
    DEFAULT(9999, "默认商家分类")
    ;

    private int code;

    private String desc;

    BrandTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static BrandTypeEnum getByCode(int code){
        for (BrandTypeEnum brandType : values()){
            if(brandType.getCode() == code){
                return brandType;
            }
        }
        return DEFAULT;
    }
}
