- 将所有微服务名称添加 aioj- 前缀 (auth-service -> aioj-auth-service) - 更新网关路由配置以使用新的服务名称 - 为所有服务添加 logback-spring.xml 日志配置 - 更新 .gitignore 排除 uploads 和 logs 目录 Co-Authored-By: Claude <noreply@anthropic.com>
101 lines
2.8 KiB
YAML
101 lines
2.8 KiB
YAML
server:
|
|
port: 18085
|
|
error:
|
|
include-stacktrace: never
|
|
spring:
|
|
application:
|
|
name: aioj-backend-gateway
|
|
profiles:
|
|
active: @env@
|
|
cloud:
|
|
gateway:
|
|
server:
|
|
webflux:
|
|
routes:
|
|
# auth服务 Swagger 文档路由
|
|
- id: auth-service-doc
|
|
uri: lb://aioj-auth-service
|
|
predicates:
|
|
- Path=/auth-service/**
|
|
filters:
|
|
- StripPrefix=1
|
|
# user服务 Swagger 文档路由
|
|
- id: user-service-doc
|
|
uri: lb://aioj-user-service
|
|
predicates:
|
|
- Path=/user-service/**
|
|
filters:
|
|
- StripPrefix=1
|
|
# auth服务 Swagger 文档路由
|
|
- id: file-service-doc
|
|
uri: lb://aioj-file-service
|
|
predicates:
|
|
- Path=/file-service/**
|
|
filters:
|
|
- StripPrefix=1
|
|
# auth业务接口路由
|
|
- id: auth-service
|
|
uri: lb://aioj-auth-service
|
|
predicates:
|
|
- Path=/api/v1/auth/**
|
|
filters:
|
|
- name: Retry
|
|
args:
|
|
retries: 3
|
|
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
|
|
backoff:
|
|
firstBackoff: 50ms
|
|
maxBackoff: 500ms
|
|
- id: user-service
|
|
uri: lb://aioj-user-service
|
|
predicates:
|
|
- Path=/api/v1/user/**
|
|
filters:
|
|
- name: Retry
|
|
args:
|
|
retries: 3
|
|
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
|
|
backoff:
|
|
firstBackoff: 50ms
|
|
maxBackoff: 500ms
|
|
- id: file-service
|
|
uri: lb://aioj-file-service
|
|
predicates:
|
|
- Path=/api/v1/file/**
|
|
filters:
|
|
- name: Retry
|
|
args:
|
|
retries: 3
|
|
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
|
|
backoff:
|
|
firstBackoff: 50ms
|
|
maxBackoff: 500ms
|
|
# 文件访问路由(公开,直接转发不去前缀)
|
|
- id: file-access
|
|
uri: lb://aioj-file-service
|
|
predicates:
|
|
- Path=/api/file/**
|
|
# 设置应用启动后的就绪探针
|
|
lifecycle:
|
|
timeout-per-shutdown-phase: 30s
|
|
|
|
|
|
aioj-backend-gateway:
|
|
# 白名单配置
|
|
white-list:
|
|
- /api/v1/auth/login
|
|
- /api/v1/user/register
|
|
- /api/v1/auth/refresh
|
|
- /actuator/health
|
|
- /swagger-ui/**
|
|
- /v3/api-docs/**
|
|
- /swagger-resources/**
|
|
|
|
aioj:
|
|
log:
|
|
enabled: true
|
|
max-length: 20000
|
|
logging:
|
|
file:
|
|
path: ./logs/${spring.application.name}
|