package com.fs.audit.enums;

import lombok.Getter;

/**
 * 审核动作枚举
 */
@Getter
public enum AuditAction {

    APPROVE(1, "通过"),
    REJECT(2, "驳回");

    private final Integer code;
    private final String desc;

    AuditAction(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static AuditAction fromCode(Integer code) {
        for (AuditAction action : values()) {
            if (action.getCode().equals(code)) {
                return action;
            }
        }
        throw new IllegalArgumentException("未知的审核动作: " + code);
    }
}

