@@ -866,69 +866,79 @@ var CodeUtil = {
866
866
return table . TABLE_COMMENT ;
867
867
}
868
868
869
+
870
+ //功能符 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
871
+
869
872
if ( columnName . endsWith ( "()" ) ) { //方法,查询完后处理,先用一个Map<key,function>保存?
870
873
return '远程函数' ;
871
874
}
872
875
873
- var prefix ;
874
- var at = '' ;
875
- var key ;
876
876
877
+ var at = '' ;
877
878
if ( columnName . endsWith ( "@" ) ) { //引用,引用对象查询完后处理。fillTarget中暂时不用处理,因为非GET请求都是由给定的id确定,不需要引用
878
879
at = '引用赋值' ;
879
880
columnName = columnName . substring ( 0 , columnName . length - 1 ) ;
880
881
}
881
882
883
+ var fun ;
884
+ var key ;
882
885
if ( columnName . endsWith ( "$" ) ) { //搜索,查询时处理
883
- prefix = '模糊搜索' ;
886
+ fun = '模糊搜索' ;
884
887
key = columnName . substring ( 0 , columnName . length - 1 ) ;
885
888
}
886
889
else if ( columnName . endsWith ( "?" ) ) { //匹配正则表达式,查询时处理
887
- prefix = '正则匹配' ;
890
+ fun = '正则匹配' ;
888
891
key = columnName . substring ( 0 , columnName . length - 1 ) ;
889
892
}
890
893
else if ( columnName . endsWith ( "{}" ) ) { //被包含,或者说key对应值处于value的范围内。查询时处理
891
- prefix = '匹配 选项/条件' ;
894
+ fun = '匹配 选项/条件' ;
892
895
key = columnName . substring ( 0 , columnName . length - 2 ) ;
893
896
}
894
897
else if ( columnName . endsWith ( "<>" ) ) { //包含,或者说value处于key对应值的范围内。查询时处理
895
- prefix = '包含选项' ;
898
+ fun = '包含选项' ;
896
899
key = columnName . substring ( 0 , columnName . length - 2 ) ;
897
900
}
898
901
else if ( columnName . endsWith ( "+" ) ) { //延长,PUT查询时处理
899
902
//if (method == PUT) {//不为PUT就抛异常
900
- prefix = '增加 或 扩展 ' ;
903
+ fun = '增加 或 扩展 ' ;
901
904
key = columnName . substring ( 0 , columnName . length - 1 ) ;
902
905
//}
903
906
}
904
907
else if ( columnName . endsWith ( "-" ) ) { //缩减,PUT查询时处理
905
908
//if (method == PUT) {//不为PUT就抛异常
906
- prefix = '减少 或 去除' ;
909
+ fun = '减少 或 去除' ;
907
910
key = columnName . substring ( 0 , columnName . length - 1 ) ;
908
911
//}
909
912
}
910
913
else {
911
- prefix = '' ;
914
+ fun = '' ;
912
915
key = new String ( columnName ) ;
913
916
}
914
917
915
918
916
- var last = null ; //不用Logic优化代码,否则 key 可能变为 key| 导致 key=value 变成 key|=value 而出错
919
+ var logic = '' ;
917
920
//if (RequestMethod.isQueryMethod(method)) {//逻辑运算符仅供GET,HEAD方法使用
918
- last = key . length <= 0 ? "" : key . substring ( key . length - 1 ) ;
919
- if ( "&" == last || "|" == last || "!" == last ) {
920
- key = key . substring ( 0 , key . length - 1 ) ;
921
- } else {
922
- last = null ; //避免key + StringUtil.getString(last)错误延长
921
+ if ( key . endsWith ( "&" ) ) {
922
+ logic = '符合全部' ;
923
923
}
924
+ else if ( key . endsWith ( "|" ) ) {
925
+ logic = '符合任意' ;
926
+ }
927
+ else if ( key . endsWith ( "!" ) ) {
928
+ logic = '都不符合' ;
929
+ }
930
+ else { }
924
931
//}
925
932
926
- if ( StringUtil . isName ( key ) == false ) {
927
- return ' ! 字符' + key + '不合法!' ;
933
+ if ( logic . length > 0 ) {
934
+ key = key . substring ( 0 , key . length - 1 ) ;
928
935
}
929
936
937
+ if ( StringUtil . isName ( key ) == false ) {
938
+ return ' ! 字符 ' + key + ' 不合法!' ;
939
+ }
930
940
931
-
941
+ //功能符 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
932
942
933
943
934
944
columnList = item [ 'Column[]' ] ;
@@ -945,7 +955,9 @@ var CodeUtil = {
945
955
continue ;
946
956
}
947
957
948
- var p = ( at . length <= 0 ? '' : at + ' > ' ) + ( prefix . length <= 0 ? '' : prefix + ' > ' ) ;
958
+ var p = ( at . length <= 0 ? '' : at + ' > ' )
959
+ + ( fun . length <= 0 ? '' : fun + ' > ' )
960
+ + ( logic . length <= 0 ? '' : logic + ' > ' ) ;
949
961
return ( p . length <= 0 ? '' : p + key + ': ' ) + column . COLUMN_COMMENT ;
950
962
}
951
963
0 commit comments