日常任务-公会活动
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.accompany.scheduler.task.dailytask;
|
||||
|
||||
import com.accompany.business.service.guildtask.GuildTaskService;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
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.Date;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class GuildCreateTask {
|
||||
|
||||
@Autowired
|
||||
private GuildTaskService guildTaskService;
|
||||
|
||||
@Scheduled(cron = "0 0/10 * * * ?")
|
||||
public void guildCreateTaskByMinutes() {
|
||||
Date now = new Date();
|
||||
log.info("GuildCreateTaskByMinutes start");
|
||||
PartitionEnum[] values = PartitionEnum.values();
|
||||
for (PartitionEnum partitionEnum : values) {
|
||||
try {
|
||||
guildTaskService.updateTaskCreateProgress(now, partitionEnum);
|
||||
} catch (Exception e) {
|
||||
log.error("GuildCreateTaskByMinutes error:{}" , e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
log.info("GuildCreateTaskByMinutes end");
|
||||
|
||||
log.info("GuildWeekTaskByMinutes start");
|
||||
|
||||
for (PartitionEnum partitionEnum : values) {
|
||||
try {
|
||||
guildTaskService.updateWeekTaskProgress(now, partitionEnum);
|
||||
} catch (Exception e) {
|
||||
log.error("GuildWeekTaskByMinutes error:{}" , e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
log.info("GuildWeekTaskByMinutes end");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user