application-test.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. server:
  2. port: 8080
  3. spring:
  4. application:
  5. name: zhijiayun-pharmacy-test
  6. # 让未找到的路径抛出 NoHandlerFoundException(404)而不是转发到 /error
  7. mvc:
  8. throw-exception-if-no-handler-found: true
  9. web:
  10. resources:
  11. add-mappings: false
  12. # MySQL 数据库
  13. datasource:
  14. url: jdbc:mysql://localhost:3308/zhijiayun_pharmacy1?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true
  15. username: root
  16. password: 123456
  17. driver-class-name: com.mysql.cj.jdbc.Driver
  18. # HikariCP 连接池配置
  19. hikari:
  20. minimum-idle: 2
  21. maximum-pool-size: 10
  22. connection-timeout: 30000
  23. max-lifetime: 600000
  24. idle-timeout: 60000
  25. # 禁用 SQL 初始化(测试用代码建表)
  26. sql:
  27. init:
  28. mode: never
  29. # Redis(测试时实际不使用,但配置防止启动报错)
  30. data:
  31. redis:
  32. host: localhost
  33. port: 6379
  34. # JWT 配置(测试用)
  35. jwt:
  36. secret: TestSuperSecretKeyForJWTTokenGenerationMustBeAtLeast256BitsLong!!
  37. user-expiration: 3600000 # 1小时(毫秒)
  38. admin-expiration: 43200000 # 12小时(毫秒)
  39. expiration: 86400000
  40. refresh-expiration: 604800000
  41. # 阿里云短信(测试不实际发送)
  42. sms:
  43. access-key-id: test_key
  44. access-key-secret: test_secret
  45. sign-name: 测试
  46. template-code: SMS_TEST
  47. code-length: 6
  48. expire-minutes: 5
  49. endpoint: dysmsapi.aliyuncs.com
  50. test-mode: true
  51. test-code: "123456"
  52. # 微信(测试不实际调用)
  53. wechat:
  54. open:
  55. app-id: test_app_id
  56. app-secret: test_app_secret
  57. qr-connect:
  58. redirect-uri: http://localhost/callback
  59. scope: snsapi_login
  60. # MyBatis-Plus
  61. mybatis-plus:
  62. configuration:
  63. map-underscore-to-camel-case: true
  64. global-config:
  65. db-config:
  66. id-type: auto
  67. mapper-locations: classpath*:/mapper/**/*.xml
  68. # 网关配置(测试)
  69. gateway:
  70. logging:
  71. enabled: true
  72. slow-threshold: 500
  73. exclude-paths:
  74. - /actuator/health
  75. rate-limit:
  76. enabled: false
  77. logging:
  78. level:
  79. com.xuekairui: debug
  80. org.springframework.context.support.DefaultLifecycleProcessor: error
  81. # 支付配置(测试环境启用模拟支付)
  82. payment:
  83. mock: true