package com.njcn.system.enums;

import lombok.Getter;

/**
 * @author hany
 * @version 1.0.0
 * @date 2022年09月08日
 */
@Getter
public enum EventResponseEnum {

    /**
     * 用能模块异常响应码的范围：
     * A00450 ~ A00549
     */
    ENERGY_COMMON_ERROR("A00450","用能模块异常"),
    NET_DEV_NAME_REPEAT("A00451", "网关设备名称重复"),
    DEV_VERSION_REPEAT("A00451", "设备版本信息重复"),
    STRATEGY_REPEAT("A00453","空调策略名称重复"),

    /**
     * 用能模板交互应答code
     */
    SUCCESS("200","success"),
    PROCESSING("202","请求处理中"),

    AUTO_OFFLINE("300","设备有异常，主动下线"),
    FAIL("400","请求失败"),
    PARAM_FAIL_TIMESTAMP("400","请求失败,时间戳不能为空,请检查timestamp字段"),
    PARAM_ERROR_TIMESTAMP("400","请求失败,时间戳格式错误,请检查timestamp字段"),
    PARAM_FAIL_TYPE("400","请求失败,消息类型不能为空,请检查type字段"),
    TYPE_ERROR("400","请求失败,接口名称不匹配,请检查type字段"),
    REGISTER_ERROR("400","注册失败,注册的联网设备不存在,请先平台录入"),
    REPEAT_ERROR("400","注册失败,有重复装置注册"),
    EXIST_ERROR("400","注册失败,存在已注册的装置"),
    CANCEL_ERROR("400","取消注册失败,存在未注册或者接入的装置，无法取消注册"),
    NO_MODEL_FIND("402","接入失败,模板未找到"),
    MISSING_MODEL("402","接入失败,模板数据缺失"),
    MISSING_TOPIC("402","接入失败,缺少网关主题相关信息"),
    NO_DID_FIND("400","接入失败,需要接入的装置未找到"),
    MODULE_MATCH_ERROR("400","接入失败,接入的装置和模板数量不匹配"),
    SAME_DEV_ERROR("400","模板数据错误,存在重复的装置信息"),
    MODEL_ERROR("400","模板数据错误,模板未找到"),
    NET_DEV_MODEL_ERROR("400","网关模板解析错误，平台未找到此网关"),
    LINE_REPEAT_ERROR("400","网关模板解析错误，库中存在相同的监测点id"),


    CERTIFICATION_ERROR("401","请求未认证/认证错误"),
    REQUEST_REFUSE("403","请求被拒绝"),
    FUNCTION_MISSING("404","请求的资源不存在"),
    OVER_WAITING_TIME("408","请求超时"),
    OTHER_ERROR("500","其他错误"),

    NO_DICT("501","字典表无此数据"),
    NO_TABLE("501","字典表无influxDB表名数据"),
 	DEV_LINE_EMPTY("501","设备监测点不可为空"),
    DIC_NAME_REPEAT("502","字典名称不可重复"),
    MODEL_NAME_REPEAT("514","模板名称不可重复"),
    NAME_REPEAT("515","名称不可重复"),
    CHILDREN_EXIT("503","存在子节点，不可删除"),


    CAI_BIND("504","用能负荷未绑定监测点"),
    LOAD_VAL_CONFLICT("505","负荷类型与值类型冲突"),
    ENERGY_EMPTY("506","用能查询数据为空"),
    TASK_CREATE_ERROR("507","定时任务创建失败"),

    TASK_HAS_START("508","任务已经执行完毕"),
    TASK_DEL_ERROR("509","定时任务删除失败,请联系管理员"),
    TASK_RUNING("510","任务正在执行无法操作,请先停止任务"),
    TASK_TIME_ERROR("511","两条策略时间差应在5分钟以上"),
    TASK_NO_RUN("512","策略不在执行中"),
    TASK_STOP_ERROR("513","策略停止失败,请联系管理员"),
    ;

    private final String code;

    private final String message;

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