Skip to content

Commit

Permalink
Fix: Change Create Order annotation GET to POST [#1]
Browse files Browse the repository at this point in the history
  • Loading branch information
chd830 committed Oct 11, 2022
1 parent 193684f commit 08b4db2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -26,7 +26,7 @@ public class OrderController {
private final OrderService orderService;
private final UserService userService;

@GetMapping
@PostMapping
public ResponseEntity<ParaboleResponse> createOrder(@RequestParam Long userId) {
log.info("Create Order. userId: {}", userId);
orderService.createOrder(new Order(userService.getUser(userId), DELIVERY_FEE));
Expand All @@ -47,7 +47,7 @@ public ResponseEntity<ParaboleResponse> 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, "주문을 취소했습니다.");
Expand Down

0 comments on commit 08b4db2

Please sign in to comment.