mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-24 04:19:48 +01:00
fix:修复记忆模型配置保存字段未删除问题
This commit is contained in:
parent
26aca54f4b
commit
a67d938523
1 changed files with 14 additions and 0 deletions
|
|
@ -371,6 +371,13 @@ public class ModelConfigServiceImpl extends BaseServiceImpl<ModelConfigDao, Mode
|
|||
}
|
||||
}
|
||||
|
||||
// 删除在新JSON中不存在的非敏感字段
|
||||
for (String oldKey : originalJson.keySet().toArray(new String[0])) {
|
||||
if (!modelConfigBodyDTO.getConfigJson().containsKey(oldKey) && !SensitiveDataUtils.isSensitiveField(oldKey)) {
|
||||
updatedJson.remove(oldKey);
|
||||
}
|
||||
}
|
||||
|
||||
modelConfigEntity.setConfigJson(updatedJson);
|
||||
}
|
||||
|
||||
|
|
@ -403,6 +410,13 @@ public class ModelConfigServiceImpl extends BaseServiceImpl<ModelConfigDao, Mode
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 删除在新JSON中不存在的非敏感子字段
|
||||
for (String oldChildKey : originalChild.keySet().toArray(new String[0])) {
|
||||
if (!updated.containsKey(oldChildKey) && !SensitiveDataUtils.isSensitiveField(oldChildKey)) {
|
||||
originalChild.remove(oldChildKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue