|
|
@@ -1,11 +1,12 @@
|
|
|
package com.xunmei.job.task;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.xunmei.common.core.web.domain.AjaxResult;
|
|
|
import com.xunmei.system.api.RemoteHostService;
|
|
|
-import com.xunmei.system.api.RemoteMediatorService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
@@ -25,4 +26,13 @@ public class HostTask {
|
|
|
AjaxResult result = hostService.getDevices();
|
|
|
log.info("获取所有主机信息结束....,当前任务 id:{},当前时间:{},结果:{}", id, new Date(), JSON.toJSONString(result));
|
|
|
}
|
|
|
+
|
|
|
+ public void deletedRetryMsg() {
|
|
|
+ String id = UUID.fastUUID().toString();
|
|
|
+ final DateTime beginOfDay = DateUtil.beginOfDay(new Date());
|
|
|
+ final DateTime dateTime = DateUtil.offsetDay(beginOfDay, -3);
|
|
|
+ log.info("开始删除三天之前的所有重试消息数据,当前任务 id:{}", id);
|
|
|
+ AjaxResult result = hostService.deletedRetryMsg(DateUtil.format(dateTime, "yyyy-MM-dd"));
|
|
|
+ log.info("删除三天之前的所有重试消息数据任务结束....,当前任务 id:{},结果:{}", id, JSON.toJSONString(result));
|
|
|
+ }
|
|
|
}
|