mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
Merge branch 'Production1' into dev
This commit is contained in:
commit
bd82db01fc
1 changed files with 10 additions and 0 deletions
|
|
@ -404,6 +404,15 @@ public class AgentServiceImpl extends BaseServiceImpl<AgentDao, AgentEntity> imp
|
||||||
// 播放音乐、播放故事、查天气、查新闻
|
// 播放音乐、播放故事、查天气、查新闻
|
||||||
String[] pluginIds = new String[] { "SYSTEM_PLUGIN_MUSIC", "SYSTEM_PLUGIN_STORY",
|
String[] pluginIds = new String[] { "SYSTEM_PLUGIN_MUSIC", "SYSTEM_PLUGIN_STORY",
|
||||||
"SYSTEM_PLUGIN_WEATHER", "SYSTEM_PLUGIN_NEWS_NEWSNOW" };
|
"SYSTEM_PLUGIN_WEATHER", "SYSTEM_PLUGIN_NEWS_NEWSNOW" };
|
||||||
|
|
||||||
|
// 检查已存在的插件映射
|
||||||
|
List<AgentPluginMapping> existingMappings = agentPluginMappingService.list(
|
||||||
|
new QueryWrapper<AgentPluginMapping>().eq("agent_id", entity.getId())
|
||||||
|
);
|
||||||
|
List<String> existingPluginIds = existingMappings.stream()
|
||||||
|
.map(AgentPluginMapping::getPluginId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
for (String pluginId : pluginIds) {
|
for (String pluginId : pluginIds) {
|
||||||
// 跳过已存在的插件映射
|
// 跳过已存在的插件映射
|
||||||
if (existingPluginIds.contains(pluginId)) {
|
if (existingPluginIds.contains(pluginId)) {
|
||||||
|
|
@ -428,6 +437,7 @@ public class AgentServiceImpl extends BaseServiceImpl<AgentDao, AgentEntity> imp
|
||||||
mapping.setAgentId(entity.getId());
|
mapping.setAgentId(entity.getId());
|
||||||
toInsert.add(mapping);
|
toInsert.add(mapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 只有当有新插件需要插入时才保存
|
// 只有当有新插件需要插入时才保存
|
||||||
if (!toInsert.isEmpty()) {
|
if (!toInsert.isEmpty()) {
|
||||||
agentPluginMappingService.saveBatch(toInsert);
|
agentPluginMappingService.saveBatch(toInsert);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue