package com.xueyi.common.core.constant.digitalman;

import com.xueyi.common.core.constant.basic.BaseConstants;

public class MessageConstants {

    /** 心跳状态通知 */
    public static final Long HEART_BEAT_SYNC = 0L;


    public static final Long STAFF_SYNC = 0L;

    /** 技能消息通知 */
    public static final Long SKILL_SYNC = 1L;

    /** 数字人同步 */
    public static final Long MODEL_SYNC = 2L;

    public static final Long H5_CONFIG_SYNC = 4L;

    /** 数字人场景 */
    public static final String MODE_WORK = "1";         // 工作模式
    public static final String MODE_RECEPTION = "2";    // 接待模式
    public static final String MODE_FREE_CHAT = "3";    // 闲聊模式

    /** 缓存数据头 */
    public static final String REDIS_GROUP_HEADER = "group:dgman:";
    public static final String REDIS_GROUP_DEVICE_HEADER = "group:dgman:device:";

    public static final String MSG_MAN_ACTIVATE_MANCODE_ERROR = "激活码输入错误，请重新输入。";

    public static final Integer SYS_DICT_DATA_RELEASE_UPDATING = 0;
    public static final Integer SYS_DICT_DATA_RELEASE_DOWNLOAD_SUC = 1;
    public static final Integer SYS_DICT_DATA_RELEASE_DOWNLOADING = 2;
    public static final Integer SYS_DICT_DATA_RELEASE_START_DOWNLOAD = 3;
    public static final Integer SYS_DICT_DATA_RELEASE_UPDATE_REQUEST_PASSED = 4;
    public static final Integer SYS_DICT_DATA_RELEASE_USING = 5;
    public static final Integer SYS_DICT_DATA_RELEASE_UPDATE_FAILED = 6;
    public static final Integer SYS_DICT_DATA_RELEASE_UPDATE_UPDATING = 7;
    public static final Integer SYS_DICT_DATA_RESTART_DEVICE = 0;
    public static final Integer SYS_DICT_DATA_RESTART_APP = 1;
    public static final Integer SYS_DICT_DATA_SPLITED = 1;

    public enum RestartEnum {
        RESTART_DEVICE(0, "重启设备"),
        RESTART_APP(1, "重启应用");

        private final Integer code;
        private final String info;

        RestartEnum(Integer code, String info) {
            this.code = code;
            this.info = info;
        }

        public Integer getCode() {
            return code;
        }

        public String getInfo() {
            return info;
        }

        /**
         * 提前判断，用于解决
         * Case中出现的Constant expression required
         *
         * @param value
         * @return
         */
        public static RestartEnum getEnum(Integer value) {
            for (RestartEnum e : RestartEnum.values()) {
                if (e.getCode().equals(value)) {
                    return e;
                }
            }
            return null;
        }
    }

}
