package com.ads.common.enums;

/**
 * @Return
 * @Author hou
 * @Date 2021/9/7 15:18
 * @Destription 基本状态
 */
public enum CommonStatusEnum {
    NO(0, "禁用"),
    YES(1, "启用");

    private Integer code;

    private String desc;

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

    public Integer getCode(){return this.code;}

    public String getDesc(){return this.desc;}

    public static CommonStatusEnum getByCode(Integer code){
        for (CommonStatusEnum value : CommonStatusEnum.values()) {
            if (value.code.equals(code)){
                return value;
            }
        }
        return null;
    }
}
