From 24bee1a669c3f01f4c3ce7c6f4f4e2e37fe3dfe2 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期六, 10 一月 2026 08:34:40 +0800
Subject: [PATCH] #application-dev
---
rsf-open-api/src/main/java/com/vincent/rsf/openApi/entity/dto/CommonResponse.java | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/rsf-open-api/src/main/java/com/vincent/rsf/openApi/entity/dto/CommonResponse.java b/rsf-open-api/src/main/java/com/vincent/rsf/openApi/entity/dto/CommonResponse.java
index 0e89156..6a9c23d 100644
--- a/rsf-open-api/src/main/java/com/vincent/rsf/openApi/entity/dto/CommonResponse.java
+++ b/rsf-open-api/src/main/java/com/vincent/rsf/openApi/entity/dto/CommonResponse.java
@@ -1,5 +1,6 @@
package com.vincent.rsf.openApi.entity.dto;
+import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -25,4 +26,35 @@
@ApiModelProperty("鍝嶅簲缁撴灉")
private Object data;
+ /**
+ * 鎴愬姛鍝嶅簲
+ */
+ public static CommonResponse ok() {
+ CommonResponse response = new CommonResponse();
+ response.setCode(200);
+ response.setMsg("鎿嶄綔鎴愬姛");
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("result", "SUCCESS");
+ response.setData(jsonObject);
+ return response;
+ }
+
+ public static CommonResponse ok(Object data) {
+ CommonResponse response = new CommonResponse();
+ response.setCode(200);
+ response.setMsg("鎿嶄綔鎴愬姛");
+ response.setData(data);
+ return response;
+ }
+
+ /**
+ * 澶辫触鍝嶅簲
+ */
+ public static CommonResponse error(String msg) {
+ CommonResponse response = new CommonResponse();
+ response.setCode(500);
+ response.setMsg(msg);
+ return response;
+ }
+
}
--
Gitblit v1.9.1