downgrade xxl-job release
This commit is contained in:
parent
8e4dceb188
commit
facabbf4ae
@ -112,7 +112,7 @@
|
||||
<dependency>
|
||||
<groupId>com.xuxueli</groupId>
|
||||
<artifactId>xxl-job-core</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@ -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<String> execute(String params) throws Exception {
|
||||
Arrays.stream(NoticeTypeEnum.values())
|
||||
.forEach(noticeType -> {
|
||||
Results<PageUtil<AnnouncementsDto>> results = OkHttpUtil.get(noticeType.getListUrl(), null, null, new TypeReference<Results<PageUtil<AnnouncementsDto>>>() {
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user