package com.qmth.exam.reserve.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Description 异步任务执行结果
 */
@Getter
@AllArgsConstructor
public enum AsyncTaskResult {

    SUCCESS("成功"),

    ERROR("失败");

    private final String title;

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