浏览代码

兼容部分请求参数首字母大写

zhangqiankun 3 年之前
父节点
当前提交
b976cf3e3e

+ 4 - 5
src/main/java/com/persagy/proxy/adm/handler/SpaceRelationInfoHandler.java

@@ -8,7 +8,6 @@ import java.util.Set;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -232,8 +231,8 @@ public class SpaceRelationInfoHandler {
 			result.put("projectId", objectDigital.getProjectId());
 			result.put("localName", objectDigital.getLocalName());
 			result.put("name", objectDigital.getName());
-			result.putPOJO("infos", new JSONArray());
-			result.putPOJO("statistics", new JSONArray());
+			result.putPOJO("infos", new JSONObject());
+			result.putPOJO("statistics", new JSONObject());
 			result.put("state", (objectDigital.getValid() == null || objectDigital.getValid() == 1) ? 0 : 1);
 			result.put("createTime", objectDigital.getCreationTime().toString("yyyy-MM-dd HH:mm:ss"));
 			
@@ -267,8 +266,8 @@ public class SpaceRelationInfoHandler {
 				objectNode.put("buildingId", buildingId);
 			}
 			
-			objectNode.putPOJO("infos", new JSONArray());
-			objectNode.putPOJO("statistics", new JSONArray());
+			objectNode.putPOJO("infos", new JSONObject());
+			objectNode.putPOJO("statistics", new JSONObject());
 			objectNode.put("state", objectNode.has("valid") ? (objectNode.get("valid").asInt(0) == 1 ? 0 : 1) : 0);
 		}
 		

+ 4 - 1
src/main/java/com/persagy/proxy/adm/model/AdmDCSQueryRequest.java

@@ -2,6 +2,7 @@ package com.persagy.proxy.adm.model;
 
 import java.util.Set;
 
+import com.fasterxml.jackson.annotation.JsonAlias;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 
 import lombok.Data;
@@ -24,8 +25,10 @@ public class AdmDCSQueryRequest extends AdmQueryCriteria {
     private String buildingId;
 
     /** 空间类型 */
+    @JsonAlias(value = {"zoneType", "ZoneType"})
     private String zoneType;
 
-    /** 空间类型 空间类型列表 */ 
+    /** 空间类型 空间类型列表 */
+    @JsonAlias(value = {"zoneTypeList", "ZoneTypeList"})
     private Set<String> zoneTypeList;
 }

+ 1 - 0
src/main/java/com/persagy/proxy/adm/request/AdmQueryCriteria.java

@@ -34,6 +34,7 @@ public class AdmQueryCriteria {
     /** 字段影射,空为查询所有字段 */
     private List<String> projection;
     /** 级联对象列表 */
+    @JsonAlias(value = {"cascade", "Cascade"})
     private List<AdmQueryCriteria> cascade;
     /** 分组统计 */
     private AdmQueryGroup group;