Commit 2883f493 authored by lepdou's avatar lepdou

bugfix private xml namespace cant modify

parent 6287a046
...@@ -51,7 +51,6 @@ public class ConfigController { ...@@ -51,7 +51,6 @@ public class ConfigController {
model.setEnv(env); model.setEnv(env);
model.setNamespaceName(namespaceName); model.setNamespaceName(namespaceName);
configService.updateConfigItemByText(model); configService.updateConfigItemByText(model);
} }
......
...@@ -21,19 +21,20 @@ public class FileTextResolver implements ConfigTextResolver { ...@@ -21,19 +21,20 @@ public class FileTextResolver implements ConfigTextResolver {
return changeSets; return changeSets;
} }
if (CollectionUtils.isEmpty(baseItems)) { if (CollectionUtils.isEmpty(baseItems)) {
changeSets.addCreateItem(createItem(namespaceId, configText)); changeSets.addCreateItem(createItem(namespaceId, 0, configText));
} else { } else {
ItemDTO beforeItem = baseItems.get(0); ItemDTO beforeItem = baseItems.get(0);
if (!configText.equals(beforeItem.getValue())) {//update if (!configText.equals(beforeItem.getValue())) {//update
changeSets.addUpdateItem(createItem(namespaceId, configText)); changeSets.addUpdateItem(createItem(namespaceId, beforeItem.getId(), configText));
} }
} }
return changeSets; return changeSets;
} }
private ItemDTO createItem(long namespaceId, String value) { private ItemDTO createItem(long namespaceId, long itemId, String value) {
ItemDTO item = new ItemDTO(); ItemDTO item = new ItemDTO();
item.setId(itemId);
item.setNamespaceId(namespaceId); item.setNamespaceId(namespaceId);
item.setValue(value); item.setValue(value);
item.setKey(ConfigConsts.CONFIG_FILE_CONTENT_KEY); item.setKey(ConfigConsts.CONFIG_FILE_CONTENT_KEY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment