package com.limap.common.enums.iot;

/**
 * @author Lenovo
 */

public enum RedisKey {
    /**
     * 开关1
     */
    offlineD("offlineD","offlineD:","离线监测键值"),
    offline("offline","offline:","离线实际数据"),
    command("command","command:","控制器操作键值"),
    controlStatus("controlStatus","controlStatus:","控制器标识"),
    commandStatus("commandStatus","commandStatus:","控制器操作实际数据");


    private String code;
    /**
     * 阿里对应字段
     */
    private String value;
    private String field;

    RedisKey(String code, String value, String field){
        this.code = code;
        this.value = value;
        this.field = field;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }
    public String getField() {
        return field;
    }


    public static RedisKey getByCode(String code) {
        for (RedisKey e : RedisKey.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }
}
