Skip to content

Commit 8acf075

Browse files
k8scatnobodyiam
authored andcommitted
optimize: pre check dataChangeCreatedBy in updateItem
1 parent 34a2c11 commit 8acf075

File tree

1 file changed

+3
-0
lines changed
  • apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller

1 file changed

+3
-0
lines changed

apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ public void updateItem(@PathVariable String appId, @PathVariable String env,
123123
}
124124

125125
if (createIfNotExists) {
126+
if (StringUtils.isEmpty(item.getDataChangeCreatedBy())) {
127+
throw new BadRequestException("dataChangeCreatedBy is required when createIfNotExists is true");
128+
}
126129
this.itemOpenApiService.createOrUpdateItem(appId, env, clusterName, namespaceName, item);
127130
} else {
128131
this.itemOpenApiService.updateItem(appId, env, clusterName, namespaceName, item);

0 commit comments

Comments
 (0)