feat(taikai2312): 增加额外条件处理功能并优化项目设置

- 在 QuerySync 类中添加处理额外条件的功能,允许在查询时传入额外的筛选条件
- 在项目设置中添加 filteredResources 配置,用于过滤掉不必要的文件和目录
This commit is contained in:
张明 2025-05-12 17:21:07 +08:00
parent ea3280c553
commit e1b8802660
1 changed files with 14 additions and 0 deletions

View File

@ -39,7 +39,20 @@ public class QuerySync extends AbstractNCCRestResource {
Map<String, Object> data = apiUfinterface.getData().getParamdata();
JSONObject pageInfo = (JSONObject) JSONObject.toJSON(apiUfinterface.getPageInfo());
data.remove("type"); // 移除类型参数因为它仅用于路由,向下传递会影响查询
// 获取额外条件
String extraCondition = null;
if (data.containsKey("extraCondition")) {
extraCondition = (String) data.get("extraCondition");
data.remove("extraCondition"); // 移除额外条件参数防止影响查询
}
String condition = QuerySyncSqlUtils.buildUniversalCondition(data);
// 如果存在额外条件拼接到条件后面
if (extraCondition != null && !extraCondition.isEmpty()) {
condition = condition + " AND " + extraCondition;
}
String countSql = "SELECT " + pkColumnName + " FROM " + viewName + " WHERE " + condition;
@SuppressWarnings("unchecked")
@ -63,6 +76,7 @@ public class QuerySync extends AbstractNCCRestResource {
return ResultMessageUtil.toJSONByPage(rows, openApiPageInfo, false);
}
@POST
@Path("query")
@Consumes({"application/json"})