mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +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.ErrorMeta;
|
||||||
import com.gitee.sop.gateway.message.IError;
|
import com.gitee.sop.gateway.message.IError;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@@ -54,20 +55,9 @@ import java.util.Locale;
|
|||||||
*
|
*
|
||||||
* @author 六如
|
* @author 六如
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class ApiResponse implements Response {
|
public class ApiResponse extends BaseResponse {
|
||||||
|
|
||||||
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 = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务异常码
|
* 业务异常码
|
||||||
@@ -79,11 +69,6 @@ public class ApiResponse implements Response {
|
|||||||
*/
|
*/
|
||||||
private String subMsg = "";
|
private String subMsg = "";
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回对象
|
|
||||||
*/
|
|
||||||
private Object data;
|
|
||||||
|
|
||||||
public static ApiResponse success(Object data) {
|
public static ApiResponse success(Object data) {
|
||||||
ApiResponse apiResponse = new ApiResponse();
|
ApiResponse apiResponse = new ApiResponse();
|
||||||
apiResponse.setCode(SUCCESS_CODE);
|
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.ErrorMeta;
|
||||||
import com.gitee.sop.gateway.message.IError;
|
import com.gitee.sop.gateway.message.IError;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@@ -54,20 +55,9 @@ import java.util.Locale;
|
|||||||
*
|
*
|
||||||
* @author 六如
|
* @author 六如
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class ApiResponseLower implements Response {
|
public class ApiResponseLower extends BaseResponse {
|
||||||
|
|
||||||
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 = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务异常码
|
* 业务异常码
|
||||||
@@ -79,11 +69,6 @@ public class ApiResponseLower implements Response {
|
|||||||
*/
|
*/
|
||||||
private String sub_msg = "";
|
private String sub_msg = "";
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回对象
|
|
||||||
*/
|
|
||||||
private Object data;
|
|
||||||
|
|
||||||
public static ApiResponseLower success(Object data) {
|
public static ApiResponseLower success(Object data) {
|
||||||
ApiResponseLower apiResponse = new ApiResponseLower();
|
ApiResponseLower apiResponse = new ApiResponseLower();
|
||||||
apiResponse.setCode(SUCCESS_CODE);
|
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