Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 authored and nobodyiam committed Jan 13, 2019
1 parent d927552 commit b76adf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public OpenItemDTO createItem(String appId, String env, String clusterName, Stri
checkNotEmpty(appId, "App id");
checkNotEmpty(env, "Env");
checkNotEmpty(itemDTO.getKey(), "Item key");
checkNotEmpty(itemDTO.getValue(), "Item value");
checkNotEmpty(itemDTO.getDataChangeCreatedBy(), "Item created by");

String path = String.format("envs/%s/apps/%s/clusters/%s/namespaces/%s/items",
Expand All @@ -80,7 +79,6 @@ public void updateItem(String appId, String env, String clusterName, String name
checkNotEmpty(appId, "App id");
checkNotEmpty(env, "Env");
checkNotEmpty(itemDTO.getKey(), "Item key");
checkNotEmpty(itemDTO.getValue(), "Item value");
checkNotEmpty(itemDTO.getDataChangeLastModifiedBy(), "Item modified by");

String path = String.format("envs/%s/apps/%s/clusters/%s/namespaces/%s/items/%s",
Expand All @@ -106,7 +104,6 @@ public void createOrUpdateItem(String appId, String env, String clusterName, Str
checkNotEmpty(appId, "App id");
checkNotEmpty(env, "Env");
checkNotEmpty(itemDTO.getKey(), "Item key");
checkNotEmpty(itemDTO.getValue(), "Item value");
checkNotEmpty(itemDTO.getDataChangeCreatedBy(), "Item created by");

if (Strings.isNullOrEmpty(itemDTO.getDataChangeLastModifiedBy())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public OpenItemDTO createItem(@PathVariable String appId, @PathVariable String e
@RequestBody OpenItemDTO item, HttpServletRequest request) {

RequestPrecondition.checkArguments(
!StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeCreatedBy()),
"key, value and dataChangeCreatedBy should not be null or empty");
!StringUtils.isContainEmpty(item.getKey(), item.getDataChangeCreatedBy()),
"key and dataChangeCreatedBy should not be null or empty");

if (userService.findByUserId(item.getDataChangeCreatedBy()) == null) {
throw new BadRequestException("User " + item.getDataChangeCreatedBy() + " doesn't exist!");
Expand Down Expand Up @@ -84,8 +84,8 @@ public void updateItem(@PathVariable String appId, @PathVariable String env,
RequestPrecondition.checkArguments(item != null, "item payload can not be empty");

RequestPrecondition.checkArguments(
!StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeLastModifiedBy()),
"key, value and dataChangeLastModifiedBy can not be empty");
!StringUtils.isContainEmpty(item.getKey(), item.getDataChangeLastModifiedBy()),
"key and dataChangeLastModifiedBy can not be empty");

RequestPrecondition.checkArguments(item.getKey().equals(key), "Key in path and payload is not consistent");

Expand Down

0 comments on commit b76adf9

Please sign in to comment.