first commit

This commit is contained in:
2025-06-12 19:37:54 +08:00
parent bb2eb010f7
commit 1c6093fa9a
87 changed files with 18432 additions and 0 deletions

View File

@@ -0,0 +1,100 @@
server:
port: 8080
servlet:
context-path: /
spring:
application:
name: agricultural-stock-platform-backend
# 数据源配置
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/agricultural_stock?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username: root
password: root
hikari:
minimum-idle: 5
maximum-pool-size: 20
connection-timeout: 30000
idle-timeout: 600000
max-lifetime: 1800000
# JPA配置
jpa:
hibernate:
ddl-auto: none
show-sql: false
database-platform: org.hibernate.dialect.MySQL8Dialect
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL8Dialect
format_sql: true
# Redis配置
redis:
host: localhost
port: 6379
database: 0
timeout: 6000ms
lettuce:
pool:
max-active: 10
max-wait: -1ms
max-idle: 8
min-idle: 0
# Kafka配置已移除
# MyBatis Plus配置
mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml
type-aliases-package: com.agricultural.stock.entity
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
global-config:
db-config:
id-type: auto
logic-delete-field: deleted
logic-delete-value: 1
logic-not-delete-value: 0
# SpringDoc OpenAPI 配置
springdoc:
api-docs:
path: /v3/api-docs
enabled: true
swagger-ui:
path: /swagger-ui
enabled: true
config-url: /v3/api-docs/swagger-config
urls-primary-name: default
packages-to-scan: com.agricultural.stock.controller
paths-to-match: /api/**
# 日志配置
logging:
level:
com.agricultural.stock: INFO
org.springframework: WARN
com.baomidou.mybatisplus: WARN
pattern:
console: "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
file:
name: logs/agricultural-stock-platform.log
# 自定义配置
agricultural:
stock:
# 数据采集配置
crawler:
interval: 60000 # 采集间隔(毫秒)
batch-size: 100 # 批处理大小
# Kafka配置已移除
# 缓存配置
cache:
expire-time: 3600 # 缓存过期时间(秒)