user-service api 초안 개발

This commit is contained in:
wonho
2025-10-24 15:19:04 +09:00
parent 50cf1dbcf1
commit 34df9c3b8f
28 changed files with 1953 additions and 15 deletions
@@ -0,0 +1,123 @@
spring:
application:
name: user-service
# Database Configuration (PostgreSQL)
datasource:
url: ${DB_URL:jdbc:postgresql://20.249.125.115:5432/userdb}
username: ${DB_USERNAME:eventuser}
password: ${DB_PASSWORD:Hi5Jessica!}
driver-class-name: ${DB_DRIVER:org.postgresql.Driver}
hikari:
maximum-pool-size: ${DB_POOL_MAX:20}
minimum-idle: ${DB_POOL_MIN:5}
connection-timeout: ${DB_CONN_TIMEOUT:30000}
idle-timeout: ${DB_IDLE_TIMEOUT:600000}
max-lifetime: ${DB_MAX_LIFETIME:1800000}
leak-detection-threshold: ${DB_LEAK_THRESHOLD:60000}
# H2 Console (개발용 - PostgreSQL 사용 시 비활성화)
h2:
console:
enabled: ${H2_CONSOLE_ENABLED:false}
path: /h2-console
# JPA Configuration
jpa:
show-sql: ${SHOW_SQL:true}
properties:
hibernate:
format_sql: true
use_sql_comments: true
dialect: ${JPA_DIALECT:org.hibernate.dialect.PostgreSQLDialect}
hibernate:
ddl-auto: ${DDL_AUTO:update}
# Auto-configuration exclusions for development without external services
autoconfigure:
exclude:
- ${EXCLUDE_KAFKA:}
- ${EXCLUDE_REDIS:}
# Redis Configuration
data:
redis:
enabled: ${REDIS_ENABLED:true}
host: ${REDIS_HOST:20.214.210.71}
port: ${REDIS_PORT:6379}
password: ${REDIS_PASSWORD:Hi5Jessica!}
timeout: ${REDIS_TIMEOUT:2000ms}
lettuce:
pool:
max-active: ${REDIS_POOL_MAX:8}
max-idle: ${REDIS_POOL_IDLE:8}
min-idle: ${REDIS_POOL_MIN:0}
max-wait: ${REDIS_POOL_WAIT:-1ms}
database: ${REDIS_DATABASE:0}
# Kafka Configuration
kafka:
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS:4.230.50.63:9092}
consumer:
group-id: ${KAFKA_CONSUMER_GROUP:user-service-consumers}
auto-offset-reset: earliest
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
properties:
spring.json.trusted.packages: "*"
producer:
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
# JWT Configuration
jwt:
secret: ${JWT_SECRET:kt-event-marketing-secret-key-for-development-only-please-change-in-production}
access-token-validity: ${JWT_ACCESS_TOKEN_VALIDITY:604800000} # 7 days in milliseconds
# CORS Configuration
cors:
allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:*}
# Actuator
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
base-path: /actuator
endpoint:
health:
show-details: always
show-components: always
health:
livenessState:
enabled: true
readinessState:
enabled: true
# OpenAPI Documentation
springdoc:
api-docs:
path: /v3/api-docs
swagger-ui:
path: /swagger-ui.html
tags-sorter: alpha
operations-sorter: alpha
show-actuator: false
# Logging
logging:
level:
com.kt.event.user: ${LOG_LEVEL_APP:DEBUG}
org.springframework.web: ${LOG_LEVEL_WEB:INFO}
org.hibernate.SQL: ${LOG_LEVEL_SQL:DEBUG}
org.hibernate.type: ${LOG_LEVEL_SQL_TYPE:TRACE}
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} - %msg%n"
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
file:
name: ${LOG_FILE_PATH:logs/user-service.log}
# Server Configuration
server:
port: ${SERVER_PORT:8081}