2025-05-30 09:58:52 +08:00
|
|
|
|
server:
|
2025-06-26 18:26:54 +08:00
|
|
|
|
port: 8083
|
2025-05-30 09:58:52 +08:00
|
|
|
|
servlet:
|
|
|
|
|
context-path: /
|
|
|
|
|
encoding:
|
|
|
|
|
charset: UTF-8
|
|
|
|
|
enabled: true
|
|
|
|
|
force: true
|
|
|
|
|
compression:
|
|
|
|
|
enabled: true
|
|
|
|
|
mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json
|
|
|
|
|
min-response-size: 1024
|
|
|
|
|
|
|
|
|
|
spring:
|
|
|
|
|
profiles:
|
|
|
|
|
active: ${SPRING_PROFILES_ACTIVE:dev}
|
|
|
|
|
application:
|
|
|
|
|
name: stdproject-backend
|
2025-05-31 09:25:14 +08:00
|
|
|
|
main:
|
|
|
|
|
allow-bean-definition-overriding: true
|
2025-05-30 09:58:52 +08:00
|
|
|
|
datasource:
|
|
|
|
|
url: ${DB_URL:jdbc:mysql://121.37.111.42:3306/gisbi-demodb?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true}
|
|
|
|
|
username: ${DB_USERNAME:root}
|
|
|
|
|
password: ${DB_PASSWORD:mysql_F8ysiK@2024}
|
|
|
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
|
|
|
# HikariCP连接池配置
|
|
|
|
|
hikari:
|
|
|
|
|
pool-name: StdProjectHikariCP
|
|
|
|
|
minimum-idle: 5
|
|
|
|
|
maximum-pool-size: 20
|
|
|
|
|
auto-commit: true
|
|
|
|
|
idle-timeout: 30000
|
|
|
|
|
max-lifetime: 1800000
|
|
|
|
|
connection-timeout: 30000
|
|
|
|
|
connection-test-query: SELECT 1
|
2025-05-30 14:59:18 +08:00
|
|
|
|
|
2025-05-30 09:58:52 +08:00
|
|
|
|
cache:
|
|
|
|
|
jcache:
|
|
|
|
|
config: classpath:ehcache.xml # 指定Ehcache配置文件路径
|
|
|
|
|
security:
|
|
|
|
|
cors:
|
|
|
|
|
allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:3000,http://localhost:8080}
|
|
|
|
|
max-age: ${CORS_MAX_AGE:3600} # 预检请求的缓存时间(秒)
|
|
|
|
|
jwt:
|
2025-06-13 15:27:36 +08:00
|
|
|
|
enabled: ${JWT_ENABLED:false} # 控制是否启用JWT认证
|
2025-05-30 09:58:52 +08:00
|
|
|
|
secret: ${JWT_SECRET:YourJWTSecretKeyForStdProjectBackendApplicationWhichIsVeryLongAndSecure2024!@#$%^&*()}
|
2025-06-15 10:36:32 +08:00
|
|
|
|
expiration-ms: ${JWT_EXPIRATION:86400000} # Token 过期时间 (例如: 24小时)
|
|
|
|
|
refresh-expiration-ms: ${JWT_REFRESH_EXPIRATION:604800000} # 刷新Token过期时间 (例如: 7天)
|
2025-06-20 09:02:20 +08:00
|
|
|
|
rsa:
|
|
|
|
|
private-key: ${RSA_PRIVATE_KEY:MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==}
|
2025-05-30 09:58:52 +08:00
|
|
|
|
|
|
|
|
|
mybatis-plus:
|
2025-06-26 18:26:54 +08:00
|
|
|
|
mapper-locations: classpath*:/mybatis/**/*.xml # MyBatis Mapper XML文件位置
|
2025-05-30 09:58:52 +08:00
|
|
|
|
type-aliases-package: com.stdproject.entity
|
|
|
|
|
global-config:
|
|
|
|
|
db-config:
|
|
|
|
|
id-type: ASSIGN_ID # ID生成策略,assign_id 表示手动分配ID,通常使用雪花算法等
|
|
|
|
|
table-prefix: ${DB_TABLE_PREFIX:} # 如果表名有统一前缀,可以在这里配置
|
|
|
|
|
logic-delete-field: deleted # 逻辑删除字段名
|
|
|
|
|
logic-delete-value: 1 # 逻辑删除值
|
|
|
|
|
logic-not-delete-value: 0 # 逻辑未删除值
|
|
|
|
|
banner: false # 关闭MyBatis-Plus启动横幅
|
|
|
|
|
configuration:
|
|
|
|
|
map-underscore-to-camel-case: true # 开启驼峰命名转换
|
|
|
|
|
cache-enabled: true # 开启二级缓存
|
|
|
|
|
lazy-loading-enabled: true # 开启延迟加载
|
|
|
|
|
multiple-result-sets-enabled: true # 开启多结果集
|
|
|
|
|
use-column-label: true # 使用列标签
|
|
|
|
|
use-generated-keys: true # 使用生成的主键
|
|
|
|
|
auto-mapping-behavior: partial # 自动映射行为
|
|
|
|
|
default-executor-type: simple # 默认执行器类型
|
|
|
|
|
default-statement-timeout: 25000 # 默认语句超时时间
|
|
|
|
|
log-impl: ${MYBATIS_LOG_IMPL:org.apache.ibatis.logging.nologging.NoLoggingImpl} # SQL日志实现
|
|
|
|
|
|
|
|
|
|
logging:
|
|
|
|
|
config: classpath:logback-spring.xml # Logback配置文件
|
|
|
|
|
level:
|
|
|
|
|
root: ${LOG_LEVEL_ROOT:INFO}
|
|
|
|
|
com.stdproject: ${LOG_LEVEL_APP:DEBUG}
|
|
|
|
|
org.springframework.security: ${LOG_LEVEL_SECURITY:WARN}
|
|
|
|
|
org.hibernate.SQL: ${LOG_LEVEL_SQL:WARN}
|
|
|
|
|
org.hibernate.type.descriptor.sql.BasicBinder: ${LOG_LEVEL_SQL_PARAMS:WARN}
|
|
|
|
|
pattern:
|
|
|
|
|
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
|
|
|
|
|
file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
|
|
|
|
|
|
|
|
|
|
springdoc:
|
|
|
|
|
api-docs:
|
|
|
|
|
path: /v3/api-docs
|
|
|
|
|
enabled: ${SWAGGER_ENABLED:true}
|
|
|
|
|
swagger-ui:
|
|
|
|
|
path: /swagger-ui.html
|
|
|
|
|
enabled: ${SWAGGER_UI_ENABLED:true}
|
|
|
|
|
operations-sorter: alpha
|
|
|
|
|
tags-sorter: alpha
|
|
|
|
|
try-it-out-enabled: true
|
|
|
|
|
filter: true
|
|
|
|
|
default-consumes-media-type: application/json
|
|
|
|
|
default-produces-media-type: application/json
|
|
|
|
|
show-actuator: ${SWAGGER_SHOW_ACTUATOR:true}
|
|
|
|
|
packages-to-scan: com.stdproject.controller
|
|
|
|
|
|
|
|
|
|
# 管理端点配置
|
|
|
|
|
management:
|
|
|
|
|
endpoints:
|
|
|
|
|
web:
|
|
|
|
|
exposure:
|
|
|
|
|
include: ${ACTUATOR_ENDPOINTS:health,info,metrics}
|
|
|
|
|
base-path: /actuator
|
|
|
|
|
endpoint:
|
|
|
|
|
health:
|
|
|
|
|
show-details: ${ACTUATOR_HEALTH_DETAILS:when-authorized}
|
|
|
|
|
info:
|
|
|
|
|
enabled: true
|
|
|
|
|
info:
|
|
|
|
|
env:
|
|
|
|
|
enabled: true
|
|
|
|
|
java:
|
|
|
|
|
enabled: true
|
|
|
|
|
os:
|
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
|
|
# 应用信息配置
|
|
|
|
|
info:
|
|
|
|
|
app:
|
|
|
|
|
name: ${spring.application.name}
|
|
|
|
|
description: StdProject Backend Application
|
|
|
|
|
version: 1.0.0
|
|
|
|
|
encoding: UTF-8
|
|
|
|
|
java:
|
|
|
|
|
version: ${java.version}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
# 开发环境配置
|
|
|
|
|
spring:
|
|
|
|
|
config:
|
|
|
|
|
activate:
|
|
|
|
|
on-profile: dev
|
|
|
|
|
security:
|
|
|
|
|
jwt:
|
2025-05-31 09:25:14 +08:00
|
|
|
|
enabled: false
|
2025-05-30 09:58:52 +08:00
|
|
|
|
logging:
|
|
|
|
|
level:
|
|
|
|
|
com.stdproject: DEBUG
|
|
|
|
|
org.hibernate.SQL: DEBUG
|
|
|
|
|
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
|
|
|
|
|
mybatis-plus:
|
|
|
|
|
configuration:
|
2025-05-31 09:25:14 +08:00
|
|
|
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #org.apache.ibatis.logging.nologging.NoLoggingImpl
|
2025-05-30 09:58:52 +08:00
|
|
|
|
springdoc:
|
|
|
|
|
swagger-ui:
|
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
# 生产环境配置
|
|
|
|
|
spring:
|
|
|
|
|
config:
|
|
|
|
|
activate:
|
|
|
|
|
on-profile: prod
|
|
|
|
|
security:
|
|
|
|
|
jwt:
|
|
|
|
|
enabled: true
|
|
|
|
|
logging:
|
|
|
|
|
level:
|
|
|
|
|
root: WARN
|
|
|
|
|
com.stdproject: INFO
|
|
|
|
|
org.springframework.security: ERROR
|
|
|
|
|
mybatis-plus:
|
|
|
|
|
configuration:
|
|
|
|
|
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
|
|
|
|
springdoc:
|
|
|
|
|
api-docs:
|
|
|
|
|
enabled: false
|
|
|
|
|
swagger-ui:
|
|
|
|
|
enabled: false
|
|
|
|
|
management:
|
|
|
|
|
endpoints:
|
|
|
|
|
web:
|
|
|
|
|
exposure:
|
2025-05-30 14:59:18 +08:00
|
|
|
|
include: health,info
|