package com.qmth.themis.business.enums;

import java.util.Objects;

/**
 * @Description: mq exec类型 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/9/23
 */
public enum MqExecTypeEnum {

    EXEC_MQ_SESSION_LOGIC("session逻辑", "execMqSessionLogic"),

    EXEC_MQ_LOG_LOGIC("log逻辑", "execMqLogLogic"),

    EXEC_MQ_USER_LOG_LOGIC("userLog逻辑", "execMqUserLogLogic"),

    EXEC_MQ_TASK_LOGIC("task逻辑", "execMqTaskLogic"),

    EXEC_MQ_LIVENESS_VERIFY_LOGIC("活体检测逻辑", "execMqLivenessVerifySaveLogic"),

    EXEC_MQ_FACE_VERIFY_LOGIC("人脸检测逻辑", "execMqFaceVerifySaveLogic"),

    EXEC_MQ_EXAM_STUDENT_UPDATE_LOGIC("考生更新逻辑", "execMqExamStudentUpdateLogic"),

    EXEC_MQ_RECORD_PERSISTED_LOGIC("考试记录持久化逻辑", "execMqRecordPersistedLogic"),

    EXEC_MQ_RECORD_UPDATE_LOGIC("考试记录数据更新逻辑", "execMqRecordUpdateLogic"),

    EXEC_MQ_RECORD_BREAK_HISTORY_PERSISTED_LOGIC("考试断点记录持久化逻辑", "execMqRecordBreakHistoryPersistedLogic"),

    EXEC_MQ_EXAM_BREAK_LOGIC("考试断点逻辑", "execMqExamBreakLogic"),

    EXEC_MQ_CALCULATE_SCORE_LOGIC("重新算分逻辑", "execMqCalculateScoreLogic"),

//    EXEC_MQ_CALCULATE_OBJECTIVE_SCORE_LOGIC("计算客观分逻辑", "execMqCalculateObjectiveScoreLogic"),

    EXEC_MQ_WEBSOCKET_UN_NORMAL_LOGIC("websocket非正常退出，延时消息逻辑", "execMqWebsocketUnNormalLogic"),

    EXEC_MQ_EXAM_BREAK_DELAY_LOGIC("考试断点，延时消息逻辑", "execMqExamBreakDelayLogic"),

    EXEC_MQ_TENCENT_VIDEO_LOGIC("腾讯云视频回调，延时消息逻辑", "execMqTencentVideoLogic");

    private String code;
    private String desc;

    private MqExecTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 状态转换 toName
     *
     * @param value
     * @return
     */
    public static String convertToName(String value) {
        for (MqExecTypeEnum e : MqExecTypeEnum.values()) {
            if (Objects.equals(value.trim(), e.getDesc())) {
                return e.name();
            }
        }
        return null;
    }
}
