Commit e45c7bc3 by lepdou

update

parent a91fce64
...@@ -4,22 +4,12 @@ import com.ctrip.framework.apollo.common.dto.BaseDTO; ...@@ -4,22 +4,12 @@ import com.ctrip.framework.apollo.common.dto.BaseDTO;
public class OpenItemDTO extends BaseDTO { public class OpenItemDTO extends BaseDTO {
private long id;
private String key; private String key;
private String value; private String value;
private String comment; private String comment;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getKey() { public String getKey() {
return key; return key;
} }
......
...@@ -70,7 +70,7 @@ public class ItemController { ...@@ -70,7 +70,7 @@ public class ItemController {
!StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeLastModifiedBy()), !StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeLastModifiedBy()),
"key,value,dataChangeLastModifiedBy 字段不能为空"); "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) { if (userService.findByUserId(item.getDataChangeLastModifiedBy()) == null) {
throw new BadRequestException("用户不存在"); throw new BadRequestException("用户不存在");
...@@ -100,12 +100,12 @@ public class ItemController { ...@@ -100,12 +100,12 @@ public class ItemController {
throw new BadRequestException("用户不存在"); throw new BadRequestException("用户不存在");
} }
ItemDTO toDeletedItem = itemService.loadItem(Env.valueOf(env), appId, clusterName, namespaceName, key); ItemDTO toDeleteItem = itemService.loadItem(Env.valueOf(env), appId, clusterName, namespaceName, key);
if (toDeletedItem == null){ if (toDeleteItem == null){
throw new BadRequestException("item不存在"); throw new BadRequestException("item不存在");
} }
itemService.deleteItem(Env.fromString(env), toDeletedItem.getId(), operator); itemService.deleteItem(Env.fromString(env), toDeleteItem.getId(), operator);
} }
} }
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