服务打包初步结构
This commit is contained in:
@@ -1,97 +1,35 @@
|
||||
# ================== Server ==================
|
||||
# ================== Auth 认证服务配置 ==================
|
||||
server:
|
||||
port: 8181
|
||||
# servlet:
|
||||
# context-path: /urban-lifeline/auth # 微服务架构下,context-path由Gateway管理,服务本身不需要设置
|
||||
port: 8081
|
||||
|
||||
# ================== Auth ====================
|
||||
auth:
|
||||
enabled: false # 认证服务自己不需要认证
|
||||
gateway-mode: false # 不使用gateway模式(auth服务作为独立服务)
|
||||
whitelist:
|
||||
- /** # 认证服务的所有接口都放行
|
||||
security:
|
||||
aes:
|
||||
# AES-256 密钥(Base64编码,必须与所有服务保持一致)
|
||||
# 警告:这是开发环境密钥,生产环境请使用密钥管理系统
|
||||
secret-key: MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=
|
||||
# ================== Spring ==================
|
||||
spring:
|
||||
application:
|
||||
name: auth-service
|
||||
|
||||
# ================== Spring Cloud Nacos ==================
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: dev
|
||||
group: DEFAULT_GROUP
|
||||
|
||||
# ================== DataSource ==================
|
||||
datasource:
|
||||
url: jdbc:postgresql://127.0.0.1:5432/urban_lifeline
|
||||
username: postgres
|
||||
password: postgres
|
||||
driver-class-name: org.postgresql.Driver
|
||||
|
||||
# ================== Redis ==================
|
||||
data:
|
||||
redis:
|
||||
host: 127.0.0.1 # 如果是 docker 跑的 redis,按实际 host / 端口改
|
||||
port: 6379
|
||||
database: 0
|
||||
password: 123456 # 如果有密码就填上,没密码可以去掉这一行
|
||||
# ================== Auth ==================
|
||||
auth:
|
||||
enabled: false # 认证服务自己不需要认证
|
||||
gateway-mode: false
|
||||
whitelist:
|
||||
- /**
|
||||
|
||||
# ================== SpringDoc ==================
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: true
|
||||
path: /v3/api-docs
|
||||
swagger-ui:
|
||||
enabled: true
|
||||
path: /swagger-ui.html
|
||||
try-it-out-enabled: true
|
||||
show-common-extensions: true
|
||||
show-extensions: true
|
||||
show-request-duration: true
|
||||
filter: true
|
||||
tags-sorter: alpha
|
||||
operations-sorter: alpha
|
||||
group-configs:
|
||||
- group: 'default'
|
||||
display-name: '认证服务 API'
|
||||
paths-to-match: '/**'
|
||||
|
||||
# ================== Dubbo + Nacos ==================
|
||||
# ================== Dubbo ==================
|
||||
dubbo:
|
||||
application:
|
||||
name: urban-lifeline-auth
|
||||
qos-enable: false
|
||||
protocol:
|
||||
name: dubbo
|
||||
port: -1
|
||||
registry:
|
||||
address: nacos://127.0.0.1:8848
|
||||
scan:
|
||||
base-packages: org.xyzh.auth.service.impl
|
||||
|
||||
# ================== MyBatis ==================
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:mapper/**/*.xml
|
||||
type-aliases-package: org.xyzh.common.dto, org.xyzh.api
|
||||
|
||||
# ================== JWT Configuration ==================
|
||||
# ================== JWT ==================
|
||||
jwt:
|
||||
secret: urban-lifeline-secret-key-2025-xyzh
|
||||
secret: ${JWT_SECRET:urban-lifeline-secret-key-2025-xyzh}
|
||||
expiration: 86400 # 24小时(秒)
|
||||
refresh-expiration: 604800 # 7天(秒)
|
||||
|
||||
# ================== Logging ==================
|
||||
logging:
|
||||
config: classpath:log4j2.xml
|
||||
charset:
|
||||
console: UTF-8
|
||||
file: UTF-8
|
||||
level:
|
||||
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping: TRACE
|
||||
|
||||
Reference in New Issue
Block a user