############说明：本配置文件通常情况下应该放到配置中心####################

## spring security 配置
security:
  oauth2:
    client:
      client-id: contract_app
      client-secret: contract_app
      scope: server
    resource:
      token-info-uri: http://scm.direwolf-auth/oauth/check_token

# redis 相关
spring:
  servlet:
    multipart:
      max-file-size: 10MB
      max-request-size: 10MB
  redis:
    database: 4
#    host: ${REDIS_URL:127.0.0.1}
#    port: ${REDIS_PORT:6379}
#    password: root
    host: ${REDIS_URL:192.168.1.12}
    port: ${REDIS_PORT:31093}
    password: wLaRLp17a#u3qeiC
  # Jackson配置
  jackson:
    time-zone: GMT+8
    date-format: yyyy-MM-dd HH:mm:ss
  rabbitmq:
#    host: ${RABBITMQ_URL:127.0.0.1}
    host: ${RABBITMQ_URL:192.168.1.3}
    port: ${RABBITMQ_PORT:5672}
    username: ${RABBITMQ_USER:admin}
    password: ${RABBITMQ_PASS:admin}
#mybatis数据源
  datasource:
#    scm:
#      type: com.zaxxer.hikari.HikariDataSource
#      driver-class-name: ${DB_DRIVER_CLASS:com.mysql.jdbc.Driver}
#      username: ${DB_USER:root}
#      password: ${DB_PASS:root}
##      url: ${JDBC_URL:jdbc:oracle:thin:@10.131.216.3:1521:OMIS}
#      url: ${JDBC_URL:jdbc:mysql://${MYSQL_URL:localhost}:${MYSQL_PORT:3306}/${DB_SID:direwolf_express}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&serverTimezone=UTC}
#      hikari:
#        maximum-pool-size: ${HIKARI_MAX_POOL:10}
#        max-lifetime: ${HIKARI_MAX_LIFE:600000}
#        minimum-idle: ${HIKARI_MIN_IDLE:5}
#        idle-timeout: ${HIKARI_IDLE_TIMEOUT:300000}
#        connection-timeout: ${HIKARI_CONN_TIMEOUT:45000}
#        connection-test-query: ${HIKARI_TEST_QUERY:select 1}
#        validation-timeout: ${HIKARI_VALIDATE_TIMEOUT:30000}
#        pool-name: contract-hikari-pool
    wzht:
      type: com.zaxxer.hikari.HikariDataSource
      driver-class-name: ${DB_DRIVER_CLASS:com.mysql.jdbc.Driver}
      username: ${DB_USER1:root}
      password: ${DB_PASS1:thispassw0rD@mysq1}
#      url: ${JDBC_URL1:jdbc:oracle:thin:@10.131.216.3:1521:NEOSSMS}
#      url: ${JDBC_URL:jdbc:mysql://${MYSQL_URL:shw.themoretech.com}:${MYSQL_PORT:31099}/${DB_SID:rfid}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&serverTimezone=UTC}
      url: ${JDBC_URL:jdbc:mysql://${MYSQL_URL:192.168.1.12}:${MYSQL_PORT:31099}/${DB_SID:rfid}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&serverTimezone=UTC}
      hikari:
        maximum-pool-size: ${HIKARI_MAX_POOL:10}
        max-lifetime: ${HIKARI_MAX_LIFE:600000}
        minimum-idle: ${HIKARI_MIN_IDLE:5}
        idle-timeout: ${HIKARI_IDLE_TIMEOUT:300000}
        connection-timeout: ${HIKARI_CONN_TIMEOUT:45000}
        connection-test-query: ${HIKARI_TEST_QUERY:select 1}
        validation-timeout: ${HIKARI_VALIDATE_TIMEOUT:30000}
        pool-name: contract-hikari-pool




  #spring-session-redis配置
  session:
    store-type: redis
  cloud:
    bus:
      trace:
        enabled: true

# 暴露监控端点
management:
  endpoints:
    web:
      exposure:
        include: 'info,health,deregister'
      cors:
        allowed-origins: "*"
        allowed-methods: "*"
  endpoint:
    health:
      show-details: always

# feign 配置
feign:
  hystrix:
    enabled: true
  okhttp:
    enabled: false
  httpclient:
    enabled: true
  client:
    config:
      default:
        connectTimeout: 180000
        readTimeout: 180000
        loggerLevel: basic
  compression:
    request:
      enabled: true
    response:
      enabled: true
# hystrix If you need to use ThreadLocal bound variables in your RequestInterceptor`s
# you will need to either set the thread isolation strategy for Hystrix to `SEMAPHORE or disable Hystrix in Feign.
hystrix:
  command:
    default:
      execution:
        isolation:
          strategy: SEMAPHORE
          thread:
            timeoutInMilliseconds: 120000
          semaphore:
            maxConcurrentRequests: 200
        timeout:
          enabled: true
      fallback:
        enabled: true
        isolation:
          semaphore:
            maxConcurrentRequests: 200 #default 10
      circuitBreaker:
        enabled: true
        requestVolumeThreshold: 200 #default 10
  shareSecurityContext: true
  threadpool:
    default:
      coreSize: 100 #default 10
      maxQueueSize: -1 #default -1,SynchronousQueue

#请求处理的超时时间
ribbon:
  ReadTimeout: 240000
  ConnectTimeout: 240000
  OkToRetryOnAllOperations: true #对所有请求都进行重试
  MaxAutoRetriesNextServer: 2 #切换实例的重试次数
  MaxAutoRetries: 1 #对当前实例的重试次数


#mybaits配置，修改主键类型，mapper.xml、type 别名等
mybatis:
  config1:
    mapper-locations:
      - "classpath:/mapper/*Mapper.xml"
      - "classpath:/mapper/**/*Dao.xml"
    type-aliases-package: com.set.direwolf.sys.mapper,com.set.direwolf.sys.dao,com.set.direwolf.gateway.dao,com.set.direwolf.codegen.persist,com.set.direwolf.platman.dao,com.scm.contract.user.dao
    configuration:
      jdbc-type-for-null: 'null'
      map-underscore-to-camel-case: true
      cache-enabled: true
      ds-name: ${DS_NAME:dataSource}
      ds-type: ${DS_TYPE:MySQL}
  config2:
    mapper-locations:
      - "classpath:/mapper/modules/contract/**/*Dao.xml"
    type-aliases-package: com.scm.contract.dao.**
    configuration:
      jdbc-type-for-null: 'null'
      map-underscore-to-camel-case: true
      cache-enabled: true
      ds-name: ${DS_NAME:dataSource}
      ds-type: ${DS_TYPE:MySQL}


#swagger公共信息
swagger:
  title: PlatformX Swagger API
  description: Spring Cloud微服务开发脚手架
  version: 1.7.0
  license: Powered By PlatformX
  licenseUrl: https://cloud.com/
  terms-of-service-url: https://cloud.com/
  contact:
    name: Shinenergy
    email: Shinenergy@gmail.com
    url: https://cloud.com/about.html
  authorization:
    name: PlatformX OAuth
    auth-regex: ^.*$
    authorization-scope-list:
      - scope: server
        description: server all
    token-url-list:
      - http://direwolf-gateway:9999/auth/oauth/token

# log配置
logging:
  level:
    root: info
    com.set.direwolf: info
    #com.scm.contract.dao: debug


server:
  undertow:
    io-threads: 32
    worker-threads: 256
  port: 7003
  servlet:
    context-path: /


#cxf:
#  path: /ws/services



adminPath: /api
frontPath: /f
direwolf:
  app:
    appid: 1
    appname: Direwolf
    appver: V1.0.0
    appdesc: 平台框架初始版本
    mainpage: home
    homepattern:
  web:
    service-url: http://localhost:7003/contract_vue
    logout-url: /login
    static:
      url: /contract_vue/static
    frontpath: /f
    view:
      index: /a
    session:
      id: sid
  mail:
    host: mail.shineenergy.com
    port: 25
    username:
    password:
    sendfrom:
    sendnick:
  jwt:
    key: direwolf
    expire: 600
    domain: '*'


    # 直接放行URL
ignore:
  urls:
    - /contract-app/**
    - /ws/services/**
    - /f/materialConteact/**
    - /actuator/**
    - /log/**
    - /v2/api-docs
    - /swagger-ui.html
    - /webjars/**
    - /swagger-resources/**
    - /api/**

is:
 client:
  type: ${IS_CLIENT_TYPE:http}

ps:
  smecp_com:
    service_name1: ${SERVICE_NAME1:CM_SynSGCCDataReq_MIService}
    ip1:  ${IP1:http://10.131.170.135:50100}
    username1:  ${USERNAME1:temp}
    password1:  ${PASSWORD1:xi123456}

    service_name2: ${SERVICE_NAME2:ContractSubsidiarySysReq_MIService}
    ip2:  ${IP2:http://10.131.170.135:50100}
    username2:  ${USERNAME2:temp}
    password2:  ${PASSWORD2:xi123456}

    service_name3: ${SERVICE_NAME3:SyncCght2054InfoService}
    ip3:  ${IP3:http://10.131.59.164:17005}

mybatis-plus:
  mapper-locations: classpath*:mapper/**/*.xml
  global-config:
    db-config:
      # 更新策略，null更新问题
      update-strategy: default
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
