123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- # Spring Boot 应用配置
- spring:
- # 应用基本信息
- application:
- name: base-server
-
- # 数据库配置
- datasource:
- # H2内存数据库配置(避免文件锁定问题)
- url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
- driver-class-name: org.h2.Driver
- username: sa
- password:
-
- # 禁用SQL脚本初始化
- sql:
- init:
- mode: never
-
- # MySQL数据库配置(生产环境用,需要时取消注释)
- # url: jdbc:mysql://localhost:3306/base_db?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
- # driver-class-name: com.mysql.cj.jdbc.Driver
- # username: root
- # password: your_password
-
- # JPA配置
- jpa:
- hibernate:
- ddl-auto: update # 自动创建/更新表结构
- show-sql: true # 显示SQL语句
- properties:
- hibernate:
- dialect: org.hibernate.dialect.H2Dialect
- format_sql: true # 格式化SQL输出
-
- # H2控制台配置(开发时可以访问数据库)
- h2:
- console:
- enabled: true
- path: /h2-console
-
- # 开发工具配置
- devtools:
- restart:
- enabled: true
-
- # 文件上传配置
- servlet:
- multipart:
- enabled: true
- max-file-size: 10MB
- max-request-size: 10MB
- file-size-threshold: 2KB
- # 服务器配置
- server:
- port: 8080
- address: 0.0.0.0 # 绑定到所有网络接口,允许外部访问
- servlet:
- context-path: /api # API基础路径
- # 日志配置
- logging:
- level:
- com.example.baseserver: DEBUG
- org.springframework.web: DEBUG
- org.hibernate.SQL: DEBUG
- pattern:
- console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
- # SpringDoc OpenAPI 配置
- springdoc:
- api-docs:
- path: /docs/api-docs
- swagger-ui:
- path: /docs
- operationsSorter: method
- tagsSorter: alpha
- tryItOutEnabled: true
- filter: true
- show-actuator: false
- # 自定义配置
- app:
- name: Base Server API
- version: 1.0.0
- description: Android应用后端API服务
- # DeepSeek API配置
- deepseek:
- api-key: sk-bc62a7031dcb4e40a9ab5545601638cc
- base-url: https://api.deepseek.com
- model: deepseek-reasoner
- max-tokens: 2048
- temperature: 0.7
- stream: false
|