提交 e45c7bc3 编写于 作者: L lepdou

update

上级 a91fce64
......@@ -4,22 +4,12 @@ import com.ctrip.framework.apollo.common.dto.BaseDTO;
public class OpenItemDTO extends BaseDTO {
private long id;
private String key;
private String value;
private String comment;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getKey() {
return key;
}
......
......@@ -70,7 +70,7 @@ public class ItemController {
!StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeLastModifiedBy()),
"key,value,dataChangeLastModifiedBy 字段不能为空");
RequestPrecondition.checkArguments(item.getKey().equals(key), "item payload can not be empty");
RequestPrecondition.checkArguments(item.getKey().equals(key), "path中的key和payload中的key不一致");
if (userService.findByUserId(item.getDataChangeLastModifiedBy()) == null) {
throw new BadRequestException("用户不存在");
......@@ -100,12 +100,12 @@ public class ItemController {
throw new BadRequestException("用户不存在");
}
ItemDTO toDeletedItem = itemService.loadItem(Env.valueOf(env), appId, clusterName, namespaceName, key);
if (toDeletedItem == null){
ItemDTO toDeleteItem = itemService.loadItem(Env.valueOf(env), appId, clusterName, namespaceName, key);
if (toDeleteItem == null){
throw new BadRequestException("item不存在");
}
itemService.deleteItem(Env.fromString(env), toDeletedItem.getId(), operator);
itemService.deleteItem(Env.fromString(env), toDeleteItem.getId(), operator);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册