|
@@ -76,7 +76,7 @@ public class PosterController {
|
|
|
return APIResult.ok(result);
|
|
|
}catch(Exception e){
|
|
|
log.info("poster create error: message={}",e.getMessage());
|
|
|
- return APIResult.error(APICode.OPERATE_ERROR);
|
|
|
+ return APIResult.error(APICode.ALREADY_EXISTS);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -89,13 +89,18 @@ public class PosterController {
|
|
|
return APIResult.error(APICode.error("参数错误: id不能为空"));
|
|
|
}
|
|
|
|
|
|
- Poster result = posterService.update(posterDTO);
|
|
|
- if (null == result) {
|
|
|
- return APIResult.error(APICode.OPERATE_ERROR);
|
|
|
- }
|
|
|
+ try{
|
|
|
+ Poster result = posterService.update(posterDTO);
|
|
|
+ if (null == result) {
|
|
|
+ return APIResult.error(APICode.OPERATE_ERROR);
|
|
|
+ }
|
|
|
|
|
|
- setProductInfo(result);
|
|
|
- return APIResult.ok(result);
|
|
|
+ setProductInfo(result);
|
|
|
+ return APIResult.ok(result);
|
|
|
+ }catch(Exception e){
|
|
|
+ log.info("poster update error: message={}",e.getMessage());
|
|
|
+ return APIResult.error(APICode.ALREADY_EXISTS);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
|