package com.tuoheng.admin.enums;

import lombok.Getter;

/**
 * Ai分析状态
 */
public enum AiAnalyseStatusEnum {
    UPLOADED(1,"uploaded"),

    WAITING(2,"waiting"),

    RUNNING(3,"running"),

    SUCCESS(4,"success"),

    SUCCESS_TIMEOUT(5,"success_timeout"),

    FAILED(6,"failed"),

    DEFAULT(0,"default");

    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;
    }
}
