mirror of
https://github.com/cna-bootcamp/phonebill.git
synced 2025-12-06 08:06:24 +00:00
주요 문제점 식별: - Gateway 라우팅 경로 불일치 (product-service: /products/**, bill-service: /api/v1/bills/**) - OpenAPI 서버 정보와 실제 Gateway 경로 매핑 누락 - Swagger UI에서 "Try it out" 기능 미작동 다음 단계: 라우팅 경로 통일화 및 OpenAPI 서버 정보 수정 예정 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
95 lines
3.0 KiB
Groovy
95 lines
3.0 KiB
Groovy
// API Gateway 모듈
|
|
// 루트 build.gradle의 subprojects 블록에서 공통 설정 적용됨
|
|
// API Gateway는 WebFlux를 사용하므로 일부 다른 설정 필요
|
|
|
|
// Spring Cloud 버전 정의
|
|
ext {
|
|
set('springCloudVersion', '2023.0.0')
|
|
}
|
|
|
|
dependencies {
|
|
// Common module dependency (exclude WebMVC, Security, and non-reactive Redis for WebFlux)
|
|
implementation(project(':common')) {
|
|
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-web'
|
|
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-security'
|
|
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-data-jpa'
|
|
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-data-redis'
|
|
}
|
|
|
|
// Spring Cloud Gateway (api-gateway specific)
|
|
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
|
|
|
|
// Redis for health checks and caching
|
|
implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'
|
|
|
|
// Circuit Breaker (api-gateway specific)
|
|
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'
|
|
|
|
// Monitoring (api-gateway specific)
|
|
implementation 'io.micrometer:micrometer-registry-prometheus'
|
|
|
|
// Logging (api-gateway specific)
|
|
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
|
|
|
|
// Netty macOS DNS resolver (api-gateway specific)
|
|
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.100.Final:osx-aarch_64'
|
|
|
|
// Test Dependencies (api-gateway specific)
|
|
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
|
|
}
|
|
|
|
dependencyManagement {
|
|
imports {
|
|
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
|
|
}
|
|
}
|
|
|
|
// 추가 테스트 설정 (루트에서 기본 설정됨)
|
|
tasks.named('test') {
|
|
systemProperty 'spring.profiles.active', 'test'
|
|
}
|
|
|
|
// JAR 파일명 설정
|
|
jar {
|
|
archiveBaseName = 'api-gateway'
|
|
enabled = false
|
|
}
|
|
|
|
bootJar {
|
|
archiveBaseName = 'api-gateway'
|
|
|
|
// 빌드 정보 추가
|
|
manifest {
|
|
attributes(
|
|
'Implementation-Title': 'PhoneBill API Gateway',
|
|
'Implementation-Version': "${version}",
|
|
'Built-By': System.getProperty('user.name'),
|
|
'Built-JDK': System.getProperty('java.version'),
|
|
'Build-Time': new Date().format('yyyy-MM-dd HH:mm:ss')
|
|
)
|
|
}
|
|
}
|
|
|
|
// 개발 환경 실행 설정
|
|
if (project.hasProperty('dev')) {
|
|
bootRun {
|
|
systemProperty 'spring.profiles.active', 'dev'
|
|
jvmArgs = ['-Dspring.devtools.restart.enabled=true']
|
|
}
|
|
}
|
|
|
|
// 프로덕션 환경 실행 설정
|
|
if (project.hasProperty('prod')) {
|
|
bootRun {
|
|
systemProperty 'spring.profiles.active', 'prod'
|
|
jvmArgs = [
|
|
'-server',
|
|
'-Xms512m',
|
|
'-Xmx1024m',
|
|
'-XX:+UseG1GC',
|
|
'-XX:G1HeapRegionSize=16m',
|
|
'-XX:+UseStringDeduplication',
|
|
'-XX:+OptimizeStringConcat'
|
|
]
|
|
}
|
|
} |