package com.xcong.excoin.quartz.job; import com.xcong.excoin.modules.coin.service.BlockCoinService; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; /** * 链上币种同步任务 * * @author wzy * @date 2020-07-02 **/ @Component @ConditionalOnProperty(prefix = "app", name = "block-job", havingValue = "true") public class BlockCoinUpdateJob { @Resource private BlockCoinService blockCoinService; /** * ETH_USDT 同步 */ @Scheduled(cron = "0 0/10 * * * ? ") public void ethUsdtUpdate() { blockCoinService.updateEthUsdt(); } /** * eth 同步 */ @Scheduled(cron = "0 1/20 * * * ? ") public void ethUpdate() { blockCoinService.updateEth(); } /** * BTC_USDT 同步 */ @Scheduled(cron = "0 2/10 * * * ? ") public void btcUsdtUpdate() { blockCoinService.updateBtcUsdt(); } @Scheduled(cron = "0 3/20 * * * ? ") public void btcUpdate() { blockCoinService.updateBtc(); } }