package com.rongwei.sfcommon.utils;

import lombok.Data;

@Data
public class Result {
    private Integer status;
    private String message;

    public static Result ok(String message){
        Result r = new Result();
        r.setStatus(200);
        r.setMessage(message);
        return r;
    }

    public static Result error( String message){
        Result r = new Result();
        r.setStatus(500);
        r.setMessage(message);
        return r;
    }

    // 重写 toString 方法以便于调试
    @Override
    public String toString() {
        return "Result{" +
                "status=" + status +
                ", message='" + message + '\'' +
                '}';
    }
}
