package com.mvc.netty.dealconstant;

public enum HandleMsgCode {//private String type;//1 定时报单包  2定时报多包 3 大图 4补发报  5紧急域名联系报文 6审核任务回执 7运行日志 8CNN 9版本信息
    VIRT_H_31("31","定时报(单包)", "54","03"),//仅判断使用
    H_32("32","定时报", "54","03"),
    H_52("52","补发报", "52","03"),
    H_36("36","大图报", "36","03"),
    H_E0("e0","远程配置", "e0","03"),
    H_E1("e1","配置回执", "e1","03"),
    H_EA("ea","紧急域名", "ea","03"),
    H_E5("e5","审核回执", "e5","03"),
    H_E6("e6","运行日志", "e6","03"),
    H_E2("e2","CNN报文", "e2","03"),
    H_F0("f0","查询服务器IP", "f1","03"),
    H_F2("f2","查询下行任务", "f3","03"),
    H_EC("ec","升级指令","ec","05"),
    H_ED("ed","升级回执","ed","03"),
    H_E3("e3","专项配置", "e3","05"),
    ;

    private String code;
    private String desc;
    private String response;
    private String endMark;

    private HandleMsgCode(String code, String desc, String response,String endMark) {
        this.code = code;
        this.desc = desc;
        this.response = response;
        this.endMark = endMark;
    }

    /**
     * 包含报文码
     * @param code
     * @return
     */
    public static boolean contain(String code) {
        for (HandleMsgCode msg: HandleMsgCode.values()) {
            if (msg.code.equals(code)) {
                return true;
            }
        }
        return false;
    }

    public static HandleMsgCode get(String code) {
        for (HandleMsgCode msg: HandleMsgCode.values()) {
            if (msg.code.equals(code)) {
                return msg;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }

    public String getEndMark() {
        return endMark;
    }

    public void setEndMark(String endMark) {
        this.endMark = endMark;
    }
}
