diff --git a/baogutang-admin/pom.xml b/baogutang-admin/pom.xml
index cce909e..a4aca72 100644
--- a/baogutang-admin/pom.xml
+++ b/baogutang-admin/pom.xml
@@ -112,7 +112,7 @@
com.xuxueli
xxl-job-core
- 2.3.0
+ 2.2.0
diff --git a/baogutang-admin/src/main/java/top/baogutang/admin/schedule/NoticeScheduleHandler.java b/baogutang-admin/src/main/java/top/baogutang/admin/schedule/NoticeScheduleHandler.java
index b61e58f..df55e3c 100644
--- a/baogutang-admin/src/main/java/top/baogutang/admin/schedule/NoticeScheduleHandler.java
+++ b/baogutang-admin/src/main/java/top/baogutang/admin/schedule/NoticeScheduleHandler.java
@@ -2,7 +2,8 @@ package top.baogutang.admin.schedule;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
-import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.IJobHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.cloud.context.config.annotation.RefreshScope;
@@ -29,7 +30,7 @@ import java.util.Objects;
@Slf4j
@Component
@RefreshScope
-public class NoticeScheduleHandler {
+public class NoticeScheduleHandler extends IJobHandler {
@Resource
private DingTalkMsgPushUtils dingTalkMsgPushUtils;
@@ -37,9 +38,8 @@ public class NoticeScheduleHandler {
@Resource
private INoticeLogService noticeLogService;
-
- @XxlJob("NoticeScheduleHandler")
- public void noticeScheduleHandler() throws Exception {
+ @Override
+ public ReturnT execute(String params) throws Exception {
Arrays.stream(NoticeTypeEnum.values())
.forEach(noticeType -> {
Results> results = OkHttpUtil.get(noticeType.getListUrl(), null, null, new TypeReference>>() {
@@ -64,5 +64,6 @@ public class NoticeScheduleHandler {
dingTalkMsgPushUtils.robotMarkdownMsgPush(announcementsDto.getTitle(), "查看详情", noticeType.getDetailUrl() + announcementsDto.getId(), content);
noticeLogService.saveNotice(noticeType, announcementsDto.getId(), announcementsDto.getType(), announcementsDto.getTitle(), announcementsDto.getCover(), noticeType.getDetailUrl() + announcementsDto.getId(), announcementsDto.getCreator(), announcementsDto.getCreatedAt());
});
+ return ReturnT.SUCCESS;
}
}