服务打包初步结构

This commit is contained in:
2026-01-02 14:56:14 +08:00
parent 19026c1b30
commit 89bc8bf1d4
77 changed files with 5290 additions and 2070 deletions

View File

@@ -1,124 +0,0 @@
# ================== Server ==================
server:
port: 8182
# servlet:
# context-path: /urban-lifeline/system # 微服务架构下context-path由Gateway管理
# ================== Auth ====================
auth:
enabled: true
gateway-mode: true
# 认证接口:可以按服务自定义
login-path: /urban-lifeline/auth/login
logout-path: /urban-lifeline/auth/logout
captcha-path: /urban-lifeline/auth/captcha
refresh-path: /urban-lifeline/auth/refresh
# 通用白名单(非认证接口)
whitelist:
# Swagger/OpenAPI 文档相关(建议不带 context-path
- /swagger-ui/**
- /swagger-ui.html
- /v3/api-docs/**
- /webjars/**
# 静态资源
- /favicon.ico
- /error
# 健康检查
- /actuator/health
- /actuator/info
- /system/guest/identify
# 其他需要放行的路径
# - /public/**
# - /api/public/**
security:
aes:
# AES-256 密钥Base64编码
# 警告:这是开发环境密钥,生产环境请使用密钥管理系统
secret-key: MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=
# ================== Spring ==================
spring:
application:
name: system-service
# ================== Spring Cloud Nacos ==================
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
namespace: dev
group: DEFAULT_GROUP
# ================== DataSource ==================
datasource:
# 按你的实际库名改一下,比如 urban-lifeline_system
url: jdbc:postgresql://127.0.0.1:5432/urban_lifeline # 换成你的 PG 库名
username: postgres # PG 用户
password: postgres # PG 密码
driver-class-name: org.postgresql.Driver
# ================== Redis ==================
data:
redis:
host: 127.0.0.1 # 如果是 docker 跑的 redis按实际 host / 端口改
port: 6379
database: 0
password: 123456 # 如果有密码就填上,没密码可以去掉这一行
# ================== 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:
application:
name: urban-lifeline-system
qos-enable: false
protocol:
name: dubbo
port: -1 # -1 表示随机端口,避免端口冲突;也可以写死一个端口
registry:
# Nacos 注册中心地址:使用 docker-compose 中映射到宿主机的 8848 端口
address: nacos://127.0.0.1:8848
# 如果 Nacos 有用户名密码,可以加上:
# username: nacos
# password: nacos
# Dubbo 服务扫描包(你 @DubboService 标注的位置)
scan:
base-packages: org.xyzh.system.service.impl
# ================== MyBatis ==================
mybatis-plus:
mapper-locations: classpath:mapper/**/*.xml
type-aliases-package: org.xyzh.common.dto, org.xyzh.api
# ================== Logging ==================
logging:
config: classpath:log4j2.xml
charset:
console: UTF-8
file: UTF-8
level:
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping: TRACE

View File

@@ -1,83 +1,32 @@
# ================== Server ==================
# ================== System 系统服务配置 ==================
server:
port: 8182
# servlet:
# context-path: /urban-lifeline/system # 微服务架构下context-path由Gateway管理
# ================== Auth ====================
port: 8082
spring:
application:
name: system-service
# ================== Auth ==================
auth:
enabled: true
gateway-mode: true
# 认证接口:可以按服务自定义
login-path: /urban-lifeline/auth/login
logout-path: /urban-lifeline/auth/logout
captcha-path: /urban-lifeline/auth/captcha
refresh-path: /urban-lifeline/auth/refresh
# 通用白名单(非认证接口)
whitelist:
# Swagger/OpenAPI 文档相关(建议不带 context-path
- /swagger-ui/**
- /swagger-ui.html
- /v3/api-docs/**
- /webjars/**
# 静态资源
- /favicon.ico
- /error
# 健康检查
- /actuator/health
- /actuator/info
- /system/guest/identify
# 其他需要放行的路径
# - /public/**
# - /api/public/**
security:
aes:
secret-key: MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=
# ================== Spring ==================
spring:
application:
name: system-service
# ================== Spring Cloud Nacos ==================
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
namespace: dev
group: DEFAULT_GROUP
# ================== DataSource ==================
datasource:
# 按你的实际库名改一下,比如 urban-lifeline_system
url: jdbc:postgresql://127.0.0.1:5432/urban_lifeline # 换成你的 PG 库名
username: postgres # PG 用户
password: postgres # PG 密码
driver-class-name: org.postgresql.Driver
# ================== Redis ==================
data:
redis:
host: 127.0.0.1 # 如果是 docker 跑的 redis按实际 host / 端口改
port: 6379
database: 0
password: 123456 # 如果有密码就填上,没密码可以去掉这一行
# ================== 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
@@ -86,37 +35,10 @@ springdoc:
display-name: '系统服务 API'
paths-to-match: '/**'
# ================== Dubbo + Nacos 注册中心 ==================
# ================== Dubbo ==================
dubbo:
application:
name: urban-lifeline-system
qos-enable: false
protocol:
name: dubbo
port: -1 # -1 表示随机端口,避免端口冲突;也可以写死一个端口
registry:
# Nacos 注册中心地址:使用 docker-compose 中映射到宿主机的 8848 端口
address: nacos://127.0.0.1:8848
# 如果 Nacos 有用户名密码,可以加上:
# username: nacos
# password: nacos
# Dubbo 服务扫描包(你 @DubboService 标注的位置)
scan:
base-packages: org.xyzh.system.service.impl
# ================== MyBatis ==================
mybatis-plus:
mapper-locations: classpath:mapper/**/*.xml
type-aliases-package: org.xyzh.common.dto, org.xyzh.api
# ================== Logging ==================
logging:
config: classpath:log4j2.xml
charset:
console: UTF-8
file: UTF-8
level:
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping: TRACE