@@ -374,11 +374,12 @@ public static JSONObject getCorrectRequest(@NotNull RequestMethod method, JSONOb
374
374
if (StringUtil .isNotEmpty (tag , true ) == false ) {
375
375
throw new IllegalArgumentException ("请设置tag!一般是Table名" );
376
376
}
377
+ int version = request .getIntValue (JSONRequest .KEY_VERSION );
377
378
378
379
JSONObject object = null ;
379
380
String error = "" ;
380
381
try {
381
- object = getStructure (method , "Request" , JSONRequest .KEY_TAG , tag );
382
+ object = getStructure (method , "Request" , JSONRequest .KEY_TAG , tag , version );
382
383
} catch (Exception e ) {
383
384
error = e .getMessage ();
384
385
}
@@ -396,6 +397,7 @@ public static JSONObject getCorrectRequest(@NotNull RequestMethod method, JSONOb
396
397
//获取指定的JSON结构 >>>>>>>>>>>>>>
397
398
398
399
request .remove (JSONRequest .KEY_TAG );
400
+ request .remove (JSONRequest .KEY_VERSION );
399
401
return Structure .parseRequest (method , "" , (JSONObject ) target .clone (), request );
400
402
}
401
403
@@ -431,11 +433,12 @@ public static JSONObject getCorrectResponse(@NotNull final RequestMethod method
431
433
* @param table
432
434
* @param key
433
435
* @param value
436
+ * @param version
434
437
* @return
435
438
* @throws Exception
436
439
*/
437
440
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 {
439
442
//获取指定的JSON结构 <<<<<<<<<<<<<<
440
443
SQLConfig config = new SQLConfig (GET , table );
441
444
config .setColumn ("structure" );
@@ -445,7 +448,12 @@ public static JSONObject getStructure(@NotNull final RequestMethod method, @NotN
445
448
if (key != null ) {
446
449
where .put (key , value );
447
450
}
451
+ if (version > 0 ) {
452
+ where .put (JSONRequest .KEY_VERSION + "{}" , ">=" + version );
453
+ }
448
454
config .setWhere (where );
455
+ config .setOrder (JSONRequest .KEY_VERSION + (version > 0 ? "+" : "-" ));
456
+ config .setCount (1 );
449
457
450
458
SQLExecutor qh = new SQLExecutor ();
451
459
0 commit comments