@PreAuthorize("hasAuthority('ADMIN')") @RequestMapping(value = "", method = RequestMethod.POST) @ApiOperation( value = "Create new LunchMenu.", notes = "Returns a new LunchMenu and persisted it to DB.", response = LunchMenu.class) @ApiResponses( value = { @ApiResponse(code = 401, message = "Only authenticated access allowed."), @ApiResponse(code = 403, message = "Only user of ADMIN role can have access to it."), @ApiResponse( code = 400, message = "Reasons:\n1:Properties 'theDay' and 'theRestaurantId' must have value.\n" + "2:lunchMenuAsDto.idLunchMenu set to other value than 0.\n" + "3:Other combination of lunchMenuAsDto.theDay and lunchMenuAsDto.theRestaurantId already exists.") }) public LunchMenu createLunchMenu( @ApiParam(value = "new properties of LunchMenu", required = true) @Valid @RequestBody LunchMenuDto lunchMenuAsDto) { LOGGER.debug("Create new LunchMenu {}", lunchMenuAsDto); checkIdLunchMenuEmpty(lunchMenuAsDto); LunchMenu restaurant = lunchMenusService.createLunchMenu(lunchMenuAsDto); return restaurant; }