lyh
2025-01-16 1d84a3c62eeee429f7d7d6339bcf9b504a9d7277
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
package org.jeecg.modules.dnc.response;
 
import lombok.Data;
import lombok.NoArgsConstructor;
 
/**
 * 公用返回结构
 */
@Data
@NoArgsConstructor
public class ResponseResult implements Response {
 
    //操作是否成功
    boolean success = SUCCESS;
 
    //操作代码
    int code = SUCCESS_CODE;
 
    //提示信息
    String message;
 
    public ResponseResult(ResultCode resultCode){
        this.success = resultCode.success();
        this.code = resultCode.code();
        this.message = resultCode.message();
    }
 
    public static ResponseResult SUCCESS(){
        return new ResponseResult(CommonCode.SUCCESS);
    }
    public static ResponseResult FAIL(){
        return new ResponseResult(CommonCode.FAIL);
    }
 
}