Helius
2021-05-31 7236be66852b4ac245e9c1ddb2dd3d591fcd3941
modify
8 files modified
1 files added
105 ■■■■■ changed files
src/main/java/com/xcong/excoin/ExcoinApplication.java 9 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/common/listener/RedisKeyExpirationListener.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/LoopExecutorJob.java 19 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/NettyServerStartUp.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/NewestPriceUpdateJob.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/consumer/ChatConsumer.java 2 ●●● patch | view | raw | blame | history
src/main/resources/application-app.yml 15 ●●●● patch | view | raw | blame | history
src/main/resources/application-loop.yml 30 ●●●● patch | view | raw | blame | history
src/main/resources/application.yml 1 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/ExcoinApplication.java
@@ -21,17 +21,10 @@
@EnableAsync
@SpringBootApplication
@MapperScan("com.xcong.excoin.modules.*.dao")
public class ExcoinApplication implements CommandLineRunner {
    @Autowired
    private WebSocketServer webSocketServer;
public class ExcoinApplication {
    public static void main(String[] args) {
        SpringApplication.run(ExcoinApplication.class, args);
    }
    @Override
    public void run(String... args) throws Exception {
        webSocketServer.start();
    }
}
src/main/java/com/xcong/excoin/common/listener/RedisKeyExpirationListener.java
@@ -25,7 +25,7 @@
    public void onMessage(Message message, byte[] pattern) {
        String expireKey = message.toString();
        if (expireKey.equalsIgnoreCase("whole_bomb_execute")) {
            ZzSmsSend.sendVerifyCode("15773002834", "123456", 2);
//            ZzSmsSend.sendVerifyCode("15773002834", "123456", 2);
        }
    }
}
src/main/java/com/xcong/excoin/quartz/job/LoopExecutorJob.java
@@ -46,16 +46,15 @@
    /**
     * 持仓费计算
     */
    @Scheduled(cron = "0 0 0/8 * * ?")
//    @Scheduled(cron = "0 0/5 * * * ?")
    public void updateDoingPrice() {
        log.info("#持仓费计算#");
        try {
            contractHoldOrderService.calHoldFeeAmountForBondAmount();
        } catch (Exception e) {
            log.error("#持仓费计算错误#", e);
        }
    }
//    @Scheduled(cron = "0 0 0/8 * * ?")
//    public void updateDoingPrice() {
//        log.info("#持仓费计算#");
//        try {
//            contractHoldOrderService.calHoldFeeAmountForBondAmount();
//        } catch (Exception e) {
//            log.error("#持仓费计算错误#", e);
//        }
//    }
    /**
     * 币币委托单成交
src/main/java/com/xcong/excoin/quartz/job/NettyServerStartUp.java
New file
@@ -0,0 +1,21 @@
package com.xcong.excoin.quartz.job;
import com.xcong.excoin.netty.server.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
@Component
@ConditionalOnProperty(prefix = "app", name = "websocket-job", havingValue = "true")
public class NettyServerStartUp implements CommandLineRunner {
    @Autowired
    private WebSocketServer webSocketServer;
    @Override
    public void run(String... args) throws Exception {
        webSocketServer.start();
    }
}
src/main/java/com/xcong/excoin/quartz/job/NewestPriceUpdateJob.java
@@ -53,9 +53,9 @@
                // TODO 测试环境关闭这个插入redis
                redisUtils.set(CoinTypeConvert.convertToKey(symbol), price);
                // 比较
                websocketPriceService.comparePriceAsc(symbol, price);
                websocketPriceService.comparePriceDesc(symbol, price);
                websocketPriceService.wholeBomb();
//                websocketPriceService.comparePriceAsc(symbol, price);
//                websocketPriceService.comparePriceDesc(symbol, price);
//                websocketPriceService.wholeBomb();
                //System.out.println("比较完毕:"+symbol+"-"+price);
            }
src/main/java/com/xcong/excoin/rabbit/consumer/ChatConsumer.java
@@ -24,7 +24,7 @@
@Slf4j
@Component
//@ConditionalOnProperty(prefix = "app", name = "rabbit-consumer", havingValue = "true")
@ConditionalOnProperty(prefix = "app", name = "websocekt-job", havingValue = "true")
public class ChatConsumer {
    @Autowired
src/main/resources/application-app.yml
@@ -94,17 +94,16 @@
  debug: false
  redis_expire: 3000
  project: otc
  kline-update-job: true
  newest-price-update-job: true
  kline-update-job: false
  newest-price-update-job: false
  #日线 该任务不能与最新价处于同一个服务器
  day-line: true
  other-job: true
  day-line: false
  other-job: false
  loop-job: false
  rabbit-consumer: false
  block-job: true
  otc-job: true
  system:
    name: otc
  block-job: false
  otc-job: false
  websocket-job: false
aliyun:
  oss:
src/main/resources/application-loop.yml
@@ -7,9 +7,9 @@
  profiles:
    active: loop
  datasource:
    url: jdbc:mysql://192.168.0.151:3306/db_hibit?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
    username: db_hibit
    password: hibit123!@#
    url: jdbc:mysql://127.0.0.1:3306/db_otc?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
    username: yd_otc
    password: yd_otc123!@#
    driver-class-name: com.mysql.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
@@ -50,11 +50,11 @@
    ## Redis数据库索引(默认为0)
    database: 0
    ## Redis服务器地址
    host: 192.168.0.36
    host: 127.0.0.1
    ## Redis服务器连接端口
    port: 6379
    ## Redis服务器连接密码(默认为空)
    password: d32ncxe@i3#!dV
    password: aerefnadlfnwu241
    jedis:
      pool:
        ## 连接池最大连接数(使用负值表示没有限制)
@@ -72,10 +72,10 @@
    ## 连接超时时间(毫秒)
    timeout: 30000
  rabbitmq:
    host: 192.168.0.36
    host: 127.0.0.1
    port: 5672
    username: hibit
    password: hibit123
    username: yunding
    password: yunding123
    publisher-confirm-type: correlated
@@ -93,15 +93,17 @@
app:
  debug: false
  redis_expire: 3000
  kline-update-job: false
  newest-price-update-job: false
  kline-update-job: true
  newest-price-update-job: true
  #日线 该任务不能与最新价处于同一个服务器
  day-line: false
  day-line: true
  other-job: true
  loop-job: true
  rabbit-consumer: true
  loop-job: false
  rabbit-consumer: false
  block-job: true
  otc-job: true
  websocket-job: true
aliyun:
  oss:
    end-point: https://oss-cn-hangzhou.aliyuncs.com
src/main/resources/application.yml
@@ -113,6 +113,7 @@
  rabbit-consumer: false
  block-job: false
  otc-job: false
  websocket-job: false
aliyun:
  oss: