gongzuming
2024-10-08 80c0af32789bb8092a726fc9e3ffcd5c634c8043
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.mzl.flower.base;
 
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
 
import java.io.Serializable;
 
public class BaseController<T> implements Serializable {
    public BaseController() {
    }
 
    protected ResponseEntity<ReturnDataDTO<?>> returnData(String code, Object data,String msg) {
        return new ResponseEntity(new ReturnDataDTO(code, data, msg), HttpStatus.OK);
    }
 
    protected ResponseEntity<ReturnDataDTO<?>> returnData(String code, Object data) {
        return new ResponseEntity(new ReturnDataDTO(code, data, ""), HttpStatus.OK);
    }
}