32 lines
836 B
Java
32 lines
836 B
Java
package com.darkness.engine;
|
|
|
|
import com.darkness.api.service.RssService;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
@RestController
|
|
@RequestMapping("/rss")
|
|
@EnableScheduling
|
|
public class RssController {
|
|
|
|
@Resource
|
|
private RssService rssService;
|
|
|
|
@Scheduled(cron = "0 0/30 * * * ?")
|
|
@PostMapping("/getRss")
|
|
public void getRss() {
|
|
rssService.getRss();
|
|
}
|
|
|
|
@Scheduled(cron = "0 0/10 * * * ?")
|
|
@PostMapping("/sendTWXMsg")
|
|
public void sendTWXMsg() {
|
|
rssService.sendTWXMsg();
|
|
}
|
|
}
|