fix: 网关聚合文档实现

This commit is contained in:
2026-01-08 00:50:32 +08:00
parent 9a20a52afb
commit 05aeef2f79
4 changed files with 44 additions and 3 deletions

View File

@@ -51,6 +51,13 @@ aioj-backend-gateway:
- /api/v1/question/detail/**
- /actuator/health
- /swagger-ui/**
- /doc.html
- /doc.html/**
- /webjars/**
- /v3/api-docs/**
- /**/v3/api-docs/**
- /auth-service/**
- /user-service/**
logging:
level:
@@ -64,3 +71,22 @@ logging:
org.springframework.cloud.gateway: DEBUG
# 自定义过滤器日志
cn.meowrain.aioj.backend.gateway: DEBUG
knife4j:
gateway:
enabled: true
tags-sorter: alpha
operations-sorter: alpha
strategy: manual
routes:
- name: 认证服务
service-name: auth-service
url: /auth-service/api/v3/api-docs
context-path: /auth-service
order: 1
- name: 用户服务
service-name: user-service
url: /user-service/api/v3/api-docs
context-path: /user-service
order: 2

View File

@@ -11,6 +11,21 @@ spring:
server:
webflux:
routes:
# auth服务 Swagger 文档路由
- id: auth-service-doc
uri: lb://auth-service
predicates:
- Path=/auth-service/**
filters:
- StripPrefix=1
# user服务 Swagger 文档路由
- id: user-service-doc
uri: lb://user-service
predicates:
- Path=/user-service/**
filters:
- StripPrefix=1
# auth业务接口
- id: auth-service
uri: lb://auth-service
predicates: