mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 17:43:55 +08:00
fix:修复记忆模型配置保存字段未删除问题
This commit is contained in:
+14
@@ -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);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user