diff --git a/APIJSONORM/pom.xml b/APIJSONORM/pom.xml
index 391319beb..5f8698378 100644
--- a/APIJSONORM/pom.xml
+++ b/APIJSONORM/pom.xml
@@ -5,7 +5,7 @@
com.github.Tencent
APIJSON
- 8.0.0
+ 8.1.6
jar
APIJSONORM
diff --git a/APIJSONORM/src/main/java/apijson/JSON.java b/APIJSONORM/src/main/java/apijson/JSON.java
index c31170c44..0a14e0420 100755
--- a/APIJSONORM/src/main/java/apijson/JSON.java
+++ b/APIJSONORM/src/main/java/apijson/JSON.java
@@ -1,4 +1,4 @@
-/*Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
+/*Copyright (C) 2020 Tencent. All rights reserved.
This source code is licensed under the Apache License Version 2.0.*/
@@ -674,4 +674,18 @@ public static String getString(Map map, String key) {
return value.toString();
}
+
+ public static Object getFromObjOrArr(Object parent, String k) {
+ if (parent instanceof Map, ?>) {
+ return ((Map) parent).get(k);
+ }
+
+ if (parent instanceof List>) {
+ int j = Integer.valueOf(k);
+ return ((List>) parent).get(j);
+ }
+
+ return null;
+ }
+
}
diff --git a/APIJSONORM/src/main/java/apijson/JSONCreator.java b/APIJSONORM/src/main/java/apijson/JSONCreator.java
index fcabe2fe0..df0d9066a 100755
--- a/APIJSONORM/src/main/java/apijson/JSONCreator.java
+++ b/APIJSONORM/src/main/java/apijson/JSONCreator.java
@@ -1,4 +1,4 @@
-/*Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
+/*Copyright (C) 2020 Tencent. All rights reserved.
This source code is licensed under the Apache License Version 2.0.*/
diff --git a/APIJSONORM/src/main/java/apijson/JSONList.java b/APIJSONORM/src/main/java/apijson/JSONList.java
index 0aa448fcb..092bf9f39 100644
--- a/APIJSONORM/src/main/java/apijson/JSONList.java
+++ b/APIJSONORM/src/main/java/apijson/JSONList.java
@@ -1,4 +1,4 @@
-/*Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
+/*Copyright (C) 2020 Tencent. All rights reserved.
This source code is licensed under the Apache License Version 2.0.*/
diff --git a/APIJSONORM/src/main/java/apijson/JSONMap.java b/APIJSONORM/src/main/java/apijson/JSONMap.java
index 0bf0b6825..c29130553 100755
--- a/APIJSONORM/src/main/java/apijson/JSONMap.java
+++ b/APIJSONORM/src/main/java/apijson/JSONMap.java
@@ -1,4 +1,4 @@
-/*Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
+/*Copyright (C) 2020 Tencent. All rights reserved.
This source code is licensed under the Apache License Version 2.0.*/
@@ -109,19 +109,32 @@ public static boolean isTableArray(String key) {
public static String KEY_USER_ID = "userId";
public static String KEY_USER_ID_IN = KEY_USER_ID + "{}";
+ default String getIdKey() {
+ return KEY_ID;
+ }
+ default String getIdInKey() {
+ return KEY_ID_IN;
+ }
+ default String getUserIdKey() {
+ return KEY_USER_ID;
+ }
+ default String getUserIdInKey() {
+ return KEY_USER_ID_IN;
+ }
+
/**set "id":id in Table layer
* @param id
* @return
*/
default JSONMap setId(Long id) {
- return puts(KEY_ID, id);
+ return puts(getIdKey(), id);
}
/**set "id{}":[] in Table layer
* @param list
* @return
*/
default JSONMap setIdIn(List