diff --git a/src/main/java/com/feelmycode/parabole/controller/OrderController.java b/src/main/java/com/feelmycode/parabole/controller/OrderController.java index 9d3c763f..f5d83dc6 100644 --- a/src/main/java/com/feelmycode/parabole/controller/OrderController.java +++ b/src/main/java/com/feelmycode/parabole/controller/OrderController.java @@ -10,8 +10,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -26,7 +26,7 @@ public class OrderController { private final OrderService orderService; private final UserService userService; - @GetMapping + @PostMapping public ResponseEntity createOrder(@RequestParam Long userId) { log.info("Create Order. userId: {}", userId); orderService.createOrder(new Order(userService.getUser(userId), DELIVERY_FEE)); @@ -47,7 +47,7 @@ public ResponseEntity orderCancel(@RequestParam Long userId, log.info("Delete Order. userId: {}, orderId: {}", userId, orderId); try { orderService.deleteOrder(userId, orderId); - } catch(Exception e) { + } catch (Exception e) { throw new ParaboleException(HttpStatus.BAD_REQUEST, "주문을 취소할 수 없습니다."); } return ParaboleResponse.CommonResponse(HttpStatus.OK, true, "주문을 취소했습니다.");