mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-06 02:50:13 +08:00
44 lines
833 B
Java
44 lines
833 B
Java
package com.jsowell.common.response;
|
|
|
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
|
import lombok.Data;
|
|
|
|
@Data
|
|
public class RestApiResponse<T> {
|
|
/**
|
|
* 返回码
|
|
*/
|
|
private String resCode;
|
|
|
|
/**
|
|
* 信息
|
|
*/
|
|
private String msg;
|
|
|
|
/**
|
|
* 数据
|
|
*/
|
|
private T obj;
|
|
|
|
public RestApiResponse() {
|
|
this.resCode = ReturnCodeEnum.CODE_SUCCESS.getValue();
|
|
this.msg = ReturnCodeEnum.CODE_SUCCESS.getLabel();
|
|
}
|
|
|
|
public RestApiResponse(T t) {
|
|
this.resCode = ReturnCodeEnum.CODE_SUCCESS.getValue();
|
|
this.msg = ReturnCodeEnum.CODE_SUCCESS.getLabel();
|
|
this.obj = t;
|
|
}
|
|
|
|
public RestApiResponse(String resCode, String msg) {
|
|
this.resCode = resCode;
|
|
this.msg = msg;
|
|
}
|
|
|
|
public RestApiResponse(ReturnCodeEnum returnCodeEnum) {
|
|
this.resCode = returnCodeEnum.getValue();
|
|
this.msg = returnCodeEnum.getLabel();
|
|
}
|
|
}
|