#缓存、数据源
spring:
  cache:
    redis:
      time-to-live: 3600
    caffeine:
      spec: initialCapacity=5,maximumSize=500,expireAfterWrite=3600s
  redis:
    host: 127.0.0.1
    port: 6379
    password:
    database: 0
    lettuce:
      pool:
        max-active: 32
        max-wait: 300ms
        max-idle: 16
        min-idle: 8
  servlet:
    multipart:
      max-file-size: 100MB
      max-request-size: 100MB

{{#if (or system.enableMongo system.enableES)}}
  data:  
{{/if}}
{{#if system.enableMongo}}
    mongodb:
      uri: mongodb://admin:admin@127.0.0.1:27017/{{projectName}}
{{/if}}
{{#if system.enableES}}
    elasticsearch:
      cluster-name: es-cluster
      cluster-nodes: 127.0.0.1:9300
      repositories:
        enabled: true
{{/if}}
  datasource:
    username: root
    password: root
    url: jdbc:mysql://127.0.0.1:3306/{{projectName}}?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true&serverTimezone=GMT%2B8
    driver-class-name: com.mysql.jdbc.Driver
    isSyncDBSchema: false
    defaultSchema: {{projectName}}
  {{#if system.enableDS}}
    dynamic:
      druid: #以下是全局默认值，可以全局更改
        filters: stat,log4j2
        #配置初始化大小/最小/最大
        initial-size: 1
        min-idle: 1
        max-active: 20
        #获取连接等待超时时间
        max-wait: 60000
        #间隔多久进行一次检测，检测需要关闭的空闲连接
        time-between-eviction-runs-millis: 60000
        #一个连接在池中最小生存的时间
        min-evictable-idle-time-millis: 300000
        validation-query: SELECT 1 FROM DUAL
        test-while-idle: true
        test-on-borrow: false
        test-on-return: false
        #打开PSCache，并指定每个连接上PSCache的大小。oracle设为true，mysql设为false。分库分表较多推荐设置为false
        pool-prepared-statements: false
        max-pool-prepared-statement-per-connection-size: 20
      datasource:
        master:
          username: ${spring.datasource.username}
          password: ${spring.datasource.password}
          url: ${spring.datasource.url}
          driver-class-name: ${spring.datasource.driver-class-name}
          conf: classpath:liquibase/master.xml
          isSyncDBSchema: ${spring.datasource.isSyncDBSchema}
          defaultSchema: ${spring.datasource.defaultSchema}
        db2:
          username: ${spring.datasource.username}
          password: ${spring.datasource.password}
          url: ${spring.datasource.url}
          driver-class-name: ${spring.datasource.driver-class-name}
          conf: classpath:liquibase/master.xml
          isSyncDBSchema: ${spring.datasource.isSyncDBSchema}
          defaultSchema: ${spring.datasource.defaultSchema}
  {{else}}
    conf: classpath:liquibase/master.xml      
    filters: stat,wall,log4j2
    #配置初始化大小/最小/最大
    initial-size: 1
    min-idle: 1
    max-active: 20
    #获取连接等待超时时间
    max-wait: 60000
    #间隔多久进行一次检测，检测需要关闭的空闲连接
    time-between-eviction-runs-millis: 60000
    #一个连接在池中最小生存的时间
    min-evictable-idle-time-millis: 300000
    validation-query: SELECT 1 FROM DUAL
    test-while-idle: true
    test-on-borrow: false
    test-on-return: false
    #打开PSCache，并指定每个连接上PSCache的大小。oracle设为true，mysql设为false。分库分表较多推荐设置为false
    pool-prepared-statements: false
    max-pool-prepared-statement-per-connection-size: 20
  {{/if}}

#Mybatis-plus配置
mybatis-plus:
  global-config:
    refresh-mapper: true
    db-config:
      # 全局逻辑已删除默认值
      logic-delete-value: 0
      # 全局逻辑未删除默认值
      logic-not-delete-value: 1
  mapper-locations: classpath*:/mapper/*/*/*.xml
  configuration:
    jdbc-type-for-null: 'null'
    map-underscore-to-camel-case: false

#阿里sentinel熔断器
feign:
  httpclient:
    enabled: true
  sentinel:
    enabled: true
  compression:
    request:
      enabled: true
      mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
      min-response-size: 10240
    response:
      enabled: true

{{#if system.enableES}}
management:
  health:
    elasticsearch:
      enabled: false
      
{{/if}} 

{{#if system.enableGlobalTransaction}}
seata:
  enabled: true    #是否开启全局事务
  application-id: {{projectName}}        #服务标识
  tx-service-group: {{projectName}}group #事务组
  service:
    vgroup-mapping:
      {{projectName}}group: default   #指定事务组对应的Tc Server集群
  registry:
    type: nacos   #注册中心
    nacos:
      application: seata-server  #Tc Server服务标识
      server-addr: 127.0.0.1:8848     #注册中心地址
      group: DEFAULT_GROUP       #服务组
      namespace:     #服务命名空间
      userName:      #用户名
      password:      #密码

{{/if}}
{{#if system.enableMQ}}
rocketmq:
  producer:
    namesrvAddr: 127.0.0.1:9876
    isOnOff: 'off'
    groupName: default
    topic: default
  consumer:
    namesrvAddr: 127.0.0.1:9876
    isOnOff: 'off'
    groupName: default
    topic: default

{{/if}}
#Log配置
logging:
  level:
    cn.ibizlab: debug
    {{packageName}}: debug
    org.springframework.boot.autoconfigure: ERROR

#zuul网关超时设置
ribbon:
  ReadTimeout: 60000
  ConnectTimeout: 60000

#系统是否开启权限验证、是否开启缓存
#缓存级别：无缓存(无配置项)、一级缓存(L1)、二级缓存(L2)
ibiz:
  systemid: {{system.codeName}}
  systemname: {{system.logicName}}
  enablePermissionValid: true
  cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存
{{#eq system.saaSMode 4}}
  saas: 
    column: SRFDCID
    sys-tables: ACT_RU_TASK,act_re_procdef,databasechangelog,databasechangeloglock{{#each system.entities as |entity|}}{{#if (and (eq entity.storage "SQL") (entity.saaSMode 0))}},{{entity.tableName}}{{/if}}{{/each}}
{{/eq}}

### jobs
jobs:
  #admin-address: http://127.0.0.1:40005
  app-name: ibznotify
  app-port: 9999
  #app-ip: 127.0.0.1

### 启用Gzip压缩
server:
  compression:
    enabled: true
    mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
    min-response-size: 10240
