(fix)(headless)Empty filters should not give prompt info.
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled

This commit is contained in:
supersonicbi
2025-06-06 21:07:17 +08:00
parent 2552e2ae4b
commit df70a3cf15
3 changed files with 13 additions and 9 deletions

View File

@@ -46,8 +46,8 @@ public class DataInterpretProcessor implements ExecuteResultProcessor {
public boolean accept(ExecuteContext executeContext) {
Agent agent = executeContext.getAgent();
ChatApp chatApp = agent.getChatAppConfig().get(APP_KEY);
return Objects.nonNull(chatApp) && chatApp.isEnable()&&
StringUtils.isNotBlank(executeContext.getResponse().getTextResult()); // 如果都没结果,则无法处理,直接跳过
return Objects.nonNull(chatApp) && chatApp.isEnable()
&& StringUtils.isNotBlank(executeContext.getResponse().getTextResult()); // 如果都没结果,则无法处理,直接跳过
}
@Override

View File

@@ -179,7 +179,7 @@ public class NatureHelper {
}
public static Long parseIdFromNature(String nature, int index) {
if(nature.startsWith("_")){ // 框架的字典都是以_开头的
if (nature.startsWith("_")) { // 框架的字典都是以_开头的
try {
String[] split = nature.split(DictWordType.NATURE_SPILT);
if (split.length > index) {

View File

@@ -335,13 +335,17 @@ public class S2DataPermissionAspect {
if (StringUtils.isNotEmpty(filter.getDescription())) {
descList.add(filter.getDescription());
}
exprList.add(filter.getExpressions().toString());
if (!"[]".equals(filter.getExpressions().toString())) {
exprList.add(filter.getExpressions().toString());
}
});
String promptInfo = "当前结果已经过行权限过滤,详细过滤条件如下:%s, 申请权限请联系管理员%s";
String message = String.format(promptInfo,
CollectionUtils.isEmpty(descList) ? exprList : descList, admins);
queryResultWithColumns.setQueryAuthorization(
new QueryAuthorization(modelResp.getName(), exprList, descList, message));
if (!CollectionUtils.isEmpty(exprList)) {
String promptInfo = "当前结果已经过行权限过滤,详细过滤条件如下:%s, 申请权限请联系管理员%s";
String message = String.format(promptInfo,
CollectionUtils.isEmpty(descList) ? exprList : descList, admins);
queryResultWithColumns.setQueryAuthorization(
new QueryAuthorization(modelResp.getName(), exprList, descList, message));
}
}
}
}