wu
2024-04-09 b31942e7b99ac73d10287a00166e6a66f53df93a
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
package com.mes.common;
//返回结果包装类
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
 
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private String code;
    private String msg;
    private Object data;
 
    public static  Result seccess(){
        return new Result(Constants.Code_200,"",null);
    }
    public static  Result seccess(Object data){
        return new Result(Constants.Code_200,"",data);
    }
 
    public static  Result error(String code ,String msg){
        return new Result(code,msg,null);
    }
    public static  Result error(){
        return new Result(Constants.Code_500,"服务器发生异常",null);
    }
 
}