Administrator
10 days ago 34212a418d7b6c757ec2abce18612df674e84fad
chore(config): 更新测试环境配置并添加新依赖

- 将 spring.profiles.active 从 dev 改为 test
- 修改数据库连接端口从 3306 到 3406
- 更新 Redis 配置:数据库索引、主机地址、端口和密码
- 调整 Redis 连接池参数:min-idle、max-idle、max-active 和 max-wait
- 禁用多个定时任务开关(kline-update-job、newest-price-update-job 等)
- 添加 okhttp3、web3j、json 等新依赖项
- 引入 Java-WebSocket 和 commons-pool2 依赖库
- 添加 junit 测试依赖和 httpmime 组件支持
4 files modified
171 ■■■■■ changed files
pom.xml 57 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/utils/CoinTypeConvert.java 9 ●●●●● patch | view | raw | blame | history
src/main/resources/application-test.yml 60 ●●●● patch | view | raw | blame | history
src/main/resources/application.yml 45 ●●●● patch | view | raw | blame | history
pom.xml
@@ -45,6 +45,47 @@
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20230618</version>
        </dependency>
        <dependency>
            <groupId>org.web3j</groupId>
            <artifactId>core</artifactId>
            <version>4.5.5</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <!--            <version>3.6.0</version>-->
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/logging-interceptor -->
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>logging-interceptor</artifactId>
            <version>3.6.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.web3j/parity -->
        <dependency>
            <groupId>org.web3j</groupId>
            <artifactId>parity</artifactId>
            <version>4.5.10</version>
            <exclusions>
                <exclusion>
                    <artifactId>core</artifactId>
                    <groupId>org.web3j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>taobao</groupId>
            <artifactId>taobao-sdk</artifactId>
            <version>1.0.0-SNAPSHOT</version>
@@ -243,6 +284,12 @@
            <scope>system</scope>
            <systemPath>${basedir}/lib/huobi-client-1.0.8-SNAPSHOT.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.java-websocket</groupId>
            <artifactId>Java-WebSocket</artifactId>
            <version>1.5.3</version>
        </dependency>
        <!-- submail邮件 start -->
        <dependency>
@@ -276,6 +323,16 @@
            <artifactId>httpmime</artifactId>
            <version>4.3.5</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>
        <!-- submail邮件 end -->
    </dependencies>
src/main/java/com/xcong/excoin/utils/CoinTypeConvert.java
@@ -27,6 +27,15 @@
        }
    }
    public static String okxConvert(String symbol) {
        //将xxx-USDT转换成xxx/USDT
        if (symbol.contains("-")) {
            symbol = symbol.replace("-", "/");
        }
        return symbol;
    }
    public static String convertToKey(String symbol) {
        switch (symbol) {
            case "BTC/USDT":
src/main/resources/application-test.yml
@@ -5,9 +5,9 @@
spring:
  profiles:
    active: dev
    active: test
  datasource:
    url: jdbc:mysql://120.27.238.55:3306/kss_framework?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
    url: jdbc:mysql://120.27.238.55:3406/db_base?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
    username: ct_test
    password: 123456
    driver-class-name: com.mysql.jdbc.Driver
@@ -47,30 +47,27 @@
    basename: i18n/messages
  ## redis配置
  redis:
    ## Redis数据库索引(默认为0)
    database: 1
    ## Redis服务器地址
    host: 47.114.114.219
    ## Redis服务器连接端口
    port: 6379
    ## Redis服务器连接密码(默认为空)
    password: biyi123
    jedis:
    # Redis数据库索引(默认为 0)
    database: 13
    # Redis服务器地址
    host: 120.27.238.55
    # Redis服务器连接端口
    port: 6479
    # Redis 密码
    password: d3y6dsdl;f.327
    lettuce:
      pool:
        ## 连接池最大连接数(使用负值表示没有限制)
        #spring.redis.pool.max-active=8
        max-active: 300
        ## 连接池最大阻塞等待时间(使用负值表示没有限制)
        #spring.redis.pool.max-wait=-1
        max-wait: -1
        ## 连接池中的最大空闲连接
        #spring.redis.pool.max-idle=8
        max-idle: 100
        ## 连接池中的最小空闲连接
        #spring.redis.pool.min-idle=0
        # 连接池中的最小空闲连接
        min-idle: 8
    ## 连接超时时间(毫秒)
    timeout: 30000
        # 连接池中的最大空闲连接
        max-idle: 500
        # 连接池最大连接数(使用负值表示没有限制)
        max-active: 2000
        # 连接池最大阻塞等待时间(使用负值表示没有限制)
        max-wait: 10000
    # 连接超时时间(毫秒)
    timeout: 500000
  rabbitmq:
    host: 120.27.238.55
    port: 5672
@@ -93,14 +90,17 @@
app:
  debug: false
  redis_expire: 3000
  # k线更新任务控制
  kline-update-job: false
  newest-price-update-job: true
  #最新价任务控制
  newest-price-update-job: false
  #日线 该任务不能与最新价处于同一个服务器
  day-line: true
  other-job: true
  loop-job: true
  rabbit-consumer: true
  block-job: true
  day-line: false
  #其他任务控制
  other-job: false
  loop-job: false
  rabbit-consumer: false
  block-job: false
aliyun:
  oss:
src/main/resources/application.yml
@@ -5,9 +5,9 @@
spring:
  profiles:
    active: dev
    active: test
  datasource:
    url: jdbc:mysql://120.27.238.55:3306/db_base?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
    url: jdbc:mysql://120.27.238.55:3406/db_base?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
    username: ct_test
    password: 123456
    driver-class-name: com.mysql.jdbc.Driver
@@ -47,30 +47,27 @@
    basename: i18n/messages
  ## redis配置
  redis:
    ## Redis数据库索引(默认为0)
    database: 2
    ## Redis服务器地址
    host: 47.114.114.219
    ## Redis服务器连接端口
    port: 6379
    ## Redis服务器连接密码(默认为空)
    password: biyi123
    jedis:
    # Redis数据库索引(默认为 0)
    database: 13
    # Redis服务器地址
    host: 120.27.238.55
    # Redis服务器连接端口
    port: 6479
    # Redis 密码
    password: d3y6dsdl;f.327
    lettuce:
      pool:
        ## 连接池最大连接数(使用负值表示没有限制)
        #spring.redis.pool.max-active=8
        max-active: 300
        ## 连接池最大阻塞等待时间(使用负值表示没有限制)
        #spring.redis.pool.max-wait=-1
        max-wait: -1
        ## 连接池中的最大空闲连接
        #spring.redis.pool.max-idle=8
        max-idle: 100
        ## 连接池中的最小空闲连接
        #spring.redis.pool.min-idle=0
        # 连接池中的最小空闲连接
        min-idle: 8
    ## 连接超时时间(毫秒)
    timeout: 30000
        # 连接池中的最大空闲连接
        max-idle: 500
        # 连接池最大连接数(使用负值表示没有限制)
        max-active: 2000
        # 连接池最大阻塞等待时间(使用负值表示没有限制)
        max-wait: 10000
    # 连接超时时间(毫秒)
    timeout: 500000
  rabbitmq:
    host: 120.27.238.55
    port: 5672