From 7b487d4c819bc67021cf224c5042066bf73df1e3 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期六, 28 十月 2023 17:01:00 +0800
Subject: [PATCH] 10.28。2
---
cloud-server-other/src/main/java/com/dsh/other/util/ResultUtil.java | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/cloud-server-other/src/main/java/com/dsh/other/util/ResultUtil.java b/cloud-server-other/src/main/java/com/dsh/other/util/ResultUtil.java
index e84ecdd..a5794d6 100644
--- a/cloud-server-other/src/main/java/com/dsh/other/util/ResultUtil.java
+++ b/cloud-server-other/src/main/java/com/dsh/other/util/ResultUtil.java
@@ -3,12 +3,13 @@
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.Data;
/**
* 定义统一返回对象
*/
@ApiModel(value = "统一返回结果集")
+@Data
public class ResultUtil<T> {
public static final Integer SUCCESS = 200;
@@ -51,7 +52,7 @@
return code;
}
- private ResultUtil(Integer code, String msg) {
+ public ResultUtil(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
@@ -107,8 +108,8 @@
* 参数异常
* @return
*/
- public static ResultUtil paranErr(){
- return ResultUtil.getResult(ResultUtil.PARAM_ERROR, "PARAM_ERROR", new JSONObject());
+ public static ResultUtil paranErr(String ages){
+ return ResultUtil.getResult(ResultUtil.PARAM_ERROR, "【" + ages + "】参数异常", new JSONObject());
}
/**
@@ -116,11 +117,10 @@
* @return
*/
public static <T> ResultUtil<T> paranErr(T data){
- return ResultUtil.getResult(ResultUtil.PARAM_ERROR, "SYSTEM_RUN_ERROR", data);
+ return ResultUtil.getResult(ResultUtil.PARAM_ERROR, "PARAM_ERROR", data);
}
- @Autowired
- private static MessageUtils messageUtils;
+
/**
* 运行异常
* @return
@@ -130,6 +130,8 @@
}
+
+
/**
* 运行异常
* @return
--
Gitblit v1.7.1