wlzboy
2025-12-03 7c790c248c137a2fa5525bf66ed04c25043cded7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.ruoyi.payment.common;
 
import java.io.Serializable;
 
/**
 * 统一响应结果
 * 
 * @author ruoyi
 */
public class AjaxResult implements Serializable {
    private static final long serialVersionUID = 1L;
 
    /** 状态码 */
    private int code;
 
    /** 返回消息 */
    private String msg;
 
    /** 返回数据 */
    private Object data;
 
    public AjaxResult() {
    }
 
    public AjaxResult(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
 
    public AjaxResult(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
 
    public static AjaxResult success() {
        return new AjaxResult(200, "操作成功");
    }
 
    public static AjaxResult success(String msg) {
        return new AjaxResult(200, msg);
    }
 
    public static AjaxResult success(Object data) {
        return new AjaxResult(200, "操作成功", data);
    }
 
    public static AjaxResult success(String msg, Object data) {
        return new AjaxResult(200, msg, data);
    }
 
    public static AjaxResult error() {
        return new AjaxResult(500, "操作失败");
    }
 
    public static AjaxResult error(String msg) {
        return new AjaxResult(500, msg);
    }
 
    public static AjaxResult error(int code, String msg) {
        return new AjaxResult(code, msg);
    }
 
    public int getCode() {
        return code;
    }
 
    public void setCode(int code) {
        this.code = code;
    }
 
    public String getMsg() {
        return msg;
    }
 
    public void setMsg(String msg) {
        this.msg = msg;
    }
 
    public Object getData() {
        return data;
    }
 
    public void setData(Object data) {
        this.data = data;
    }
}