fix:修复记忆模型配置保存字段未删除问题

This commit is contained in:
DaGou12138
2026-04-28 15:23:57 +08:00
parent 26aca54f4b
commit a67d938523
@@ -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);
}
}
}
/**