@@ -149,7 +149,7 @@ public static JSONObject init(boolean shutdownWhenServerError) throws ServerExce
149
149
, true
150
150
)
151
151
.setTag (item .getString (JSONRequest .KEY_TAG ))
152
- .setVersion (item .getInteger (JSONRequest .KEY_VERSION ))
152
+ .setVersion (item .getIntValue (JSONRequest .KEY_VERSION ))
153
153
.parseResponse (demo );
154
154
155
155
if (JSONResponse .isSuccess (r ) == false ) {
@@ -328,10 +328,10 @@ private JSONArray getChildCommentIdList(long tid) {
328
328
* @return
329
329
* @throws ServerException
330
330
*/
331
- public JSONObject getFunctionDemo (@ NotNull JSONObject request ) throws ServerException {
331
+ public JSONObject getFunctionDemo (@ NotNull JSONObject request ) {
332
332
JSONObject demo = JSON .parseObject (request .getString ("demo" ));
333
333
if (demo == null ) {
334
- throw new ServerException ( "服务器内部错误,字段 demo 的值必须为合法且非 null 的 JSONObejct 字符串!" );
334
+ demo = new JSONObject ( );
335
335
}
336
336
if (demo .containsKey ("result()" ) == false ) {
337
337
demo .put ("result()" , getFunctionCall (request .getString ("name" ), request .getString ("arguments" )));
@@ -353,15 +353,15 @@ public String getFunctionDetail(@NotNull JSONObject request) {
353
353
* @return
354
354
*/
355
355
private static String getFunctionCall (String name , String arguments ) {
356
- return name + "(" + arguments + ")" ;
356
+ return name + "(" + StringUtil . getTrimedString ( arguments ) + ")" ;
357
357
}
358
358
359
359
/**TODO 仅用来测试 "key-()":"getIdList()" 和 "key()":"getIdList()"
360
360
* @param request
361
361
* @return JSONArray 只能用JSONArray,用long[]会在SQLConfig解析崩溃
362
362
* @throws Exception
363
363
*/
364
- public JSONArray getIdList (@ NotNull JSONObject request ) throws Exception {
364
+ public JSONArray getIdList (@ NotNull JSONObject request ) {
365
365
return new JSONArray (new ArrayList <Object >(Arrays .asList (12 , 15 , 301 , 82001 , 82002 , 38710 )));
366
366
}
367
367
0 commit comments