package com.tuoheng.admin.enums;

import lombok.Getter;

/**
 * Ai分析状态
 */
public enum AiAnalyseStatusEnum {

    WAITING(5,"waiting"),

    RUNNING(10,"running"),

    SUCCESS(15,"success"),

    SUCCESS_TIMEOUT(20,"success_timeout"),

    FAILED(25,"failed");

    AiAnalyseStatusEnum(int code, String description){
        this.code = code;
        this.description = description;
    }

    @Getter
    private int code;

    @Getter
    private String description;

    public static AiAnalyseStatusEnum getByDesc(String description){
        for (AiAnalyseStatusEnum analyseStatusEnum : values()) {
            if(analyseStatusEnum.getDescription().equals(description)){
                return analyseStatusEnum;
            }
        }
        return null;
    }
}
