mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
commit
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user