Есть
Код: Выделить всё
Spring-MVCКод: Выделить всё
ResponseEntityКод: Выделить всё
200Код: Выделить всё
OKКод: Выделить всё
CREATEDКод: Выделить всё
201Код: Выделить всё
URLКод: Выделить всё
CREATEDNow I have such an implementation:
Код: Выделить всё
@PostMapping("/create/dish")
ResponseEntity createDish(@Valid @RequestBody DishDTO dishDTO) {
return ResponseEntity.ok(cookService.createDish(dishDTO.getDishName(), dishDTO.getAboutDish(), dishDTO.getDishType(),
dishDTO.getCookingTime(), dishDTO.getWeight(),
dishDTO.getDishCost(), dishDTO.getCooksId()));
}
Код: Выделить всё
@PostMapping("/create/dish")
ResponseEntity createDish(@Valid @RequestBody DishDTO dishDTO) {
return ResponseEntity.created(cookService.createDish(dishDTO.getDishName(), dishDTO.getAboutDish(), dishDTO.getDishType(),
dishDTO.getCookingTime(), dishDTO.getWeight(),
dishDTO.getDishCost(), dishDTO.getCooksId()));
}

P.S. I don’t have a frontend at all. All through Swagger or PostMan.
Источник: https://stackoverflow.com/questions/623 ... onseentity
Мобильная версия