package cn.com.victorysoft.business.sys.dto;

import io.swagger.annotations.ApiModel;
import lombok.Data;

@ApiModel("通用返回结果")
@Data
public class Result {

    private boolean success;
    private String message;

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

    public static Result success() {
        return success("操作成功");
    }

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

    public static Result fail() {
        return success("操作失败");
    }
}
