application.yml 2.19 KB
server:
  port: 8031
  servlet:
    context-path: /power
    session:
      timeout: 24h

#连接数据库的信息
spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/power?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8
    username: root
#    password: Hczd@2025.com
    password: 123456
    type: com.alibaba.druid.pool.DruidDataSource

    #Spring Boot 默认是不注入这些属性值的,需要自己绑定
    #druid 数据源专有配置
    initialSize: 5
    minIdle: 5
    maxActive: 20
    maxWait: 60000
    timeBetweenEvictionRunsMillis: 60000
    minEvictableIdleTimeMillis: 300000
    validationQuery: SELECT 1 FROM DUAL
    testWhileIdle: true
    testOnBorrow: false
    testOnReturn: false
    poolPreparedStatements: true

    #配置监控统计拦截的filters,stat:监控统计、log4j:日志记录、wall:防御sql注入
    #如果允许时报错  java.lang.ClassNotFoundException: org.apache.log4j.Priority
    #则导入 log4j 依赖即可,Maven 地址:https://mvnrepository.com/artifact/log4j/log4j
    filters: stat,wall
    maxPoolPreparedStatementPerConnectionSize: 20
    useGlobalDataSourceStat: true
    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
#禁用模板引擎缓存
  thymeleaf:
    cache: false
  servlet:
    multipart: #修改文件上传的大小限制
      max-request-size: 10MB #允许请求传递文件大小最大为10M
      max-file-size: 10MB  #允许服务器可以处理的最大文件大小
  resources:
    static-locations: classpath:/static/

mybatis:
  #  扫描映射文件
  mapper-locations: classpath:mapper/*.xml
  #  配置别名扫描的包
  type-aliases-package: com.blb.entity
  configuration:
    #   开启驼峰映射配置
    map-underscore-to-camel-case: true

logging:
  level:
    root: info
  file:
    name: ./logs/power.log
power:
  init:
    password: hczd
  user:
    dir: D:/web
  panelUrl: http://101.43.45.142:7788/device/panel
  detailUrl: http://101.43.45.142:7788/device/dWSN7SMWki/status?classify=telemetry
  dateUrl: http://101.43.45.142:7788/device/dWSN7SMWki/property/history
  token: pscsp_magIc_ToKEn_iNTendeD_FOr_IntErnaL_Use_onLy