diff --git a/src/main/java/com/mindway/server/v2/domain/order/presentation/OrdersController.java b/src/main/java/com/mindway/server/v2/domain/order/presentation/OrdersController.java index d02abf4..74aad69 100644 --- a/src/main/java/com/mindway/server/v2/domain/order/presentation/OrdersController.java +++ b/src/main/java/com/mindway/server/v2/domain/order/presentation/OrdersController.java @@ -3,8 +3,10 @@ import com.mindway.server.v2.domain.order.entity.BookType; import com.mindway.server.v2.domain.order.presentation.dto.request.OrderRequest; import com.mindway.server.v2.domain.order.presentation.dto.request.OrderUpdateRequest; +import com.mindway.server.v2.domain.order.presentation.dto.response.OrdersResponse; import com.mindway.server.v2.domain.order.service.BookRequestService; import com.mindway.server.v2.domain.order.service.DeleteBookOrderService; +import com.mindway.server.v2.domain.order.service.GetBookOrdersService; import com.mindway.server.v2.domain.order.service.UpdateBookOrderService; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; @@ -12,6 +14,8 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import java.util.List; + @RestController @RequiredArgsConstructor @RequestMapping("/api/v2/order") @@ -19,6 +23,7 @@ public class OrdersController { private final BookRequestService bookRequestService; private final DeleteBookOrderService deleteBookOrderService; private final UpdateBookOrderService updateBookOrderService; + private final GetBookOrdersService getBookOrdersService; @PostMapping() public ResponseEntity bookRequest @@ -40,4 +45,10 @@ public ResponseEntity deleteBook (@PathVariable(value = "order_id") Long i return ResponseEntity.noContent().build(); } + @GetMapping + public ResponseEntity> bookOrders () { + List orders = getBookOrdersService.execute(); + return ResponseEntity.ok(orders); + } + } diff --git a/src/main/java/com/mindway/server/v2/global/security/config/SecurityConfig.java b/src/main/java/com/mindway/server/v2/global/security/config/SecurityConfig.java index 56d1801..8edc725 100644 --- a/src/main/java/com/mindway/server/v2/global/security/config/SecurityConfig.java +++ b/src/main/java/com/mindway/server/v2/global/security/config/SecurityConfig.java @@ -57,6 +57,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { .requestMatchers(HttpMethod.POST, "/api/v2/order").authenticated() .requestMatchers(HttpMethod.DELETE, "/api/v2/order/{order_id}").authenticated() .requestMatchers(HttpMethod.PATCH, "api/v2/order/{order_id}").authenticated() + .requestMatchers(HttpMethod.GET, "api/v2/order").authenticated() .anyRequest().authenticated() )