From 435b1cfe40ee2822381274d3a0a4f9066157b02b Mon Sep 17 00:00:00 2001
From: zhangzeli <123456>
Date: 星期三, 05 一月 2022 09:26:17 +0800
Subject: [PATCH] 回复

---
 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
index 46284f5..778059a 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
@@ -10,6 +10,7 @@
 import cn.exrick.xboot.your.util.HttpUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -29,7 +30,7 @@
  */
 @Slf4j
 @RestController
-@Api(tags = "璁㈠崟鎺ュ彛")
+@Api(tags = "灏忕▼搴忔帴鍙�")
 @RequestMapping("/xboot/wx")
 @Transactional
 public class IndexController {
@@ -57,7 +58,8 @@
 
 
     //2.寰俊鐧婚檰
-    @RequestMapping("/login")
+    @RequestMapping(value = "/login", method = RequestMethod.POST)
+    @ApiOperation(value = "寰俊鐧婚檰")
     public Object doLogin(String code){
 
         JSONObject SessionKeyOpenId = getSessionKeyOrOpenId( code );
@@ -89,7 +91,8 @@
     //3.寰俊缁戝畾闆跺敭璁稿彲璇�
     //licence:闆跺敭璁稿彲璇佸彿
     //openId锛氬井淇d
-    @RequestMapping("/bindWx")
+    @RequestMapping(value = "/bindWx", method = RequestMethod.POST)
+    @ApiOperation(value = "寰俊缁戝畾闆跺敭璁稿彲璇�")
     public Object bindWx(String licence,String openId){
         QueryWrapper<Customer> wrapper = new QueryWrapper<>();
         wrapper.eq("licence",licence);
@@ -104,7 +107,8 @@
     }
 
     //4.鑾峰彇浠婃棩閰嶉�佽鍗�
-    @RequestMapping("/getTodayOrder")
+    @RequestMapping(value = "/getTodayOrder", method = RequestMethod.POST)
+    @ApiOperation(value = "鑾峰彇浠婃棩閰嶉�佽鍗�")
     public Object getTodayOrder(String customerId){
         OrderTask orderTask = getOrder(customerId);
         if(orderTask==null){
@@ -127,7 +131,8 @@
     }
 
     //5.鑾峰彇杞﹁締浣嶇疆
-    @RequestMapping("/getCarInfo")
+    @RequestMapping(value = "/getCarInfo",method = RequestMethod.POST)
+    @ApiOperation(value = "鑾峰彇杞﹁締浣嶇疆")
     public Object getCarInfo(String customerId){
         QueryWrapper<OrderTask> wrapper2 = new QueryWrapper<OrderTask>();
         String format = DateUtil.format(new Date(), "yyyy-MM-dd");
@@ -141,7 +146,8 @@
         String latestGps = haiKangPost.findLatestGps(carids);
         JSONObject jsonObject = JSONUtil.parseObj(latestGps);
         String data = jsonObject.getStr("data");
-        JSONObject jsonObject2 = JSONUtil.parseObj(data);
+        JSONArray objects = JSONUtil.parseArray(data);
+        JSONObject jsonObject2 = objects.getJSONObject(0);
         Integer lng = jsonObject2.getInt("longitude");
         Integer lat = jsonObject2.getInt("latitude");
 
@@ -154,7 +160,8 @@
     }
 
     //6.鍔犳补鍔╁姏
-    @RequestMapping("/likes")
+    @RequestMapping(value = "/likes", method = RequestMethod.POST)
+    @ApiOperation(value = "鍔犳补鍔╁姏")
     public Object likes(String customerId){
         OrderTask order = getOrder(customerId);
         order.setLikes(1);
@@ -163,7 +170,8 @@
     }
 
     //7.鑾峰彇璁㈠崟鍒楄〃
-    @RequestMapping("/getOrderList")
+    @RequestMapping(value = "/getOrderList", method = RequestMethod.POST)
+    @ApiOperation(value = "鑾峰彇璁㈠崟鍒楄〃")
     public Object getOrderList(String customerId, String startTime, String endTime, PageVo page){
         page.setSort("sendDate");
         page.setOrder("desc");
@@ -180,7 +188,8 @@
     }
 
     //8.鑾峰彇璁㈠崟璇︽儏鍒楄〃
-    @RequestMapping("/getOrderDetail")
+    @RequestMapping(value = "/getOrderDetail", method = RequestMethod.POST)
+    @ApiOperation(value = "鑾峰彇璁㈠崟璇︽儏鍒楄〃")
     public Object getOrderDetail(String orderId){
         QueryWrapper<OrderDetail> wrapper = new QueryWrapper<>();
         wrapper.eq("order_id",orderId);
@@ -189,7 +198,8 @@
     }
 
     //9.璇勪环
-    @RequestMapping("/remark")
+    @RequestMapping(value = "/remark", method = RequestMethod.POST)
+    @ApiOperation(value = "璇勪环")
     public Object remark(int level,String orderId){
         OrderTask byId = iOrderTaskService.getById(orderId);
         byId.setLevel(level);
@@ -200,6 +210,7 @@
 
     //10.鑾峰彇鎰忚寤鸿鍒楄〃
     @RequestMapping(value = "/getSuggestByPage", method = RequestMethod.GET)
+    @ApiOperation(value = "鑾峰彇鎰忚寤鸿鍒楄〃")
     public Result<IPage<Suggest>> getByPage(String customerId,PageVo page) {
         QueryWrapper<Suggest> wrapper = new QueryWrapper<>();
         wrapper.eq("customer_id",customerId);
@@ -209,6 +220,7 @@
 
     //12.鏂板鎰忚寤鸿
     @RequestMapping(value = "/insertSuggest", method = RequestMethod.POST)
+    @ApiOperation(value = "鏂板鎰忚寤鸿")
     public Result<Suggest> insertSuggest(String customerId,String content) {
         Suggest suggest = new Suggest();
         suggest.setContent(content);
@@ -221,6 +233,7 @@
 
     //13.鏂板绛炬敹浜�
     @RequestMapping(value = "/insertReceive", method = RequestMethod.POST)
+    @ApiOperation(value = "鏂板绛炬敹浜�")
     public Result<CustomerReceive> insertReceive(String customerId,String name,String phone) {
         CustomerReceive customerReceive = new CustomerReceive();
         customerReceive.setCustomerId(customerId);

--
Gitblit v1.9.1