From e37f04c97ef893edce5f3f748398424fa17ffc2a Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 18 九月 2024 10:04:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java
index fb2630c..d6da63d 100644
--- a/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java
+++ b/Source/ExampleIntegratedPushCalled/src/main/java/com/vci/ubcs/example/controller/PushIntegrationController.java
@@ -3,11 +3,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.vci.ubcs.example.entity.RequestData;
-import org.springblade.core.tool.api.R;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
@@ -17,14 +13,15 @@
import java.util.List;
/**
- * 缂栫爜璧勬簮绠$悊绯荤粺缁熶竴鎺ㄩ��
- * UBCS缂栫爜璧勬簮绠$悊绯荤粺瀵癸紝
+ * 缂栫爜璧勬簮绠$悊绯荤粺瀵瑰叾浠栫郴缁熺殑缁熶竴鎺ㄩ�侊紝琚皟鏂瑰畾涔夋柟寮�
+ * UBCS缂栫爜璧勬簮绠$悊绯荤粺瀵�
* 鍏朵粬闆嗘垚鐨勭郴缁熻繘琛屾帹閫佺殑锛�
- * 鎺ㄩ�佹斁api瀹氫箟绀轰緥
+ * 鎺ュ彈鎺ㄩ�佺殑api瀹氫箟绀轰緥
* @author ludc
* @date 2024/2/27 20:31
*/
-@RestController("/pushIntegration")
+@RestController
+@RequestMapping("/pushIntegration")
public class PushIntegrationController {
/**
@@ -36,11 +33,11 @@
* @throws IOException
*/
@PostMapping("/testByForm1")
- public R test(@RequestParam String dataType, @RequestParam String dataString) throws IOException {
+ public String test(@RequestParam String dataType, @RequestParam String dataString) throws IOException {
// 鐩稿叧閫昏緫澶勭悊
System.out.println(dataType);
System.out.println(dataString);
- return R.status(true);
+ return "鎴愬姛";
}
/**
@@ -51,7 +48,7 @@
* @throws IOException
*/
@PostMapping("/testByForm2")
- public R test1(ServletRequest request) throws IOException {
+ public String test1(ServletRequest request) throws IOException {
HttpServletRequest request1 = (HttpServletRequest) request;
String dataString = request1.getParameter("dataString");
ServletInputStream inputStream = request1.getInputStream();
@@ -66,7 +63,7 @@
JSONObject jsonObject = JSONObject.parseObject(body);
JSONArray jsonArray = jsonObject.getJSONArray("dataString");
- return R.data(jsonArray);
+ return jsonArray.toJSONString();
}
/**
@@ -77,13 +74,13 @@
* @throws IOException
*/
@PostMapping("/testByAppjson")
- public R test1(@RequestBody RequestData requestData) throws IOException {
+ public String test1(@RequestBody RequestData requestData) throws IOException {
// 鎷垮埌杩欎釜鍙傛暟涔嬪悗鍙栬闆嗗悎涓殑绗竴涓厓绱狅紝灏辨槸瑕乯son杞垚瀵硅薄鐨勫弬鏁�
// 濡傛湁鍏蜂綋杞崲瑕佹眰锛屽垯鏍规嵁缂栫爜鍣ㄤ腑鐨勬帴鍙f彁渚涚殑閰嶇疆鑰屽畾锛岄�氬父涓篸ataType瀛楁锛屽xml锛宩son涓ょ鎯呭喌
List<Object> dataString = requestData.getDataString();
// JSONObject.parseObject(dataString,/*鏍规嵁缂栫爜绯荤粺鎻愪緵鐨勫璞″睘鎬ц�屽畾涔夌殑瀵硅薄*/);
List<String> dataType = requestData.getDataType();
- return R.data(dataString);
+ return JSONObject.toJSONString(dataString);
}
}
--
Gitblit v1.9.3