package com.jeesharp.business.modules.contentsecurity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 异步内容安全任务状态，映射 {@code biz_content_security_task.task_status}。
 *
 * @author jeesharp
 * @since 2026-06-27
 */
@Getter
@AllArgsConstructor
public enum ContentSecurityTaskStatusEnum {

    PENDING(0, "待回调"),
    PASS(1, "通过"),
    REJECT(2, "拒绝"),
    ERROR(3, "异常"),
    TIMEOUT(4, "超时");

    private final Integer value;
    private final String desc;

    public static ContentSecurityTaskStatusEnum fromValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (ContentSecurityTaskStatusEnum e : values()) {
            if (e.value.equals(value)) {
                return e;
            }
        }
        return null;
    }
}
