application.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Spring Boot 应用配置
  2. spring:
  3. # 应用基本信息
  4. application:
  5. name: base-server
  6. # MVC配置
  7. mvc:
  8. pathmatch:
  9. matching-strategy: ant_path_matcher
  10. static-path-pattern: /static/**
  11. # 数据库配置
  12. datasource:
  13. # H2内存数据库配置(避免文件锁定问题)
  14. url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
  15. driver-class-name: org.h2.Driver
  16. username: sa
  17. password:
  18. # 禁用SQL脚本初始化
  19. sql:
  20. init:
  21. mode: never
  22. # MySQL数据库配置(生产环境用,需要时取消注释)
  23. # url: jdbc:mysql://localhost:3306/base_db?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
  24. # driver-class-name: com.mysql.cj.jdbc.Driver
  25. # username: root
  26. # password: your_password
  27. # JPA配置
  28. jpa:
  29. hibernate:
  30. ddl-auto: update # 自动创建/更新表结构
  31. show-sql: true # 显示SQL语句
  32. properties:
  33. hibernate:
  34. dialect: org.hibernate.dialect.H2Dialect
  35. format_sql: true # 格式化SQL输出
  36. # H2控制台配置(开发时可以访问数据库)
  37. h2:
  38. console:
  39. enabled: true
  40. path: /h2-console
  41. # 开发工具配置
  42. devtools:
  43. restart:
  44. enabled: true
  45. # 文件上传配置
  46. servlet:
  47. multipart:
  48. enabled: true
  49. max-file-size: 10MB
  50. max-request-size: 10MB
  51. file-size-threshold: 2KB
  52. # 服务器配置
  53. server:
  54. port: 8080
  55. address: 0.0.0.0 # 绑定到所有网络接口,允许外部访问
  56. # 日志配置
  57. logging:
  58. level:
  59. com.example.baseserver: DEBUG
  60. org.springframework.web: DEBUG
  61. org.hibernate.SQL: DEBUG
  62. org.hibernate.type.descriptor.sql.BasicBinder: TRACE
  63. pattern:
  64. console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
  65. # Coze API配置
  66. coze:
  67. api:
  68. base-url: https://api.coze.cn/v1
  69. access-token: pat_RiCayfXkgyXLCOWn9eVjwUmwRHavFzjYqT52COqxdMuWSku8PYMN1qD44OZrFCKg
  70. workflow-id: 7543491577856639012
  71. # SpringDoc OpenAPI 配置
  72. springdoc:
  73. api-docs:
  74. path: /docs/api-docs
  75. swagger-ui:
  76. path: /docs
  77. operationsSorter: method
  78. tagsSorter: alpha
  79. tryItOutEnabled: true
  80. filter: true
  81. show-actuator: false
  82. # 自定义配置
  83. app:
  84. name: Base Server API
  85. version: 1.0.0
  86. description: Android应用后端API服务
  87. # DeepSeek API配置
  88. deepseek:
  89. api-key: sk-bc62a7031dcb4e40a9ab5545601638cc
  90. base-url: https://api.deepseek.com
  91. model: deepseek-reasoner
  92. max-tokens: 2048
  93. temperature: 0.7
  94. stream: false