Переглянути джерело

更新 jk105、jk111 接口

wuweihao 3 роки тому
батько
коміт
1aa718b816

+ 8 - 1
README.md

@@ -9,4 +9,11 @@
 
 2022-6-27 二期接口文档
 https://xtpt.yuque.com/books/share/826c2d4f-1ddb-4bd3-95d8-94729984d695?# 
-《数据开放平台》密码:ympb
+《数据开放平台》密码:ympb
+
+## 社区码 2022-08-18
+     社区码查询
+     https://tfsmy.chengdu.gov.cn/cbase/bud-cloud-governance-biz/openApi/district/getAllDistrict?cityCode=510114001
+     
+     
+     绿景社区:510114001017240

+ 1 - 1
gis_application/src/main/resources/application.properties

@@ -1,6 +1,6 @@
 server.port=8013
 
-spring.profiles.active=pro
+spring.profiles.active=dev
 
 # \u8BBF\u95EE\u9759\u6001\u8D44\u6E90\u8BBE\u7F6E
 spring.resources.static-locations=classpath:templates/,classpath:static/,classpath:web/

+ 1 - 1
gis_application/target/classes/application.properties

@@ -1,6 +1,6 @@
 server.port=8013
 
-spring.profiles.active=pro
+spring.profiles.active=dev
 
 # \u8BBF\u95EE\u9759\u6001\u8D44\u6E90\u8BBE\u7F6E
 spring.resources.static-locations=classpath:templates/,classpath:static/,classpath:web/

Різницю між файлами не показано, бо вона завелика
+ 0 - 162
gis_common/src/main/java/com/gis/common/deyuan/util/NewResultUtils.java


+ 4 - 0
gis_common/src/main/java/com/gis/common/deyuan/util/ResultUtils.java

@@ -89,8 +89,12 @@ public class ResultUtils {
                     String result = jsonObject.getString("result");
 
                     String s = RSAUtils.decryptByPrivateKey(result, RSAUtils.getPrivateKey(privateKyeRes));
+//                    log.info("解密后:{}", s);
                     resultData = URLDecoder.decode(s, "utf-8");
+                } else {
+                    return Result.failure(restResult);
                 }
+
             }
         } catch (Exception e) {
             e.printStackTrace();

+ 9 - 10
gis_common/src/main/java/com/gis/common/util/Result.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
+import java.time.LocalDateTime;
 
 /**
  * 通用返回类
@@ -37,6 +38,9 @@ public class Result<T> implements Serializable {
      */
     @ApiModelProperty(value = "返回数据", name = "data")
     private T data;
+
+    @ApiModelProperty(value = "时间戳", name = "timestamp")
+    private LocalDateTime timestamp;
     /**
      * 处理成功,并返回数据
      *
@@ -44,7 +48,7 @@ public class Result<T> implements Serializable {
      * @return data
      */
     public static Result success(Object data) {
-        return new Result(CODE_SUCCESS, SUCCESS_MSG, data);
+        return new Result(CODE_SUCCESS, SUCCESS_MSG, data, LocalDateTime.now());
     }
     /**
      * 处理成功
@@ -52,7 +56,7 @@ public class Result<T> implements Serializable {
      * @return data
      */
     public static Result success() {
-        return new Result(CODE_SUCCESS, SUCCESS_MSG, NOOP);
+        return new Result(CODE_SUCCESS, SUCCESS_MSG, NOOP, LocalDateTime.now());
     }
     /**
      * 处理成功
@@ -61,7 +65,7 @@ public class Result<T> implements Serializable {
      * @return data
      */
     public static Result success(String msg) {
-        return new Result(CODE_SUCCESS, msg, NOOP);
+        return new Result(CODE_SUCCESS, msg, NOOP, LocalDateTime.now());
     }
     /**
      * 处理成功
@@ -71,7 +75,7 @@ public class Result<T> implements Serializable {
      * @return data
      */
     public static Result success(String msg, Object data) {
-        return new Result(CODE_SUCCESS, msg, data);
+        return new Result(CODE_SUCCESS, msg, data, LocalDateTime.now());
     }
     /**
      * 处理失败,并返回数据(一般为错误信息)
@@ -81,7 +85,7 @@ public class Result<T> implements Serializable {
      * @return data
      */
     public static Result failure(int code, String msg) {
-        return new Result(code, msg, NOOP);
+        return new Result(code, msg, NOOP , LocalDateTime.now());
     }
     /**
      * 处理失败
@@ -93,9 +97,4 @@ public class Result<T> implements Serializable {
         return failure(CODE_FAILURE, msg);
     }
 
-    @Override
-    public String toString() {
-        return "JsonResult [code=" + code + ", msg=" + msg + ", data="
-                + data + "]";
-    }
 }

+ 0 - 1
gis_web/src/main/java/com/gis/web/controller/dafengSmartCommunityController/CommunityOverview.java

@@ -1,6 +1,5 @@
 package com.gis.web.controller.dafengSmartCommunityController;
 
-import com.gis.common.deyuan.util.NewResultUtils;
 import com.gis.common.deyuan.util.ResultUtils;
 import com.gis.common.util.Result;
 import io.swagger.annotations.Api;

+ 0 - 2
gis_web/src/main/java/com/gis/web/controller/dafengSmartCommunityController/EmergencyCommand.java

@@ -1,7 +1,6 @@
 package com.gis.web.controller.dafengSmartCommunityController;
 
 import com.gis.common.config.ConfigConstant;
-import com.gis.common.deyuan.util.NewResultUtils;
 import com.gis.common.deyuan.util.ResultUtils;
 import com.gis.common.util.Result;
 import com.gis.web.dto.MyEventObject;
@@ -13,7 +12,6 @@ import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.EventObject;
 import java.util.HashMap;
 
 @Log4j2

+ 3 - 4
gis_web/src/main/java/com/gis/web/controller/dafengSmartCommunityController/SmartHumanRoom.java

@@ -1,6 +1,5 @@
 package com.gis.web.controller.dafengSmartCommunityController;
 
-import com.gis.common.deyuan.util.NewResultUtils;
 import com.gis.common.deyuan.util.ResultUtils;
 import com.gis.common.util.Result;
 import io.swagger.annotations.Api;
@@ -34,7 +33,7 @@ public class SmartHumanRoom {
     }
 
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "code", value = "房屋id 如:", dataType = "String"),
+            @ApiImplicitParam(name = "code", value = "房屋id 如:sit: aa3b9f38-7523-44ad-b2ab-6055e2a6e16f, pro:1e8f5ac9-9394-4c4b-9d3e-1932a5e7c2e7", dataType = "String"),
     })
     @ApiOperation("JK111-根据房屋ID获取人员信息")
     @GetMapping("getPeopleByHouseId/{code}")
@@ -46,10 +45,10 @@ public class SmartHumanRoom {
     }
 
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "code", value = "小区编码 如:510114001017240", dataType = "String")
+            @ApiImplicitParam(name = "code", value = "小区编码 如:sit: 510108016014007, pro:510108015554306", dataType = "String")
     })
     @ApiOperation("JK105-根据小区编码得到所有的单元和房号")
-    @PostMapping("peopleEntrance")
+    @PostMapping("peopleEntrance/{code}")
     public Result peopleEntrance(@PathVariable String code){
         String apiUrl = "/open/api/v1/community/houseTree";
         HashMap<String, Object> param = new HashMap<>();