@@ -374,11 +374,12 @@ public static JSONObject getCorrectRequest(@NotNull RequestMethod method, JSONOb
374374 if (StringUtil .isNotEmpty (tag , true ) == false ) {
375375 throw new IllegalArgumentException ("请设置tag!一般是Table名" );
376376 }
377+ int version = request .getIntValue (JSONRequest .KEY_VERSION );
377378
378379 JSONObject object = null ;
379380 String error = "" ;
380381 try {
381- object = getStructure (method , "Request" , JSONRequest .KEY_TAG , tag );
382+ object = getStructure (method , "Request" , JSONRequest .KEY_TAG , tag , version );
382383 } catch (Exception e ) {
383384 error = e .getMessage ();
384385 }
@@ -396,6 +397,7 @@ public static JSONObject getCorrectRequest(@NotNull RequestMethod method, JSONOb
396397 //获取指定的JSON结构 >>>>>>>>>>>>>>
397398
398399 request .remove (JSONRequest .KEY_TAG );
400+ request .remove (JSONRequest .KEY_VERSION );
399401 return Structure .parseRequest (method , "" , (JSONObject ) target .clone (), request );
400402 }
401403
@@ -431,11 +433,12 @@ public static JSONObject getCorrectResponse(@NotNull final RequestMethod method
431433 * @param table
432434 * @param key
433435 * @param value
436+ * @param version
434437 * @return
435438 * @throws Exception
436439 */
437440 public static JSONObject getStructure (@ NotNull final RequestMethod method , @ NotNull String table ,
438- String key , String value ) throws Exception {
441+ String key , String value , int version ) throws Exception {
439442 //获取指定的JSON结构 <<<<<<<<<<<<<<
440443 SQLConfig config = new SQLConfig (GET , table );
441444 config .setColumn ("structure" );
@@ -445,7 +448,12 @@ public static JSONObject getStructure(@NotNull final RequestMethod method, @NotN
445448 if (key != null ) {
446449 where .put (key , value );
447450 }
451+ if (version > 0 ) {
452+ where .put (JSONRequest .KEY_VERSION + "{}" , ">=" + version );
453+ }
448454 config .setWhere (where );
455+ config .setOrder (JSONRequest .KEY_VERSION + (version > 0 ? "+" : "-" ));
456+ config .setCount (1 );
449457
450458 SQLExecutor qh = new SQLExecutor ();
451459
0 commit comments