package com.zfire.jiasm.syncdata.constant;


import lombok.Getter;

/**
 * 安装工单
 * @author yaozx
 * @version 1.0
 * @date 2023-01-12
 */
@Getter
public enum BrandWebsitStatEnum {

    /**
     * 未启用
     */
    ONE(1,"ONE"),
    /**
     * 正常
     */
    TOW(2,"TOW"),
    /**
     * 无效
     */
    THREE(3,"THREE"),
    ;


    /**
     * 编码
     */
    private final Integer code;


    private final String text;

    BrandWebsitStatEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public static BrandWebsitStatEnum getByCode(Integer code) {
        for (BrandWebsitStatEnum item : values()) {
            if (code.equals(item.getCode())) {
                return item;
            }
        }
        return null;
    }

    /**
     * @param code: code
     * @return 对应枚举
     **/
    public static String getMessageByCode(Integer code) {
        String result = null;
        for (BrandWebsitStatEnum item : values()) {
            if (code.equals(item.getCode())) {
                result = item.getText();
                break;
            }
        }
        return result;
    }

}
