diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java index 94744e2b10f78e3594ada0f30680986da03262b2..5dff756c393928a7765d07a397d8b6d202bd7a2b 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java @@ -68,17 +68,17 @@ public class ItemController { RequestPrecondition.checkArguments( !StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeLastModifiedBy()), - "key,value,dataChangeLastModifiedBy 字段不能为空"); + "key,value,dataChangeLastModifiedBy can not be empty"); - RequestPrecondition.checkArguments(item.getKey().equals(key), "path中的key和payload中的key不一致"); + RequestPrecondition.checkArguments(item.getKey().equals(key), "Key in path and payload is not consistent"); if (userService.findByUserId(item.getDataChangeLastModifiedBy()) == null) { - throw new BadRequestException("用户不存在"); + throw new BadRequestException("user(dataChangeLastModifiedBy) not exists"); } ItemDTO toUpdateItem = itemService.loadItem(Env.fromString(env), appId, clusterName, namespaceName, item.getKey()); if (toUpdateItem == null) { - throw new BadRequestException("item不存在"); + throw new BadRequestException("item not exists"); } //protect. only value,comment,lastModifiedBy can be modified toUpdateItem.setComment(item.getComment()); @@ -97,12 +97,12 @@ public class ItemController { HttpServletRequest request) { if (userService.findByUserId(operator) == null) { - throw new BadRequestException("用户不存在"); + throw new BadRequestException("user(operator) not exists"); } ItemDTO toDeleteItem = itemService.loadItem(Env.valueOf(env), appId, clusterName, namespaceName, key); if (toDeleteItem == null){ - throw new BadRequestException("item不存在"); + throw new BadRequestException("item not exists"); } itemService.deleteItem(Env.fromString(env), toDeleteItem.getId(), operator); diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java index 867be0ac5eb1167f3ff370a1456666dc76fbc2a7..63e0daf494a7d02de673acd62371f9083324ebd1 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java @@ -47,7 +47,7 @@ public class ReleaseController { "releaseTitle and releaseBy can not be empty"); if (userService.findByUserId(model.getReleasedBy()) == null) { - throw new BadRequestException("用户不存在."); + throw new BadRequestException("user(releaseBy) not exists"); } model.setAppId(appId);