package com.njcn.prepare.harmonic.enums;

import lombok.Getter;

/**
 * @author hongawen
 * @version 1.0.0
 * @date 2021年04月13日 10:50
 */
@Getter
public enum PrepareResponseEnum {

    PREPARE_INNER_ERROR("A0801", "业务功能内部错误"),

    NO_EXECUTOR_NODE("A0802", "无可执行节点"),

    NO_REPAIR_DATE("A0803", "未指定补招日期"),

    LIMIT_RATE_MISSING("A0804", "监测点限值缺失"),

    ;

    private final String code;

    private final String message;

    PrepareResponseEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getCodeByMsg(String msg){
        for (PrepareResponseEnum userCodeEnum : PrepareResponseEnum.values()) {
            if (userCodeEnum.message.equalsIgnoreCase(msg)) {
                return userCodeEnum.code;
            }
        }
        return "";
    }
}
