feat: 优化
This commit is contained in:
@@ -669,7 +669,18 @@ public class DifyServiceImpl implements DifyService {
|
||||
// Dify 用户标识
|
||||
String difyUserId = "user-" + userId;
|
||||
|
||||
return difyClient.getConversations(config.getApiKey(), difyUserId, lastId, limit);
|
||||
DifyConversationListRespVO result = difyClient.getConversations(config.getApiKey(), difyUserId, lastId, limit);
|
||||
|
||||
// 过滤掉 inputs 中的敏感字段(如 sysPrompt)
|
||||
if (result != null && result.getData() != null) {
|
||||
result.getData().forEach(conv -> {
|
||||
if (conv.getInputs() != null) {
|
||||
conv.getInputs().remove("sysPrompt");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -688,7 +699,18 @@ public class DifyServiceImpl implements DifyService {
|
||||
// Dify 用户标识
|
||||
String difyUserId = "user-" + userId;
|
||||
|
||||
return difyClient.getMessages(config.getApiKey(), conversationId, difyUserId, firstId, limit);
|
||||
DifyMessageListRespVO result = difyClient.getMessages(config.getApiKey(), conversationId, difyUserId, firstId, limit);
|
||||
|
||||
// 过滤掉 inputs 中的敏感字段(如 sysPrompt)
|
||||
if (result != null && result.getData() != null) {
|
||||
result.getData().forEach(msg -> {
|
||||
if (msg.getInputs() != null) {
|
||||
msg.getInputs().remove("sysPrompt");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.tik.muye.aiusagestats.service;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
|
||||
import cn.iocoder.yudao.module.tik.muye.aiusagestats.vo.*;
|
||||
import cn.iocoder.yudao.module.tik.muye.aiserviceconfig.dal.AiServiceConfigDO;
|
||||
import cn.iocoder.yudao.module.tik.muye.aiserviceconfig.mapper.AiServiceConfigMapper;
|
||||
|
||||
Reference in New Issue
Block a user