package com.sv.netty.netty;

/**
 * 消息协议指令定义
 *
 * @Author peakren
 * @Date 08/12/2017 11:51 AM
 */
public enum Cmd {


    HB("hb", "心跳"),

    FACEID("faceid", "人脸识别"),
    OPEN_DOOR("open_door", "开门"),

    FACEID_RESPONSE("faceid_response_upload", "人脸结果");

    public String id;

    public String text;

    Cmd(String id, String text) {
        this.id = id;
        this.text = text;

    }

    public static Cmd getCmd(String id) {
        for (Cmd cmd : Cmd.values()) {
            if (cmd.id.equalsIgnoreCase(id)) {
                return cmd;
            }
        }
        return Cmd.HB;
    }

}

