mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 12:56:28 +08:00
5.0
This commit is contained in:
@@ -5,6 +5,7 @@ import com.gitee.sop.gateway.message.ErrorEnum;
|
||||
import com.gitee.sop.gateway.message.ErrorMeta;
|
||||
import com.gitee.sop.gateway.message.IError;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -54,20 +55,9 @@ import java.util.Locale;
|
||||
*
|
||||
* @author 六如
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ApiResponse implements Response {
|
||||
|
||||
public static final String SUCCESS_CODE = "0";
|
||||
public static final String SUCCESS_MSG = "success";
|
||||
/**
|
||||
* 网关异常码,范围0~100 成功返回"0"
|
||||
*/
|
||||
private String code = SUCCESS_CODE;
|
||||
|
||||
/**
|
||||
* 网关异常信息
|
||||
*/
|
||||
private String msg = "";
|
||||
public class ApiResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 业务异常码
|
||||
@@ -79,11 +69,6 @@ public class ApiResponse implements Response {
|
||||
*/
|
||||
private String subMsg = "";
|
||||
|
||||
/**
|
||||
* 返回对象
|
||||
*/
|
||||
private Object data;
|
||||
|
||||
public static ApiResponse success(Object data) {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
apiResponse.setCode(SUCCESS_CODE);
|
||||
|
@@ -5,6 +5,7 @@ import com.gitee.sop.gateway.message.ErrorEnum;
|
||||
import com.gitee.sop.gateway.message.ErrorMeta;
|
||||
import com.gitee.sop.gateway.message.IError;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -54,20 +55,9 @@ import java.util.Locale;
|
||||
*
|
||||
* @author 六如
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ApiResponseLower implements Response {
|
||||
|
||||
public static final String SUCCESS_CODE = "0";
|
||||
public static final String SUCCESS_MSG = "success";
|
||||
/**
|
||||
* 网关异常码,范围0~100 成功返回"0"
|
||||
*/
|
||||
private String code = SUCCESS_CODE;
|
||||
|
||||
/**
|
||||
* 网关异常信息
|
||||
*/
|
||||
private String msg = "";
|
||||
public class ApiResponseLower extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 业务异常码
|
||||
@@ -79,11 +69,6 @@ public class ApiResponseLower implements Response {
|
||||
*/
|
||||
private String sub_msg = "";
|
||||
|
||||
/**
|
||||
* 返回对象
|
||||
*/
|
||||
private Object data;
|
||||
|
||||
public static ApiResponseLower success(Object data) {
|
||||
ApiResponseLower apiResponse = new ApiResponseLower();
|
||||
apiResponse.setCode(SUCCESS_CODE);
|
||||
|
@@ -0,0 +1,29 @@
|
||||
package com.gitee.sop.gateway.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class BaseResponse implements Response {
|
||||
|
||||
public static final String SUCCESS_CODE = "0";
|
||||
public static final String SUCCESS_MSG = "success";
|
||||
/**
|
||||
* 网关异常码,范围0~100 成功返回"0"
|
||||
*/
|
||||
private String code = SUCCESS_CODE;
|
||||
|
||||
/**
|
||||
* 网关异常信息
|
||||
*/
|
||||
private String msg = "";
|
||||
|
||||
/**
|
||||
* 返回对象
|
||||
*/
|
||||
private Object data;
|
||||
|
||||
}
|
Reference in New Issue
Block a user