package com.ruoyi.info.collection.enums;


/**
 * 中介状态枚举
 *
 * @author ruoyi
 */
public enum IntermediaryStatus {

    /** 正常 */
    NORMAL("0", "正常"),

    /** 停用 */
    DISABLED("1", "停用");

    private final String code;
    private final String desc;

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

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 根据编码获取描述
     */
    public static String getDescByCode(String code) {
        for (IntermediaryStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status.getDesc();
            }
        }
        return null;
    }
}
