@Override
@PreAuthorize("hasAuthority('admin')")
public ResponseEntity<Object> globalsettingsHolidaysYearPost( @Min(2000) @Max(2100)@ApiParam(value = "",required=true ) @PathVariable("year") Integer year,
@ApiParam(value = "The holidays to set" ,required=true ) @Valid @RequestBody Holidays holidays) throws ApiException {
try {
globalsettingsService.setHolidays(year, holidays);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} catch (OptimisticLockException ex) {
try {
Holidays lastHolidays = globalsettingsService.getHolidays(year);
throw new ConcurrentModificationException(409, "Concurrent modification error.", lastHolidays);
} catch (ApiException ex1) {
Logger.getLogger(SettingsApiController.class.getName()).log(Level.SEVERE, null, ex1);
throw new ApiException(500, "Concurrent modification exception: internal error");
}
}
}
GlobalsettingsApiController.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:yum
作者:
评论列表
文章目录