Skip to content

Commit df24b36

Browse files
authored
Merge pull request #38 from GTable/refactor/#37-cors의존성추가
refactor(APIAdmin,APIUser): cors 해결
2 parents cb60934 + 8760688 commit df24b36

6 files changed

Lines changed: 9 additions & 4 deletions

File tree

application-admin/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies {
2828
implementation project(':domain-reservation') // 예약 관련 도메인
2929
implementation project(':security-admin') // 인증 관련 도메인
3030
implementation project(':infra-aws') // aws 관련 도메인
31+
implementation project(':application-config')
3132

3233
// Spring Boot Starter
3334
implementation 'org.springframework.boot:spring-boot-starter-web'

application-admin/src/main/java/com/nowait/applicationadmin/ApiAdminApplication.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
@SpringBootApplication(scanBasePackages = {
1010
"com.nowait.applicationadmin",
1111
"com.nowait.infraaws",
12-
"com.nowait.adminsecurity"
12+
"com.nowait.adminsecurity",
13+
"com.nowait.config"
1314
})
1415
@EntityScan(basePackages = {
1516
"com.nowait.menu.entity",

application-config/src/main/java/com/nowait/config/config/CorsConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public CorsConfigurationSource corsConfigurationSource() {
1515
CorsConfiguration config = new CorsConfiguration();
1616

1717
config.setAllowCredentials(true); // 쿠키나 인증헤더 자격증명 허용
18-
config.setAllowedOrigins(List.of("http://localhost:5173")); // 허용할 출처 설정
18+
config.setAllowedOrigins(List.of("http://localhost:5173","http://localhost:63342")); // 허용할 출처 설정
1919
config.setAllowedMethods(List.of("GET", "POST", "PATCH", "PUT", "DELETE", "OPTIONS")); // 메서드 허용
2020
config.setAllowedHeaders(List.of("*")); //클라이언트가 보낼 수 있는 헤더
2121
config.setExposedHeaders(List.of("Authorization")); //클라이언트(브라우저)가 접근할 수 있는 헤더 지정

application-user/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dependencies {
2929
implementation project(':infra-aws') // 사용자 관련 도메인
3030
implementation project(':security-front') // 사용자 관련 도메인
3131
implementation project(':external-oauth') // 외부 OAuth 관련 도메인
32+
implementation project(':application-config')
3233

3334
// Spring Boot Starter
3435
implementation 'org.springframework.boot:spring-boot-starter-web'

application-user/src/main/java/com/nowait/applicationuser/ApiUserApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
@SpringBootApplication(scanBasePackages = {
1111
"com.nowait.applicationuser",
1212
"com.nowait.frontsecurity",
13-
"com.nowait.externaloauth"
13+
"com.nowait.externaloauth",
14+
"com.nowait.config"
1415
})
1516
@EntityScan(basePackages = {
1617
"com.nowait.menu.entity",
@@ -19,7 +20,6 @@
1920
"com.nowait.user.entity",
2021
"com.nowait.bookmark.entity",
2122
"com.nowait.reservation.entity",
22-
"com.nowait.order.entity",
2323
"com.nowait.order.entity"
2424
})
2525
@EnableJpaRepositories(basePackages = {

application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateResponseDto.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ public class OrderCreateResponseDto {
1515
private Long orderId; // 주문 ID // 주문 상태 (예: "주문완료", "배송중" 등)
1616
private Long storeId; // 상점 ID
1717
private String storeName; // 상점 이름
18+
private String sessionId;
1819
private List<OrderItemResponseDTO> orderItems; // 주문 항목 목록
1920

2021
public static OrderCreateResponseDto fromEntity(UserOrder order) {
2122
return OrderCreateResponseDto.builder()
2223
.orderId(order.getId())
2324
.storeId(order.getStore().getStoreId())
2425
.storeName(order.getStore().getName())
26+
.sessionId(order.getSessionId())
2527
.orderItems(List.of())
2628
.build();
2729
}

0 commit comments

Comments
 (0)