陶杰
2024-08-22 ee9032d9baf5f33e376d2d2699136e0a7b26bec7
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);
    }
}