Browse Source

配置中心,mysql版本

wj 5 years ago
commit
d07fd17609

+ 58 - 0
pom.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>fframwork</artifactId>
+        <groupId>com.tofly</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>tofly-config</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <!--配置中心-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-config-server</artifactId>
+        </dependency>
+        <!--web 模块-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <!--排除tomcat依赖-->
+                <exclusion>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                    <groupId>org.springframework.boot</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!--undertow容器-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-undertow</artifactId>
+        </dependency>
+
+    </dependencies>
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 18 - 0
src/main/java/com/tofly/config/ConfigApplication.java

@@ -0,0 +1,18 @@
+package com.tofly.config;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.cloud.client.SpringCloudApplication;
+import org.springframework.cloud.config.server.EnableConfigServer;
+
+/**
+ * @author Administrator
+ * @date 2019/8/30  14:49
+ */
+
+@EnableConfigServer
+@SpringCloudApplication
+public class ConfigApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(ConfigApplication.class,args);
+    }
+}

+ 32 - 0
src/main/java/com/tofly/config/controller/EncryptController.java

@@ -0,0 +1,32 @@
+package com.tofly.config.controller;
+
+import org.jasypt.encryption.StringEncryptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author Administrator
+ * @date 2019/9/10  14:44
+ */
+@RestController
+public class EncryptController {
+
+    @Autowired
+    private StringEncryptor stringEncryptor;
+
+    @Value("${spring.cloud.config.server.native.search-locations}")
+    private String path;
+
+    @RequestMapping("/encrypt")
+    public String encrypt(String word){
+        return stringEncryptor.encrypt(word);
+    }
+
+    @GetMapping("/test")
+    public String test(){
+        return path;
+    }
+}

+ 32 - 0
src/main/resources/bootstrap.yml

@@ -0,0 +1,32 @@
+server:
+  port: 8888
+
+spring:
+  application:
+    name: tofly-config
+  profiles:
+    active: native
+  # 配置中心
+  cloud:
+    config:
+      server:
+        native:
+#          search-locations: classpath:/config/
+          search-locations: ${CONFIG_PATH:classpath:/config/mysql/}
+
+# 注册中心配置
+eureka:
+  instance:
+    prefer-ip-address: true
+  client:
+    service-url:
+      defaultZone: http://tofly-eureka:${EUREKAPORT:9999}/eureka/
+
+# 暴露监控端点
+management:
+  endpoints:
+    web:
+      exposure:
+        include: '*'
+
+

+ 124 - 0
src/main/resources/config/mysql/application-dev.yml

@@ -0,0 +1,124 @@
+# 加解密根密码
+jasypt:
+  encryptor:
+    password: tofly #根密码
+
+# Spring 相关
+spring:
+  redis:
+    password:
+    host: tofly-redis
+    jedis:
+      pool:
+        max-idle: 30
+        min-idle: 10
+        max-active: 20
+        max-wait: 10000
+  # zipkin
+  zipkin:
+    enabled: true
+    base-url: http://127.0.0.1:6002
+  sleuth:
+    web:
+      client:
+        enabled: true
+    sampler:
+      # 默认的采样比率为0.1,不能看到所有请求数据
+      # 更改采样比率为1,就能看到所有的请求数据了,但是这样会增加接口调用延迟
+      probability: 1.0
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 100MB
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
+#  boot:
+#    admin:
+#      client:
+#        url: http://127.0.0.1:6001
+
+# 暴露监控端点
+management:
+  endpoints:
+    web:
+      exposure:
+        include: '*'
+
+# feign 配置
+feign:
+  hystrix:
+    enabled: true
+  okhttp:
+    enabled: true
+  httpclient:
+    enabled: false
+  client:
+    config:
+      default:
+        connectTimeout: 10000
+        readTimeout: 10000
+  compression:
+    request:
+      enabled: true
+    response:
+      enabled: true
+
+# hystrix 配置
+hystrix:
+  command:
+    default:
+      execution:
+        isolation:
+          strategy: SEMAPHORE
+          thread:
+            timeoutInMilliseconds: 60000
+  shareSecurityContext: true
+
+#请求处理的超时时间
+ribbon:
+  ReadTimeout: 10000
+  ConnectTimeout: 10000
+
+# mybaits-plus配置
+
+mybatis-plus:
+  type-aliases-package: com.tofly.*.entity,com.tofly.*.custom.entity
+  mapper-locations: classpath*:/mapper/*Mapper.xml,classpath*:/customMapper/*Mapper.xml
+  global-config:
+    banner: false
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: 1
+      field-strategy: 1
+      table-underline: true
+      logic-delete-value: 0 #逻辑已删除
+      logic-not-delete-value: 1   #逻辑未删除 (加上@TableLogic后,相当于存在判断条件 column= 1 )
+      db-type: oracle
+  configuration:
+    map-underscore-to-camel-case: true
+    call-setters-on-nulls: true
+    jdbc-type-for-null: null
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+
+  #spring security 配置
+security:
+  oauth2:
+    resource:
+      loadBalanced: true
+      token-info-uri: http://tofly-auth/oauth/check_token
+
+ftp:
+  enable: true
+  server: tofly-ftp
+  port: 8033
+  userName: ENC(tjdOntnkeceeo/aiTdGifA==)
+  password: ENC(tjdOntnkeceeo/aiTdGifA==)
+
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    metadata-map:
+      startup: ${random.int}    #needed to trigger info and endpoint update after restart

+ 39 - 0
src/main/resources/config/mysql/tofly-auth-dev.yml

@@ -0,0 +1,39 @@
+security:
+  oauth2:
+    client:
+      client-id: ENC(uRVGfvAwW6FVQJm/GC7v0A==)  #tofly
+      client-secret: ENC(w5AYCtwwgd+zVwGc5AudCw==)
+      scope: server
+
+# 数据源
+spring:
+  datasource:
+    url: jdbc:mysql://tofly-db/tf_myws_sms?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
+    driver-class-name: com.mysql.jdbc.Driver
+    username: root
+    password: tofly028
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      initial-size: 10
+      min-idle: 1
+      max-active: 100
+      max-wait: 60000
+      time-between-eviction-runsMillis: 60000
+      min-evictable-idle-timeMillis: 300000
+      validation-query: select 1
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      pool-prepared-statements: true
+      max-open-prepared-statements: 20
+      max-pool-prepared-statement-per-connection-size: 20
+      filters:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 5000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+      #      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      use-global-data-source-stat: true

+ 55 - 0
src/main/resources/config/mysql/tofly-base-dev.yml

@@ -0,0 +1,55 @@
+security:
+  oauth2:
+    client:
+      client-id: ENC(uRVGfvAwW6FVQJm/GC7v0A==)  #tofly
+      client-secret: ENC(w5AYCtwwgd+zVwGc5AudCw==)
+      scope: server
+
+# 数据源
+spring:
+  datasource:
+    url: jdbc:mysql://tofly-db/tf_myws_sms?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
+    driver-class-name: com.mysql.jdbc.Driver
+    username: root
+    password: tofly028
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      initial-size: 10
+      min-idle: 1
+      max-active: 100
+      max-wait: 60000
+      time-between-eviction-runsMillis: 60000
+      min-evictable-idle-timeMillis: 300000
+      validation-query: select 1
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      pool-prepared-statements: true
+      max-open-prepared-statements: 20
+      max-pool-prepared-statement-per-connection-size: 20
+      filters:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 5000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+#      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      use-global-data-source-stat: true
+
+
+
+tofly-filter:
+  urls:
+    - /user/info/**
+    - /applog**
+    - /v2/api-docs
+    - /getAsciiDocs**
+    - /getMarkdownDocs**
+    - /log/add*
+    - /swagger2word/**
+    - /actuator/**
+    - /ftpfiles/saveBatch
+
+

+ 48 - 0
src/main/resources/config/mysql/tofly-flowable-dev.yml

@@ -0,0 +1,48 @@
+security:
+  oauth2:
+    client:
+      client-id: ENC(uRVGfvAwW6FVQJm/GC7v0A==)  #tofly
+      client-secret: ENC(w5AYCtwwgd+zVwGc5AudCw==)
+      scope: server
+
+
+
+
+# 数据源
+spring:
+  datasource:
+    url: jdbc:oracle:thin:@tofly-db:1521/orcl
+    driver-class-name: oracle.jdbc.OracleDriver
+#    driver-class-name: oracle.jdbc.driver.OracleDriver
+    username: tf_dyrq_war
+    password: tf_dyrq_war
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      initial-size: 10
+      min-idle: 1
+      max-active: 100
+      max-wait: 60000
+      time-between-eviction-runsMillis: 60000
+      min-evictable-idle-timeMillis: 300000
+      validation-query: select 1 FROM DUAL
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      pool-prepared-statements: true
+      max-open-prepared-statements: 20
+      max-pool-prepared-statement-per-connection-size: 20
+      filters:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 5000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+      #      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      use-global-data-source-stat: true
+
+
+
+
+

+ 61 - 0
src/main/resources/config/mysql/tofly-getway-dev.yml

@@ -0,0 +1,61 @@
+spring:
+  #拦截规则
+  cloud:
+    gateway:
+      routes:
+        - id: appdemo
+          uri: lb://appdemo
+          predicates:
+            - Path=/appdemo/**
+#          filters:
+#            - SwaggerHeaderFilter
+#          filters:
+#            - StripPrefix=1
+              # 认证中心
+        - id: tofly-auth
+          uri: lb://tofly-auth
+          predicates:
+            - Path=/auth/**
+          filters:
+            - LoginParamFilter
+              #基本信息
+        - id: tofly-base
+          uri: lb://tofly-base
+          predicates:
+            - Path=/base/**
+          #西南科大业务应用
+        - id: tofly-xnkd
+          uri: lb://tofly-xnkd
+          predicates:
+            - Path=/xnkd/**
+          #西南科大业务应用
+        - id: tofly-flowable
+          uri: lb://tofly-flowable
+          predicates:
+            - Path=/flowable/**
+          #德阳燃气业务应用
+        - id: tofly-dyrq
+          uri: lb://tofly-dyrq
+          predicates:
+            - Path=/dyrq/**
+#          filters:
+#            - SwaggerHeaderFilter
+          #用户测试
+          # 重点!info必须使用http进行转发,lb代表从注册中心获取服务
+          #uri: lb://testuser
+          #predicates:
+          #- path=/userapi/**
+          # http://localhost:8001/userapi/user/users/2, 必须加上StripPrefix=1,否则访问服务时会带上userapi
+          #而不是我们期望的去掉userapi,只保留**部分
+          #filters:
+          #- StripPrefix=1
+  #跨域
+      globalcors:
+        corsConfigurations:
+          '[/**]':
+            allowCredentials: true
+            exposedHeaders: "Content-Disposition,Content-Type,Cache-Control"
+            allowedHeaders: "*"
+            allowedOrigins: "*"
+            allowedMethods: "*"
+

+ 1 - 0
src/main/resources/config/mysql/tofly-monitor-dev.yml

@@ -0,0 +1 @@
+

+ 124 - 0
src/main/resources/config/oracle/application-dev.yml

@@ -0,0 +1,124 @@
+# 加解密根密码
+jasypt:
+  encryptor:
+    password: tofly #根密码
+
+# Spring 相关
+spring:
+  redis:
+    password:
+    host: tofly-redis
+    jedis:
+      pool:
+        max-idle: 30
+        min-idle: 10
+        max-active: 20
+        max-wait: 10000
+  # zipkin
+  zipkin:
+    enabled: true
+    base-url: http://127.0.0.1:6002
+  sleuth:
+    web:
+      client:
+        enabled: true
+    sampler:
+      # 默认的采样比率为0.1,不能看到所有请求数据
+      # 更改采样比率为1,就能看到所有的请求数据了,但是这样会增加接口调用延迟
+      probability: 1.0
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 100MB
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
+#  boot:
+#    admin:
+#      client:
+#        url: http://127.0.0.1:6001
+
+# 暴露监控端点
+management:
+  endpoints:
+    web:
+      exposure:
+        include: '*'
+
+# feign 配置
+feign:
+  hystrix:
+    enabled: true
+  okhttp:
+    enabled: true
+  httpclient:
+    enabled: false
+  client:
+    config:
+      default:
+        connectTimeout: 10000
+        readTimeout: 10000
+  compression:
+    request:
+      enabled: true
+    response:
+      enabled: true
+
+# hystrix 配置
+hystrix:
+  command:
+    default:
+      execution:
+        isolation:
+          strategy: SEMAPHORE
+          thread:
+            timeoutInMilliseconds: 60000
+  shareSecurityContext: true
+
+#请求处理的超时时间
+ribbon:
+  ReadTimeout: 10000
+  ConnectTimeout: 10000
+
+# mybaits-plus配置
+
+mybatis-plus:
+  type-aliases-package: com.tofly.*.entity,com.tofly.*.custom.entity
+  mapper-locations: classpath*:/mapper/*Mapper.xml,classpath*:/customMapper/*Mapper.xml
+  global-config:
+    banner: false
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: 1
+      field-strategy: 1
+      table-underline: true
+      logic-delete-value: 0 #逻辑已删除
+      logic-not-delete-value: 1   #逻辑未删除 (加上@TableLogic后,相当于存在判断条件 column= 1 )
+      db-type: oracle
+  configuration:
+    map-underscore-to-camel-case: true
+    call-setters-on-nulls: true
+    jdbc-type-for-null: null
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+
+  #spring security 配置
+security:
+  oauth2:
+    resource:
+      loadBalanced: true
+      token-info-uri: http://tofly-auth/oauth/check_token
+
+ftp:
+  enable: true
+  server: tofly-ftp
+  port: 8033
+  userName: ENC(tjdOntnkeceeo/aiTdGifA==)
+  password: ENC(tjdOntnkeceeo/aiTdGifA==)
+
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    metadata-map:
+      startup: ${random.int}    #needed to trigger info and endpoint update after restart

+ 39 - 0
src/main/resources/config/oracle/tofly-auth-dev.yml

@@ -0,0 +1,39 @@
+security:
+  oauth2:
+    client:
+      client-id: ENC(uRVGfvAwW6FVQJm/GC7v0A==)  #tofly
+      client-secret: ENC(w5AYCtwwgd+zVwGc5AudCw==)
+      scope: server
+
+spring:
+  datasource:
+    url: jdbc:oracle:thin:@tofly-db:1521/orcl
+    driver-class-name: oracle.jdbc.OracleDriver
+    #    driver-class-name: oracle.jdbc.driver.OracleDriver
+    username: tf_dyrq_sms
+    password: tf_dyrq_sms
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      initial-size: 10
+      min-idle: 1
+      max-active: 100
+      max-wait: 60000
+      time-between-eviction-runsMillis: 60000
+      min-evictable-idle-timeMillis: 300000
+      validation-query: select 1 FROM DUAL
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      pool-prepared-statements: true
+      max-open-prepared-statements: 20
+      max-pool-prepared-statement-per-connection-size: 20
+      filters:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 5000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+      #      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      use-global-data-source-stat: true

+ 56 - 0
src/main/resources/config/oracle/tofly-base-dev.yml

@@ -0,0 +1,56 @@
+security:
+  oauth2:
+    client:
+      client-id: ENC(uRVGfvAwW6FVQJm/GC7v0A==)  #tofly
+      client-secret: ENC(w5AYCtwwgd+zVwGc5AudCw==)
+      scope: server
+
+# 数据源
+spring:
+  datasource:
+    url: jdbc:oracle:thin:@tofly-db:1521/orcl
+    driver-class-name: oracle.jdbc.OracleDriver
+#    driver-class-name: oracle.jdbc.driver.OracleDriver
+    username: tf_dyrq_sms
+    password: tf_dyrq_sms
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      initial-size: 10
+      min-idle: 1
+      max-active: 100
+      max-wait: 60000
+      time-between-eviction-runsMillis: 60000
+      min-evictable-idle-timeMillis: 300000
+      validation-query: select 1 FROM DUAL
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      pool-prepared-statements: true
+      max-open-prepared-statements: 20
+      max-pool-prepared-statement-per-connection-size: 20
+      filters:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 5000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+#      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      use-global-data-source-stat: true
+
+
+
+tofly-filter:
+  urls:
+    - /user/info/**
+    - /applog**
+    - /v2/api-docs
+    - /getAsciiDocs**
+    - /getMarkdownDocs**
+    - /log/add*
+    - /swagger2word/**
+    - /actuator/**
+    - /ftpfiles/saveBatch
+
+

+ 54 - 0
src/main/resources/config/oracle/tofly-dyrq-dev.yml

@@ -0,0 +1,54 @@
+security:
+  oauth2:
+    client:
+      client-id: ENC(uRVGfvAwW6FVQJm/GC7v0A==)  #tofly
+      client-secret: ENC(w5AYCtwwgd+zVwGc5AudCw==)
+      scope: server
+
+
+
+
+# 数据源
+spring:
+  datasource:
+    url: jdbc:oracle:thin:@tofly-db:1521/orcl
+    driver-class-name: oracle.jdbc.OracleDriver
+#    driver-class-name: oracle.jdbc.driver.OracleDriver
+    username: tf_dyrq
+    password: tf_dyrq
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      initial-size: 10
+      min-idle: 1
+      max-active: 100
+      max-wait: 60000
+      time-between-eviction-runsMillis: 60000
+      min-evictable-idle-timeMillis: 300000
+      validation-query: select 1 FROM DUAL
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      pool-prepared-statements: true
+      max-open-prepared-statements: 20
+      max-pool-prepared-statement-per-connection-size: 20
+      filters:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 5000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+      #      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      use-global-data-source-stat: true
+
+
+tofly-filter:
+  urls:
+    - /v2/api-docs
+    - /load*
+    - /getAsciiDocs**
+    - /getMarkdownDocs**
+    - /actuator/**
+
+

+ 48 - 0
src/main/resources/config/oracle/tofly-flowable-dev.yml

@@ -0,0 +1,48 @@
+security:
+  oauth2:
+    client:
+      client-id: ENC(uRVGfvAwW6FVQJm/GC7v0A==)  #tofly
+      client-secret: ENC(w5AYCtwwgd+zVwGc5AudCw==)
+      scope: server
+
+
+
+
+# 数据源
+spring:
+  datasource:
+    url: jdbc:oracle:thin:@tofly-db:1521/orcl
+    driver-class-name: oracle.jdbc.OracleDriver
+#    driver-class-name: oracle.jdbc.driver.OracleDriver
+    username: tf_dyrq_war
+    password: tf_dyrq_war
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      initial-size: 10
+      min-idle: 1
+      max-active: 100
+      max-wait: 60000
+      time-between-eviction-runsMillis: 60000
+      min-evictable-idle-timeMillis: 300000
+      validation-query: select 1 FROM DUAL
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      pool-prepared-statements: true
+      max-open-prepared-statements: 20
+      max-pool-prepared-statement-per-connection-size: 20
+      filters:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 5000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+      #      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      use-global-data-source-stat: true
+
+
+
+
+

+ 61 - 0
src/main/resources/config/oracle/tofly-getway-dev.yml

@@ -0,0 +1,61 @@
+spring:
+  #拦截规则
+  cloud:
+    gateway:
+      routes:
+        - id: appdemo
+          uri: lb://appdemo
+          predicates:
+            - Path=/appdemo/**
+#          filters:
+#            - SwaggerHeaderFilter
+#          filters:
+#            - StripPrefix=1
+              # 认证中心
+        - id: tofly-auth
+          uri: lb://tofly-auth
+          predicates:
+            - Path=/auth/**
+          filters:
+            - LoginParamFilter
+              #基本信息
+        - id: tofly-base
+          uri: lb://tofly-base
+          predicates:
+            - Path=/base/**
+          #西南科大业务应用
+        - id: tofly-xnkd
+          uri: lb://tofly-xnkd
+          predicates:
+            - Path=/xnkd/**
+          #西南科大业务应用
+        - id: tofly-flowable
+          uri: lb://tofly-flowable
+          predicates:
+            - Path=/flowable/**
+          #德阳燃气业务应用
+        - id: tofly-dyrq
+          uri: lb://tofly-dyrq
+          predicates:
+            - Path=/dyrq/**
+#          filters:
+#            - SwaggerHeaderFilter
+          #用户测试
+          # 重点!info必须使用http进行转发,lb代表从注册中心获取服务
+          #uri: lb://testuser
+          #predicates:
+          #- path=/userapi/**
+          # http://localhost:8001/userapi/user/users/2, 必须加上StripPrefix=1,否则访问服务时会带上userapi
+          #而不是我们期望的去掉userapi,只保留**部分
+          #filters:
+          #- StripPrefix=1
+  #跨域
+      globalcors:
+        corsConfigurations:
+          '[/**]':
+            allowCredentials: true
+            exposedHeaders: "Content-Disposition,Content-Type,Cache-Control"
+            allowedHeaders: "*"
+            allowedOrigins: "*"
+            allowedMethods: "*"
+

+ 1 - 0
src/main/resources/config/oracle/tofly-monitor-dev.yml

@@ -0,0 +1 @@
+

+ 54 - 0
src/main/resources/config/oracle/tofly-xnkd-dev.yml

@@ -0,0 +1,54 @@
+security:
+  oauth2:
+    client:
+      client-id: ENC(uRVGfvAwW6FVQJm/GC7v0A==)  #tofly
+      client-secret: ENC(w5AYCtwwgd+zVwGc5AudCw==)
+      scope: server
+
+
+
+
+# 数据源
+spring:
+  datasource:
+    url: jdbc:oracle:thin:@tofly-db:1521/orcl
+    driver-class-name: oracle.jdbc.OracleDriver
+#    driver-class-name: oracle.jdbc.driver.OracleDriver
+    username: ENC(WBFkp9ghIuzp3jp9z5IT4w==)
+    password: ENC(WBFkp9ghIuzp3jp9z5IT4w==)
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      initial-size: 10
+      min-idle: 1
+      max-active: 100
+      max-wait: 60000
+      time-between-eviction-runsMillis: 60000
+      min-evictable-idle-timeMillis: 300000
+      validation-query: select 1 FROM DUAL
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+      pool-prepared-statements: true
+      max-open-prepared-statements: 20
+      max-pool-prepared-statement-per-connection-size: 20
+      filters:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 5000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+      #      connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      use-global-data-source-stat: true
+
+
+tofly-filter:
+  urls:
+    - /v2/api-docs
+    - /load*
+    - /getAsciiDocs**
+    - /getMarkdownDocs**
+    - /actuator/**
+
+

+ 2 - 0
tofly-config.iml

@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="false" type="JAVA_MODULE" version="4" />

+ 2 - 0
toflyconfig-8888.iml

@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4" />