1414
1515package zuo .biao .apijson .server ;
1616
17- import static zuo .biao .apijson .JSONObject .KEY_ABOUT ;
1817import static zuo .biao .apijson .JSONObject .KEY_COLUMN ;
1918import static zuo .biao .apijson .JSONObject .KEY_COMBINE ;
2019import static zuo .biao .apijson .JSONObject .KEY_GROUP ;
@@ -86,7 +85,6 @@ public abstract class AbstractSQLConfig implements SQLConfig {
8685 private RequestRole role ; //发送请求的用户的角色
8786 private String schema ; //Table所在的数据库
8887 private String table ; //Table名
89- private boolean about ; //关于,返回数据库表的信息,包括表说明和字段说明
9088 private String group ; //分组方式的字符串数组,','分隔
9189 private String having ; //聚合函数的字符串数组,','分隔
9290 private String order ; //排序方式的字符串数组,','分隔
@@ -215,16 +213,6 @@ public AbstractSQLConfig setTable(String table) { //Table已经在Parser中校
215213 return this ;
216214 }
217215
218- @ Override
219- public boolean isAbout () {
220- return about ;
221- }
222- @ Override
223- public AbstractSQLConfig setAbout (boolean about ) {
224- this .about = about ;
225- return this ;
226- }
227-
228216 @ Override
229217 public String getGroup () {
230218 return group ;
@@ -1290,7 +1278,6 @@ public static AbstractSQLConfig newSQLConfig(RequestMethod method, String table,
12901278
12911279 String role = request .getString (KEY_ROLE );
12921280 String schema = request .getString (KEY_SCHEMA );
1293- boolean about = request .getBooleanValue (KEY_ABOUT );
12941281 String combine = request .getString (KEY_COMBINE );
12951282 String column = request .getString (KEY_COLUMN );
12961283 String group = request .getString (KEY_GROUP );
@@ -1303,7 +1290,6 @@ public static AbstractSQLConfig newSQLConfig(RequestMethod method, String table,
13031290 //关键词
13041291 request .remove (KEY_ROLE );
13051292 request .remove (KEY_SCHEMA );
1306- request .remove (KEY_ABOUT );
13071293 request .remove (KEY_COMBINE );
13081294 request .remove (KEY_COLUMN );
13091295 request .remove (KEY_GROUP );
@@ -1312,24 +1298,6 @@ public static AbstractSQLConfig newSQLConfig(RequestMethod method, String table,
13121298
13131299
13141300 Map <String , Object > tableWhere = new LinkedHashMap <String , Object >();//保证顺序好优化 WHERE id > 1 AND name LIKE...
1315- if (about ) { //查询字段属性
1316- if (RequestMethod .isQueryMethod (method ) == false ) {
1317- throw new UnsupportedOperationException (config .getTable ()
1318- + " 被 " + KEY_ABOUT + " 标注,只能进行 GET,HEAD 等查询操作!" );
1319- }
1320-
1321- tableWhere .put (TABLE_SCHEMA , schema );
1322- tableWhere .put (TABLE_NAME , config .getSQLTable ());
1323- config .setTable (Column .class .getSimpleName ());
1324-
1325- schema = SCHEMA_INFORMATION ;
1326-
1327- column = StringUtil .getString (column );
1328- if (column .isEmpty () && RequestMethod .isHeadMethod (method , true ) == false ) {
1329- column = "column_name,column_type,is_nullable,column_default,column_comment" ;
1330- }
1331- }
1332-
13331301
13341302 //已经remove了id和id{},以及@key
13351303 Set <String > set = request .keySet (); //前面已经判断request是否为空
@@ -1478,9 +1446,7 @@ else if (whereList != null && whereList.contains(key)) {
14781446 //在 tableWhere 第0个 config.setIdIn(idIn);
14791447
14801448 config .setRole (role );
1481- //TODO condition组合,优先 | config.setCondition(where);
14821449 config .setSchema (schema );
1483- config .setAbout (about );
14841450 config .setColumn (column );
14851451 config .setGroup (group );
14861452 config .setHaving (having );
@@ -1493,7 +1459,6 @@ else if (whereList != null && whereList.contains(key)) {
14931459 //关键词
14941460 request .put (KEY_ROLE , role );
14951461 request .put (KEY_SCHEMA , schema );
1496- request .put (KEY_ABOUT , about );
14971462 request .put (KEY_COMBINE , combine );
14981463 request .put (KEY_COLUMN , column );
14991464 request .put (KEY_GROUP , group );
0 commit comments