Commit b76adf9c authored by kezhenxu94's avatar kezhenxu94 Committed by Jason Song

fixes #1841 (#1852)

parent d9275527
...@@ -54,7 +54,6 @@ public class ItemOpenApiService extends AbstractOpenApiService { ...@@ -54,7 +54,6 @@ public class ItemOpenApiService extends AbstractOpenApiService {
checkNotEmpty(appId, "App id"); checkNotEmpty(appId, "App id");
checkNotEmpty(env, "Env"); checkNotEmpty(env, "Env");
checkNotEmpty(itemDTO.getKey(), "Item key"); checkNotEmpty(itemDTO.getKey(), "Item key");
checkNotEmpty(itemDTO.getValue(), "Item value");
checkNotEmpty(itemDTO.getDataChangeCreatedBy(), "Item created by"); checkNotEmpty(itemDTO.getDataChangeCreatedBy(), "Item created by");
String path = String.format("envs/%s/apps/%s/clusters/%s/namespaces/%s/items", String path = String.format("envs/%s/apps/%s/clusters/%s/namespaces/%s/items",
...@@ -80,7 +79,6 @@ public class ItemOpenApiService extends AbstractOpenApiService { ...@@ -80,7 +79,6 @@ public class ItemOpenApiService extends AbstractOpenApiService {
checkNotEmpty(appId, "App id"); checkNotEmpty(appId, "App id");
checkNotEmpty(env, "Env"); checkNotEmpty(env, "Env");
checkNotEmpty(itemDTO.getKey(), "Item key"); checkNotEmpty(itemDTO.getKey(), "Item key");
checkNotEmpty(itemDTO.getValue(), "Item value");
checkNotEmpty(itemDTO.getDataChangeLastModifiedBy(), "Item modified by"); checkNotEmpty(itemDTO.getDataChangeLastModifiedBy(), "Item modified by");
String path = String.format("envs/%s/apps/%s/clusters/%s/namespaces/%s/items/%s", String path = String.format("envs/%s/apps/%s/clusters/%s/namespaces/%s/items/%s",
...@@ -106,7 +104,6 @@ public class ItemOpenApiService extends AbstractOpenApiService { ...@@ -106,7 +104,6 @@ public class ItemOpenApiService extends AbstractOpenApiService {
checkNotEmpty(appId, "App id"); checkNotEmpty(appId, "App id");
checkNotEmpty(env, "Env"); checkNotEmpty(env, "Env");
checkNotEmpty(itemDTO.getKey(), "Item key"); checkNotEmpty(itemDTO.getKey(), "Item key");
checkNotEmpty(itemDTO.getValue(), "Item value");
checkNotEmpty(itemDTO.getDataChangeCreatedBy(), "Item created by"); checkNotEmpty(itemDTO.getDataChangeCreatedBy(), "Item created by");
if (Strings.isNullOrEmpty(itemDTO.getDataChangeLastModifiedBy())) { if (Strings.isNullOrEmpty(itemDTO.getDataChangeLastModifiedBy())) {
......
...@@ -53,8 +53,8 @@ public class ItemController { ...@@ -53,8 +53,8 @@ public class ItemController {
@RequestBody OpenItemDTO item, HttpServletRequest request) { @RequestBody OpenItemDTO item, HttpServletRequest request) {
RequestPrecondition.checkArguments( RequestPrecondition.checkArguments(
!StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeCreatedBy()), !StringUtils.isContainEmpty(item.getKey(), item.getDataChangeCreatedBy()),
"key, value and dataChangeCreatedBy should not be null or empty"); "key and dataChangeCreatedBy should not be null or empty");
if (userService.findByUserId(item.getDataChangeCreatedBy()) == null) { if (userService.findByUserId(item.getDataChangeCreatedBy()) == null) {
throw new BadRequestException("User " + item.getDataChangeCreatedBy() + " doesn't exist!"); throw new BadRequestException("User " + item.getDataChangeCreatedBy() + " doesn't exist!");
...@@ -84,8 +84,8 @@ public class ItemController { ...@@ -84,8 +84,8 @@ public class ItemController {
RequestPrecondition.checkArguments(item != null, "item payload can not be empty"); RequestPrecondition.checkArguments(item != null, "item payload can not be empty");
RequestPrecondition.checkArguments( RequestPrecondition.checkArguments(
!StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeLastModifiedBy()), !StringUtils.isContainEmpty(item.getKey(), item.getDataChangeLastModifiedBy()),
"key, value and dataChangeLastModifiedBy can not be empty"); "key and dataChangeLastModifiedBy can not be empty");
RequestPrecondition.checkArguments(item.getKey().equals(key), "Key in path and payload is not consistent"); RequestPrecondition.checkArguments(item.getKey().equals(key), "Key in path and payload is not consistent");
......
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