package com.qmth.themis.business.enums;

import java.util.Objects;

/**
 * @Description: 异常类型 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/7/29
 */
public enum ExceptionEnum {

    NET_TIME_OUT("网络超时", "异常处理"),

    MACHING_STOP("机器硬件故障、死机", "异常处理"),

    NET_TIME_BREAK("网络断开", "异常处理"),

    SOFTWARE_STOP("软件故障", "异常处理"),

    POWER_CUT("停电", "异常处理"),

    OTHER("其它", "异常处理"),

    EXAM_BREAK("断点续考", "断点续考");

    private String code;

    private String title;

    private ExceptionEnum(String code, String title) {
        this.code = code;
        this.title = title;
    }

    public String getCode() {
        return code;
    }

    public String getTitle() {
        return title;
    }

//    /**
//     * 状态转换 toName
//     *
//     * @param code
//     * @return
//     */
//    public static String convertToName(String code) {
//        for (ExceptionEnum e : ExceptionEnum.values()) {
//            if (Objects.equals(e.getCode(), code)) {
//                return e.name();
//            }
//        }
//        return OTHER.name();
//    }
}
