package com.ai.da.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum WangXiangTaskStatusEnum {

    SUCCEEDED("SUCCEEDED"),

    UNKNOWN_W("UNKNOWN"),

    FAILED("FAILED"),

    RUNNING("RUNNING"),

    PENDING_W("PENDING");

    private final String name;

    // 通过name查找枚举的静态方法
    public static WangXiangTaskStatusEnum fromName(String name) {
        for (WangXiangTaskStatusEnum status : values()) {
            if (status.name.equalsIgnoreCase(name)) {
                return status;
            }
        }
        // 或者返回默认值
         return UNKNOWN_W;
    }
}
