服务启动
This commit is contained in:
98
schoolNewsServ/admin/src/main/resources/application.yml
Normal file
98
schoolNewsServ/admin/src/main/resources/application.yml
Normal file
@@ -0,0 +1,98 @@
|
||||
server:
|
||||
port: 8080
|
||||
spring:
|
||||
application:
|
||||
name: school-news-admin
|
||||
|
||||
# 数据源配置
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/school_news?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: 123456
|
||||
hikari:
|
||||
maximum-pool-size: 30
|
||||
minimum-idle: 10
|
||||
connection-timeout: 30000
|
||||
idle-timeout: 600000
|
||||
max-lifetime: 1800000
|
||||
|
||||
# 认证配置
|
||||
school-news:
|
||||
auth:
|
||||
# JWT配置
|
||||
jwt-secret: schoolNewsSecretKeyForJWT2025SecureEnough
|
||||
jwt-expiration: 86400 # 24小时
|
||||
|
||||
# 安全配置
|
||||
max-login-attempts: 5
|
||||
lockout-duration: 30 # 锁定30分钟
|
||||
|
||||
# 免登录白名单
|
||||
white-list:
|
||||
- "/auth/login"
|
||||
- "/auth/logout"
|
||||
- "/auth/captcha"
|
||||
- "/auth/health"
|
||||
- "/actuator/**"
|
||||
- "/swagger-ui/**"
|
||||
- "/v3/api-docs/**"
|
||||
- "/favicon.ico"
|
||||
- "/error"
|
||||
- "/public/**"
|
||||
- "/static/**"
|
||||
|
||||
# MyBatis Plus配置
|
||||
mybatis-plus:
|
||||
# 实体类扫描包
|
||||
type-aliases-package: org.xyzh.common.dto
|
||||
# mapper xml文件位置
|
||||
mapper-locations: classpath*:mapper/*.xml
|
||||
# 全局配置
|
||||
global-config:
|
||||
db-config:
|
||||
# 逻辑删除字段
|
||||
logic-delete-field: deleted
|
||||
logic-delete-value: 1
|
||||
logic-not-delete-value: 0
|
||||
# 字段填充策略
|
||||
insert-strategy: not_null
|
||||
update-strategy: not_null
|
||||
select-strategy: not_empty
|
||||
# SQL配置
|
||||
configuration:
|
||||
# 开启驼峰命名转换
|
||||
map-underscore-to-camel-case: true
|
||||
# 开启二级缓存
|
||||
cache-enabled: true
|
||||
# 打印SQL
|
||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
config: classpath:log4j2-spring.xml
|
||||
level:
|
||||
org.xyzh: DEBUG
|
||||
org.xyzh.auth: DEBUG
|
||||
org.xyzh.system: DEBUG
|
||||
org.xyzh.news: DEBUG
|
||||
|
||||
# 管理端点配置
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,env
|
||||
endpoint:
|
||||
health:
|
||||
show-details: when-authorized
|
||||
|
||||
# 文档配置
|
||||
springdoc:
|
||||
api-docs:
|
||||
path: /v3/api-docs
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
tags-sorter: alpha
|
||||
operations-sorter: alpha
|
||||
debug: true
|
||||
Reference in New Issue
Block a user