From 25f0bc24fc9f6766dd21a6fb07a0b72626f5a851 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Sun, 27 Dec 2020 02:10:36 +0800 Subject: [PATCH] =?UTF-8?q?Java=EF=BC=9A=E5=8D=87=E7=BA=A7=20APIJSON=20?= =?UTF-8?q?=E5=92=8C=20apijson-framework=20=E5=88=86=E5=88=AB=E8=87=B3=204?= =?UTF-8?q?.4.7=20=E5=92=8C=204.4.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APIJSON-Java-Server/APIJSONBoot/pom.xml | 6 +++--- APIJSON-Java-Server/APIJSONFinal/pom.xml | 6 +++--- .../src/main/java/apijson/demo/DemoFunctionParser.java | 8 ++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/APIJSON-Java-Server/APIJSONBoot/pom.xml b/APIJSON-Java-Server/APIJSONBoot/pom.xml index 1df27f10..e18d1d33 100755 --- a/APIJSON-Java-Server/APIJSONBoot/pom.xml +++ b/APIJSON-Java-Server/APIJSONBoot/pom.xml @@ -5,7 +5,7 @@ apijson.boot apijson-boot - 4.4.6 + 4.4.9 jar APIJSONBoot @@ -41,12 +41,12 @@ com.github.Tencent APIJSON - 4.3.1 + 4.4.7 com.github.APIJSON apijson-framework - 4.4.6 + 4.4.9 diff --git a/APIJSON-Java-Server/APIJSONFinal/pom.xml b/APIJSON-Java-Server/APIJSONFinal/pom.xml index f0ef180d..3b502a4c 100755 --- a/APIJSON-Java-Server/APIJSONFinal/pom.xml +++ b/APIJSON-Java-Server/APIJSONFinal/pom.xml @@ -4,7 +4,7 @@ apijson.jfinal apijson-final jar - 4.4.6 + 4.4.9 Demo project for APIJSON Server based on JFinal http://maven.apache.org @@ -24,12 +24,12 @@ com.github.Tencent APIJSON - 4.3.1 + 4.4.7 com.github.APIJSON apijson-framework - 4.4.6 + 4.4.9 diff --git a/APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/DemoFunctionParser.java b/APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/DemoFunctionParser.java index db4fb2b4..bc0ca215 100644 --- a/APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/DemoFunctionParser.java +++ b/APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/DemoFunctionParser.java @@ -52,6 +52,10 @@ public DemoFunctionParser(RequestMethod method, String tag, int version, JSONObj */ public Object verifyIdList(@NotNull JSONObject current, @NotNull String idList) throws Exception { Object obj = current.get(idList); + if (obj == null) { + return null; + } + if (obj instanceof Collection == false) { throw new IllegalArgumentException(idList + " 不符合 Array 类型! 结构必须是 [] !"); } @@ -74,6 +78,10 @@ public Object verifyIdList(@NotNull JSONObject current, @NotNull String idList) */ public Object verifyURLList(@NotNull JSONObject current, @NotNull String urlList) throws Exception { Object obj = current.get(urlList); + if (obj == null) { + return null; + } + if (obj instanceof Collection == false) { throw new IllegalArgumentException(urlList + " 不符合 Array 类型! 结构必须是 [] !"); }