package com.qmth.exam.reserve.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Description 异步任务执行业务类型
 */
@Getter
@AllArgsConstructor
public enum AsyncTaskType {

    STUDENT_IMPORT("考生导入"),

    STUDENT_APPLY_EXPORT("考生预约详情导出"),

    NO_FINISH_APPLY_STUDENT("未完成预约考生导出"),

    UPLOAD_STUDENT_PHOTO("上传考生头像"),

    AUTO_ASSIGN("自动分配");

    private final String title;

    public static String convertToName(String title) {
        for (AsyncTaskType e : AsyncTaskType.values()) {
            if (Objects.equals(title, e.getTitle())) {
                return e.name();
            }
        }
        return null;
    }
}
