Files
mp-java/src/main/resources/application.yml
赵忠林 66b8b1e8b8 feat(jackson): 使用Jackson2ObjectMapperBuilder配置ObjectMapper
- 使用Jackson2ObjectMapperBuilder构建ObjectMapper以确保与Spring Boot完全兼容
- 配置JavaTimeModule以支持Java 8时间类型
- 设置时区为GMT+8- 禁用将日期写为时间戳
- 忽略未知属性的反序列化错误
- 在application.yml中显式启用JavaTimeModule模块
2025-09-24 17:08:25 +08:00

237 lines
6.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 端口
server:
port: 9200
# 多环境配置
spring:
profiles:
active: dev
application:
name: server
# 允许循环引用(临时解决方案)
main:
allow-circular-references: true
# 修复 Springfox 与 Spring Boot 2.6+ 兼容性问题
mvc:
pathmatch:
matching-strategy: ant_path_matcher
# json时间格式设置
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
serialization:
write-dates-as-timestamps: false
deserialization:
fail-on-unknown-properties: false
# 确保启用Java 8时间支持
modules:
- com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
# 连接池配置
datasource:
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 30000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
test-while-idle: true
test-on-borrow: true
test-on-return: false
remove-abandoned: true
remove-abandoned-timeout: 1800
#pool-prepared-statements: false
#max-pool-prepared-statement-per-connection-size: 20
filters: stat, wall
validation-query: SELECT 'x'
aop-patterns: com.gxwebsoft.*.*.service.*
stat-view-servlet:
url-pattern: /druid/*
reset-enable: true
login-username: admin
login-password: admin
# 设置上传文件大小
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
# 邮件服务器配置
mail:
host: smtp.qq.com
username: 170083662@qq.com
password: mnfokualhfaucaie
default-encoding: UTF-8
properties:
mail:
smtp:
auth: true
socketFactory:
class: javax.net.ssl.SSLSocketFactory
port: 465
# Mybatis-plus配置
mybatis-plus:
mapper-locations: classpath*:com/gxwebsoft/**/*Mapper.xml
configuration:
map-underscore-to-camel-case: true
cache-enabled: true
global-config:
:banner: false
db-config:
id-type: auto
logic-delete-value: 1
logic-not-delete-value: 0
# 框架配置
config:
open-office-home: C:/OpenOffice4/
swagger-base-package: com.gxwebsoft
swagger-title: 网宿软件 API文档
swagger-description: websoft - 基于java spring、vue3、antd构建的前后端分离快速开发框架
swagger-version: 2.0
token-key: WLgNsWJ8rPjRtnjzX/Gx2RGS80Kwnm/ZeLbvIL+NrBs=
# 主服务器
server-url: https://server.websoft.top/api
# 文件服务器
file-server: https://file.websoft.top
# 其他
api-url: https://server.websoft.top/api
upload-path: /Users/gxwebsoft/Documents/uploads
local-upload-path: /Users/gxwebsoft/Documents/uploads
# 阿里云OSS云存储
endpoint: https://oss-cn-shenzhen.aliyuncs.com
accessKeyId: LTAI4GKGZ9Z2Z8JZ77c3GNZP
accessKeySecret: BiDkpS7UXj72HWwDWaFZxiXjNFBNCM
bucketName: oss-gxwebsoft
bucketDomain: https://oss.wsdns.cn
aliyunDomain: https://oss-gxwebsoft.oss-cn-shenzhen.aliyuncs.com
# 商城订单配置
shop:
order:
# 测试账号配置
test-account:
enabled: true # 禁用测试账号功能
phone-numbers:
- "19163679581" # 改为其他测试手机号
test-pay-amount: 0.01
# 租户特殊规则配置
# tenant-rules:
# - tenant-id: 10324
# tenant-name: "百色中学"
# min-amount: 10
# min-amount-message: "捐款金额最低不能少于10元感谢您的爱心捐赠^_^"
# enabled: true
# 默认配置
default-config:
default-title: "订单名称"
default-comments: "暂无"
min-order-amount: 0
order-timeout-minutes: 30
# 订单自动取消配置
auto-cancel:
# 是否启用自动取消功能
enabled: true
# 默认超时时间(分钟)
default-timeout-minutes: 30
# 定时任务检查间隔(分钟)
check-interval-minutes: 1
# 批量处理大小
batch-size: 100
# 定时任务执行时间cron表达式
# 生产环境每5分钟执行一次
cron: "0 */5 * * * ?"
# 租户特殊配置
# tenant-configs:
# - tenant-id: 10324
# tenant-name: "百色中学"
# timeout-minutes: 120 # 捐款订单给更长的支付时间
# enabled: true
# 可以添加更多租户配置
# - tenant-id: 10550
# tenant-name: "其他租户"
# timeout-minutes: 15
# enabled: true
# 证书配置
certificate:
# 证书加载模式: CLASSPATH, FILESYSTEM, VOLUME
load-mode: CLASSPATH
# Docker挂载卷证书路径
cert-root-path: /app/certs
# 开发环境证书路径前缀
dev-cert-path: dev
# 微信支付证书配置
wechat-pay:
dev:
api-v3-key: "0kF5OlPr482EZwtn9zGufUcqa7ovgxRL"
private-key-file: "apiclient_key.pem"
apiclient-cert-file: "apiclient_cert.pem"
wechatpay-cert-file: "wechatpay_cert.pem"
prod-base-path: "/file"
cert-dir: "wechat"
# 支付宝证书配置
alipay:
cert-dir: "alipay"
app-private-key-file: "app_private_key.pem"
app-cert-public-key-file: "appCertPublicKey.crt"
alipay-cert-public-key-file: "alipayCertPublicKey.crt"
alipay-root-cert-file: "alipayRootCert.crt"
# 启用 SpringDoc OpenAPI
springdoc:
api-docs:
enabled: true
swagger-ui:
enabled: true
# 启用 Knife4j
knife4j:
enable: true
# 优惠券配置
coupon:
# 过期处理定时任务配置
expire:
# 定时任务执行时间cron表达式
# 生产环境每天凌晨2点执行
# 开发环境每10分钟执行一次
cron: "0 0 2 * * ?"
# 开发环境可以设置为: "0 */10 * * * ?"
# 状态管理配置
status:
# 是否启用自动状态更新
auto-update: true
# 批量处理大小
batch-size: 1000
# 支付配置
payment:
# 开发环境配置
dev:
# 开发环境回调地址(本地调试用)
notify-url: "http://frps-10550.s209.websoft.top/api/shop/shop-order/notify"
# 开发环境是否启用环境感知
environment-aware: true
# 生产环境配置
prod:
# 生产环境回调地址
notify-url: "https://cms-api.websoft.top/api/shop/shop-order/notify"
# 生产环境是否启用环境感知
environment-aware: false