From 3ab8d7f1247da110b65bbaeb1906787a7b762ca6 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 20 十一月 2020 10:39:10 +0800
Subject: [PATCH] 优化代码

---
 service-user/src/main/java/com/java110/user/api/OwnerApi.java |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/service-user/src/main/java/com/java110/user/api/OwnerApi.java b/service-user/src/main/java/com/java110/user/api/OwnerApi.java
index 5ec1122..a7aed35 100644
--- a/service-user/src/main/java/com/java110/user/api/OwnerApi.java
+++ b/service-user/src/main/java/com/java110/user/api/OwnerApi.java
@@ -3,16 +3,13 @@
 import com.alibaba.fastjson.JSONObject;
 import com.java110.po.owner.OwnerPo;
 import com.java110.user.bmo.owner.IChangeOwnerPhone;
+import com.java110.user.bmo.owner.IComprehensiveQuery;
 import com.java110.user.bmo.owner.IQueryTenants;
 import com.java110.user.bmo.owner.IVisitorRecord;
 import com.java110.utils.util.Assert;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 @RestController
 @RequestMapping(value = "/ownerApi")
@@ -26,6 +23,10 @@
 
     @Autowired
     private IChangeOwnerPhone changeOwnerPhoneImpl;
+
+
+    @Autowired
+    private IComprehensiveQuery comprehensiveQueryImpl;
 
     @RequestMapping(value = "/tenants")
     public ResponseEntity<String> tenants(@RequestBody JSONObject reqJson) {
@@ -49,10 +50,10 @@
      */
     @RequestMapping(value = "/changeOwnerPhone", method = RequestMethod.POST)
     public ResponseEntity<String> changeOwnerPhone(@RequestBody JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson,"link","璇锋眰鎶ユ枃涓湭鍖呭惈鎵嬫満鍙�");
-        Assert.hasKeyAndValue(reqJson,"userId","璇锋眰鎶ユ枃涓湭鍖呭惈鐢ㄦ埛ID");
-        Assert.hasKeyAndValue(reqJson,"memberId","璇锋眰鎶ユ枃涓湭鍖呭惈涓氫富淇℃伅");
-        Assert.hasKeyAndValue(reqJson,"communityId","璇锋眰鎶ユ枃涓湭鍖呭惈灏忓尯淇℃伅");
+        Assert.hasKeyAndValue(reqJson, "link", "璇锋眰鎶ユ枃涓湭鍖呭惈鎵嬫満鍙�");
+        Assert.hasKeyAndValue(reqJson, "userId", "璇锋眰鎶ユ枃涓湭鍖呭惈鐢ㄦ埛ID");
+        Assert.hasKeyAndValue(reqJson, "memberId", "璇锋眰鎶ユ枃涓湭鍖呭惈涓氫富淇℃伅");
+        Assert.hasKeyAndValue(reqJson, "communityId", "璇锋眰鎶ユ枃涓湭鍖呭惈灏忓尯淇℃伅");
         OwnerPo ownerPo = new OwnerPo();
         ownerPo.setLink(reqJson.getString("link"));
         ownerPo.setMemberId(reqJson.getString("memberId"));
@@ -61,4 +62,19 @@
 
         return changeOwnerPhoneImpl.change(ownerPo);
     }
+
+    /**
+     * 缁煎悎鏌ヨ
+     *
+     * @param communityId 灏忓尯ID
+     * @return
+     * @service /ownerApi/comprehensiveQuery
+     * @path /app/ownerApi/comprehensiveQuery
+     */
+    @RequestMapping(value = "/comprehensiveQuery", method = RequestMethod.GET)
+    public ResponseEntity<String> comprehensiveQuery(@RequestParam(value = "communityId") String communityId,
+                                                     @RequestParam(value = "searchValue") String searchValue,
+                                                     @RequestParam(value = "searchType") String searchType) {
+        return comprehensiveQueryImpl.query(communityId, searchValue, searchType);
+    }
 }

--
Gitblit v1.8.0