mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
(fix)(headless)Empty filters should not give prompt info.
This commit is contained in:
@@ -46,8 +46,8 @@ public class DataInterpretProcessor implements ExecuteResultProcessor {
|
|||||||
public boolean accept(ExecuteContext executeContext) {
|
public boolean accept(ExecuteContext executeContext) {
|
||||||
Agent agent = executeContext.getAgent();
|
Agent agent = executeContext.getAgent();
|
||||||
ChatApp chatApp = agent.getChatAppConfig().get(APP_KEY);
|
ChatApp chatApp = agent.getChatAppConfig().get(APP_KEY);
|
||||||
return Objects.nonNull(chatApp) && chatApp.isEnable()&&
|
return Objects.nonNull(chatApp) && chatApp.isEnable()
|
||||||
StringUtils.isNotBlank(executeContext.getResponse().getTextResult()); // 如果都没结果,则无法处理,直接跳过
|
&& StringUtils.isNotBlank(executeContext.getResponse().getTextResult()); // 如果都没结果,则无法处理,直接跳过
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ public class NatureHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Long parseIdFromNature(String nature, int index) {
|
public static Long parseIdFromNature(String nature, int index) {
|
||||||
if(nature.startsWith("_")){ // 框架的字典都是以_开头的
|
if (nature.startsWith("_")) { // 框架的字典都是以_开头的
|
||||||
try {
|
try {
|
||||||
String[] split = nature.split(DictWordType.NATURE_SPILT);
|
String[] split = nature.split(DictWordType.NATURE_SPILT);
|
||||||
if (split.length > index) {
|
if (split.length > index) {
|
||||||
|
|||||||
@@ -335,13 +335,17 @@ public class S2DataPermissionAspect {
|
|||||||
if (StringUtils.isNotEmpty(filter.getDescription())) {
|
if (StringUtils.isNotEmpty(filter.getDescription())) {
|
||||||
descList.add(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";
|
if (!CollectionUtils.isEmpty(exprList)) {
|
||||||
String message = String.format(promptInfo,
|
String promptInfo = "当前结果已经过行权限过滤,详细过滤条件如下:%s, 申请权限请联系管理员%s";
|
||||||
CollectionUtils.isEmpty(descList) ? exprList : descList, admins);
|
String message = String.format(promptInfo,
|
||||||
queryResultWithColumns.setQueryAuthorization(
|
CollectionUtils.isEmpty(descList) ? exprList : descList, admins);
|
||||||
new QueryAuthorization(modelResp.getName(), exprList, descList, message));
|
queryResultWithColumns.setQueryAuthorization(
|
||||||
|
new QueryAuthorization(modelResp.getName(), exprList, descList, message));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user