package com.qiuguo.iot.base.enums;

/*
* 动作类型
* 作者：吴林
* */
// 动作类型：0：文本播放 1音频播放 2 U3D动作 3物联网设备动作
public enum RespCodeEnum {
    SUCESS(200, "返回成功"),
    FAILD(500, "异常"),
    ;
     RespCodeEnum(Integer c, String n){
        code = c;
        name = n;
    }
    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static RespCodeEnum getEnumWithCode(Integer c){
        for (RespCodeEnum e:values()
        ) {
            if(e.getCode().compareTo(c) == 0){
                return e;
            }
        }
        return null;
    }
    public static RespCodeEnum getEnumWithName(String name){
        for (RespCodeEnum e:values()
        ) {
            if(e.getName().equals(name)){
                return e;
            }
        }
        return null;
    }
}
