application.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. server:
  2. port: 8003
  3. spring:
  4. application:
  5. name: parse-service
  6. # 文件上传配置
  7. servlet:
  8. multipart:
  9. enabled: true
  10. max-file-size: 500MB
  11. max-request-size: 500MB
  12. file-size-threshold: 2KB
  13. # 数据库配置(Druid)
  14. datasource:
  15. type: com.alibaba.druid.pool.DruidDataSource
  16. druid:
  17. driver-class-name: org.postgresql.Driver
  18. url: jdbc:postgresql://localhost:5432/lingyue_zhibao
  19. username: ${DB_USERNAME:postgres}
  20. password: ${DB_PASSWORD:postgres}
  21. initial-size: 5
  22. min-idle: 5
  23. max-active: 20
  24. max-wait: 60000
  25. time-between-eviction-runs-millis: 60000
  26. min-evictable-idle-time-millis: 300000
  27. validation-query: SELECT 1
  28. test-while-idle: true
  29. test-on-borrow: false
  30. test-on-return: false
  31. pool-prepared-statements: true
  32. max-pool-prepared-statement-per-connection-size: 20
  33. filters: stat,wall,slf4j
  34. # MyBatis Plus配置
  35. mybatis-plus:
  36. mapper-locations: classpath*:mapper/**/*Mapper.xml
  37. type-aliases-package: com.lingyue.parse.entity
  38. configuration:
  39. map-underscore-to-camel-case: true
  40. log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
  41. global-config:
  42. db-config:
  43. id-type: assign_uuid
  44. # RabbitMQ配置
  45. rabbitmq:
  46. host: ${RABBITMQ_HOST:localhost}
  47. port: ${RABBITMQ_PORT:5672}
  48. username: ${RABBITMQ_USERNAME:guest}
  49. password: ${RABBITMQ_PASSWORD:guest}
  50. # Nacos配置
  51. cloud:
  52. nacos:
  53. discovery:
  54. server-addr: ${NACOS_SERVER_ADDR:localhost:8848}
  55. namespace: public
  56. group: DEFAULT_GROUP
  57. # 文件存储配置
  58. file:
  59. storage:
  60. base-path: ${FILE_STORAGE_BASE_PATH:/data/lingyue/files}
  61. text-path: ${FILE_STORAGE_TEXT_PATH:/data/lingyue/texts}
  62. allowed-extensions: pdf,doc,docx,xls,xlsx,jpg,jpeg,png,gif
  63. # AI服务配置
  64. ai:
  65. service:
  66. url: ${AI_SERVICE_URL:http://localhost:8007}
  67. timeout: 300000
  68. # PaddleOCR配置
  69. paddleocr:
  70. server-url: ${PADDLEOCR_SERVER_URL:http://localhost:8866}
  71. timeout: 30000
  72. # 解析任务配置
  73. parse:
  74. task:
  75. # 是否使用RabbitMQ消息队列(默认false,使用线程池)
  76. use-mq: ${PARSE_TASK_USE_MQ:false}
  77. # 最大重试次数
  78. max-retries: ${PARSE_TASK_MAX_RETRIES:3}
  79. # 重试初始延迟(毫秒)
  80. retry-initial-delay: ${PARSE_TASK_RETRY_INITIAL_DELAY:1000}
  81. # 性能优化配置
  82. performance:
  83. # 大文件阈值(字节),超过此大小使用分块处理
  84. large-file-threshold: ${LARGE_FILE_THRESHOLD:52428800} # 50MB
  85. # 文件块大小(字节)
  86. chunk-size: ${FILE_CHUNK_SIZE:10485760} # 10MB
  87. # 日志配置
  88. logging:
  89. level:
  90. root: INFO
  91. com.lingyue: DEBUG