From bbe76086f95dfb34e942d9f2801e17db38391c68 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期二, 21 十一月 2023 21:34:05 +0800
Subject: [PATCH] 接口测试

---
 ycl-common/src/main/java/com/ycl/api/CommonResult.java |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/ycl-common/src/main/java/com/ycl/api/CommonResult.java b/ycl-common/src/main/java/com/ycl/api/CommonResult.java
index 793afa4..6e210ec 100644
--- a/ycl-common/src/main/java/com/ycl/api/CommonResult.java
+++ b/ycl-common/src/main/java/com/ycl/api/CommonResult.java
@@ -13,11 +13,17 @@
     protected CommonResult() {
     }
 
+    public CommonResult(long code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
     protected CommonResult(long code, String message, T data) {
         this.code = code;
         this.message = message;
         this.data = data;
     }
+
 
     /**
      * 鎴愬姛杩斿洖缁撴灉
@@ -29,6 +35,15 @@
     }
 
     /**
+     * @Description  api鑾峰彇鎴愬姛
+     * @Param [data]
+     * @return com.ycl.api.CommonResult<T>
+     **/
+    public static <T> CommonResult<T> successApi(T data) {
+        return new CommonResult<T>(ResultCode.API_SUCCESS.getCode(), ResultCode.API_SUCCESS.getMessage(), data);
+    }
+
+    /**
      * 鎴愬姛杩斿洖缁撴灉
      *
      * @param data 鑾峰彇鐨勬暟鎹�

--
Gitblit v1.8.0