Есть
Код: Выделить всё
Spring-MVC
Код: Выделить всё
ResponseEntity
Код: Выделить всё
200
Код: Выделить всё
OK
Код: Выделить всё
CREATED
Код: Выделить всё
201
Код: Выделить всё
URL
Код: Выделить всё
CREATED
Now 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