金币统计-统计
This commit is contained in:
@@ -44,29 +44,4 @@ public class BillTask extends BaseTask {
|
||||
});
|
||||
log.info("retryBillQueue end ...");
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private GiftService giftService;
|
||||
|
||||
/**
|
||||
* 礼物上线定时任务
|
||||
* 每分钟的第1s执行一次
|
||||
*/
|
||||
@Scheduled(cron = "1 */1 * * * ?")
|
||||
public void GiftOnline() {
|
||||
log.info("onLine gift task start");
|
||||
int num = giftService.onLineAllInTimeGift();
|
||||
log.info("onLine gift task end, onLine gift num = {} ", num);
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼物下线定时任务
|
||||
* 每分钟的第1s执行一次
|
||||
*/
|
||||
@Scheduled(cron = "1 */1 * * * ?")
|
||||
public void GiftOffline() {
|
||||
log.info("offLine gift task start");
|
||||
int num = giftService.offLineAllOutTimeGift();
|
||||
log.info("offLine gift task end, offLine gift num = {} ", num);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,32 @@
|
||||
package com.accompany.scheduler.task;
|
||||
|
||||
import com.accompany.business.service.DiamondStatService;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
import com.accompany.scheduler.base.BaseTask;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class DiamondStatTask extends BaseTask {
|
||||
|
||||
@Autowired
|
||||
private DiamondStatService service;
|
||||
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
public void statEn() {
|
||||
List<Integer> partitionIds = List.of(PartitionEnum.ENGLISH.getId(), PartitionEnum.CHINESS.getId());
|
||||
service.stat(partitionIds);
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0 5 * * ?")
|
||||
public void statAr() {
|
||||
List<Integer> partitionIds = List.of(PartitionEnum.ARAB.getId(), PartitionEnum.TURKEY.getId());
|
||||
service.stat(partitionIds);
|
||||
}
|
||||
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
package com.accompany.scheduler.config;
|
||||
|
||||
import com.accompany.mq.producer.MQMessageProducer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author: liaozetao
|
||||
* @date: 2023/12/13 11:10
|
||||
* @description:
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@ConditionalOnClass(value = RocketMQTemplate.class)
|
||||
public class RocketMQConfiguration {
|
||||
|
||||
@Bean
|
||||
public MQMessageProducer mqMessageProducer(RocketMQTemplate rocketMQTemplate) {
|
||||
return new MQMessageProducer(rocketMQTemplate);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user