package com.fs.audit.chain;

import lombok.Data;

/**
 * 审核处理结果
 */
@Data
public class AuditResult {

    /**
     * 是否成功
     */
    private boolean success;

    /**
     * 消息
     */
    private String message;

    /**
     * 是否继续传递给下一个处理器
     */
    private boolean continueChain;

    public static AuditResult success(String message) {
        AuditResult result = new AuditResult();
        result.setSuccess(true);
        result.setMessage(message);
        result.setContinueChain(true);
        return result;
    }

    public static AuditResult fail(String message) {
        AuditResult result = new AuditResult();
        result.setSuccess(false);
        result.setMessage(message);
        result.setContinueChain(false);
        return result;
    }

    public static AuditResult end(String message) {
        AuditResult result = new AuditResult();
        result.setSuccess(true);
        result.setMessage(message);
        result.setContinueChain(false);
        return result;
    }
}

