spring:
|
application:
|
name: system_gateway
|
# 安全配置
|
security:
|
# 验签公钥地址
|
oauth2:
|
authorizationserver:
|
token-uri: https://
|
cloud:
|
nacos:
|
server-addr: http://175.27.187.84:8848 #配置Nacos地址
|
username: nacos
|
password: nacos
|
discovery:
|
server-addr: http://175.27.187.84:8848 #配置Nacos地址
|
namespace: dev_renkang
|
username: nacos
|
password: nacos
|
gateway:
|
discovery:
|
locator:
|
#开启从注册中心动态创建路由的功能,利用微服务名进行路由
|
enabled: true
|
#开启小写验证,默认feign根据服务名查找都是用的全大写
|
lower-case-service-id: true
|
routes:
|
- id: meetingAdmin
|
name: 会议室微服务
|
uri: lb://meetingAdmin
|
# uri: http://localhost:10013
|
# 断言,路径相匹配的进行路由
|
predicates:
|
- Path=/meetingAdmin/**
|
filters:
|
- SwaggerHeaderFilter
|
- StripPrefix=1
|
|
- id: visitsAdmin
|
uri: lb://visitsAdmin
|
name: 访客系统微服务
|
# uri: http://localhost:10028
|
# 断言,路径相匹配的进行路由
|
predicates:
|
- Path=/visitsAdmin/**
|
filters:
|
- SwaggerHeaderFilter
|
- StripPrefix=1
|
management:
|
endpoints:
|
web:
|
exposure:
|
include: "*"
|
|
|
knife4j:
|
# 聚合swagger文档
|
gateway:
|
# 第一个配置,开启gateway聚合组件
|
enabled: true
|
# 第二行配置,设置聚合模式采用discover服务发现的模式
|
strategy: discover
|
# 服务发现模式的配置
|
discover:
|
# 第三行配置,开启discover模式
|
enabled: true
|
# 聚合所有子服务(swagger2规范),子服务是3规范则替换为openapi3
|
version: swagger2
|
# 需要排除的微服务(eg:网关服务)
|
excluded-services:
|
- gateway-service
|
|
# Api文档信息
|
# springdoc-openapi 项目配置
|
springdoc:
|
swagger-ui:
|
path: /doc.html
|
tags-sorter: alpha
|
operations-sorter: alpha
|
api-docs:
|
path: /v2/api-docs
|
group-configs:
|
- group: 'default'
|
paths-to-match: '/**'
|
info:
|
title: ${spring.application.name} - API
|
version: 3.0.0
|
description: 接口文档
|
contact:
|
name: 1
|
url: 1
|
email: 1
|
license:
|
name: Apache 2.0
|
url: https://www.apache.org/licenses/LICENSE-2.0.html
|