application.properties 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. # ============================================
  2. # Lingyue Starter - 单体应用统一配置
  3. # ============================================
  4. # 引入公共配置(标记为可选,避免文件不存在时启动失败)
  5. spring.config.import=optional:classpath:application-common.properties,optional:classpath:application-infra.properties
  6. # 服务端口
  7. server.port=5232
  8. server.servlet.context-path=/
  9. server.tomcat.uri-encoding=UTF-8
  10. server.tomcat.accept-count=1000
  11. server.tomcat.threads.max=800
  12. server.tomcat.threads.min-spare=10
  13. # 应用名称
  14. spring.application.name=lingyue-zhibao
  15. app.name=灵越智报
  16. app.version=2.0.0
  17. app.copyrightYear=2024
  18. # 允许 Bean 定义覆盖(单体应用可能有重复的 Bean)
  19. spring.main.allow-bean-definition-overriding=true
  20. # 文件上传配置
  21. spring.servlet.multipart.max-file-size=20MB
  22. spring.servlet.multipart.max-request-size=100MB
  23. app.uploadBaseDir=/tmp/lingyue-zhibao
  24. # 文件存储配置
  25. file.storage.base-path=${FILE_STORAGE_BASE_PATH:/data/lingyue/files}
  26. file.storage.text-path=${FILE_STORAGE_TEXT_PATH:/data/lingyue/texts}
  27. # 国际化配置
  28. spring.messages.basename=i18n/messages
  29. # 热部署配置
  30. spring.devtools.restart.enabled=true
  31. # MVC配置
  32. spring.mvc.pathmatch.matching-strategy=ant-path-matcher
  33. # 激活的配置文件
  34. spring.profiles.active=dev
  35. # MyBatis Plus配置(覆盖公共配置)
  36. mybatis-plus.type-aliases-package=com.lingyue.**.entity
  37. mybatis-plus.config-location=classpath:mybatis/mybatis-config.xml
  38. # JWT配置
  39. jwt.secret=${JWT_SECRET:lingyue-zhibao-secret-key-2024-please-change-in-production}
  40. jwt.expiration=604800000
  41. jwt.refresh-expiration=2592000000
  42. # Token配置
  43. token.header=Authorization
  44. token.secret=${JWT_SECRET:lingyue-zhibao-secret-key-2024-please-change-in-production}
  45. token.expireTime=604800
  46. # 用户配置
  47. user.password.maxRetryCount=5
  48. user.password.lockTime=10
  49. # SpringDoc OpenAPI配置(如遇到问题可临时禁用)
  50. springdoc.api-docs.enabled=false
  51. springdoc.swagger-ui.enabled=false
  52. # springdoc.api-docs.path=/api-docs
  53. # springdoc.swagger-ui.path=/swagger-ui.html
  54. # WebSocket配置
  55. websocket.enabled=true
  56. websocket.path=/ws
  57. websocket.allowedOrigins=*
  58. # PaddleOCR配置
  59. paddleocr.server-url=${PADDLEOCR_SERVER_URL:http://localhost:8866}
  60. paddleocr.timeout=30000
  61. # ==================== DeepSeek模型配置(阿里云百炼平台) ====================
  62. # DeepSeek API密钥(阿里云百炼平台)
  63. bailian.deepseek.api-key=sk-14a0d0b9eda54b3bb6f0e55a7b8df084
  64. # DeepSeek API基础地址(阿里云百炼平台兼容模式)
  65. bailian.deepseek.base-url=https://dashscope.aliyuncs.com/compatible-mode/v1
  66. # DeepSeek模型名称(DeepSeek V3.2实验版)
  67. bailian.deepseek.model-name=deepseek-v3.2-exp
  68. #bailian.deepseek.model-names=qwen-flash,qwen-plus,deepseek-v3.2-exp
  69. #bailian.deepseek.model-names=qwen-flash
  70. bailian.deepseek.rotation-interval=1
  71. # DeepSeek API调用超时时间(秒)
  72. bailian.deepseek.timeout=600
  73. # DeepSeek模型温度参数(控制随机性,0-1)
  74. bailian.deepseek.temperature=0.7
  75. # DeepSeek模型最大生成令牌数
  76. bailian.deepseek.max-tokens=8096
  77. # 是否启用DeepSeek搜索功能
  78. bailian.deepseek.enable-search=false
  79. # DeepSeek API调用最大重试次数
  80. bailian.deepseek.max-retries=3
  81. # ============================================
  82. # RAG 向量化配置
  83. # ============================================
  84. # Ollama 配置
  85. ollama.url=${OLLAMA_URL:http://localhost:11434}
  86. ollama.embedding.model=${OLLAMA_EMBEDDING_MODEL:nomic-embed-text}
  87. ollama.timeout=60000
  88. # RAG 分块配置
  89. rag.chunk.size=1200
  90. rag.chunk.overlap=50
  91. # 向量化批处理配置
  92. rag.embedding.batch-size=10
  93. # RAG 检索配置
  94. rag.search.top-k=3
  95. # RAG 自动索引配置
  96. rag.auto-index.enabled=true
  97. # ============================================
  98. # NER 服务配置
  99. # ============================================
  100. # NER 自动提取配置
  101. ner.auto-extract.enabled=true
  102. # Python NER 服务配置
  103. ner.python-service.url=${NER_SERVICE_URL:http://localhost:8001}
  104. # 超时时间 5 分钟(DeepSeek API 处理长文档需要较长时间)
  105. ner.python-service.timeout=300000
  106. ner.python-service.connect-timeout=5000
  107. ner.python-service.max-retries=3
  108. ner.python-service.retry-interval=1000
  109. # 是否使用异步轮询 API(推荐开启,可实时查看进度)
  110. ner.python-service.use-async=true
  111. # 轮询间隔(毫秒)
  112. ner.python-service.poll-interval=3000
  113. # 最大等待时间(毫秒),10 分钟
  114. ner.python-service.max-wait-time=600000
  115. # NER 实体类型配置
  116. ner.entity-types=PERSON,ORG,LOC,DATE,NUMBER,DEVICE,PROJECT,TERM
  117. # XSS防护配置
  118. xss.enabled=true
  119. xss.excludes=/auth/register,/auth/login
  120. xss.urlPatterns=/documents/*,/parse/*,/ai/*,/graphs/*
  121. # ============================================
  122. # Actuator 配置
  123. # ============================================
  124. management.endpoints.web.exposure.include=health,info,metrics
  125. management.endpoint.health.show-details=always
  126. # 日志配置(覆盖公共配置)
  127. logging.level.root=INFO
  128. logging.level.com.lingyue=INFO
  129. logging.level.org.springframework=WARN
  130. logging.level.org.springframework.web=INFO
  131. logging.level.org.mybatis.spring.SqlSessionUtils=INFO
  132. logging.level.org.mybatis.spring=INFO
  133. logging.level.org.springframework.jdbc=INFO
  134. logging.level.com.baomidou.mybatisplus=INFO
  135. # Nacos配置(单体应用禁用服务发现)
  136. spring.cloud.nacos.discovery.enabled=false
  137. # 禁用 Feign 和 SpringDoc 自动配置(单体应用不需要)
  138. spring.cloud.openfeign.enabled=false
  139. spring.autoconfigure.exclude=\
  140. org.springframework.cloud.openfeign.FeignAutoConfiguration,\
  141. org.springdoc.core.configuration.SpringDocConfiguration,\
  142. org.springdoc.webmvc.ui.SwaggerConfig
  143. # ============================================
  144. # 数据库配置(使用标准 HikariCP)
  145. # ============================================
  146. spring.datasource.driver-class-name=org.postgresql.Driver
  147. spring.datasource.url=jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:lingyue_zhibao}
  148. spring.datasource.username=${DB_USERNAME:lingyue}
  149. spring.datasource.password=${DB_PASSWORD:123123}
  150. # HikariCP 连接池配置
  151. spring.datasource.hikari.minimum-idle=5
  152. spring.datasource.hikari.maximum-pool-size=20
  153. spring.datasource.hikari.idle-timeout=30000
  154. spring.datasource.hikari.max-lifetime=1800000
  155. spring.datasource.hikari.connection-timeout=30000
  156. # ============================================
  157. # Redis 配置
  158. # ============================================
  159. spring.data.redis.host=${REDIS_HOST:localhost}
  160. spring.data.redis.port=${REDIS_PORT:6379}
  161. spring.data.redis.password=geek
  162. # ============================================
  163. # RabbitMQ 配置
  164. # ============================================
  165. spring.rabbitmq.host=${RABBITMQ_HOST:localhost}
  166. spring.rabbitmq.port=${RABBITMQ_PORT:5672}
  167. spring.rabbitmq.username=${RABBITMQ_USERNAME:admin}
  168. spring.rabbitmq.password=${RABBITMQ_PASSWORD:admin123}