提交 7581a23e authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 1e6cc6d0
......@@ -57,19 +57,13 @@ public class PublishingController {
}
publishing.setCreateTime(new Date());
publishing.setId(UUIDUtil.getUUID());
if (!service.insert(publishing)) {
throw new BaseException(ResponseCodeEnum.FAIL);
}
return CallBack.success();
}
@ApiOperation(value = "重复资源验证" , notes ="重复资源验证")
@GetMapping(value = ResourceRequestPath.REPEST+ResourceRequestPath.NAME)
public CallBack<?> selectByName(@PathVariable String name){
service.createCriteria().andEqualTo("name", name);
Publishing publishing = service.selectOneByCriteria();
publishing=service.queryByName(publishing.getName(),null);
if(publishing!=null){
throw new BaseException(ResponseCodeEnum.REPEST);
}
if (!service.insert(publishing)) {
throw new BaseException(ResponseCodeEnum.FAIL);
}
return CallBack.success();
}
@ApiOperation(value = "批量删除", notes = "批量删除")
......@@ -90,11 +84,11 @@ public class PublishingController {
@PostMapping(value = ResourceRequestPath.UPDATE)
public CallBack<Boolean> update(@RequestBody PublishingForm form) {
Publishing publishing = new Publishing();
try {
BeanUtils.copyProperties(form, publishing);
} catch (Exception e) {
e.printStackTrace();
throw new BaseException(7, "复制对象时创建对象失败。");
BeanUtils.copyProperties(form, publishing);
publishing=service.queryByName(publishing.getName(),publishing.getId());
if(publishing!=null){
throw new BaseException(ResponseCodeEnum.REPEST);
}
if (!service.updateByPrimaryKeySelective(publishing)) {
throw new BaseException(ResponseCodeEnum.FAIL);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论