package cn.iocoder.byzs.module.ai.enums.video;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * AI 视频状态的枚举
 *
 * @author fansili
 */
@AllArgsConstructor
@Getter
public enum AiVideoStatusEnum {

    IN_PROGRESS(10, "进行中"),
    SUCCESS(20, "已完成"),
    FAIL(30, "已失败");

    /**
     * 状态
     */
    private final Integer status;
    /**
     * 状态名
     */
    private final String name;

    public static AiVideoStatusEnum valueOfStatus(Integer status) {
        for (AiVideoStatusEnum statusEnum : AiVideoStatusEnum.values()) {
            if (statusEnum.getStatus().equals(status)) {
                return statusEnum;
            }
        }
        throw new IllegalArgumentException("未知会话状态： " + status);
    }

}
