没两天的凌晨两点

This commit is contained in:
Achilles
2024-01-09 20:40:54 +08:00
parent 175bc87824
commit 43f08fc073

View File

@@ -15,6 +15,7 @@ import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element; import org.jsoup.nodes.Element;
import org.jsoup.select.Elements; import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -49,6 +50,7 @@ public class MoneyScraper {
private MoneyStockRepository moneyStockRepository; private MoneyStockRepository moneyStockRepository;
@GetMapping("testScraperGetMoneyControlStock") @GetMapping("testScraperGetMoneyControlStock")
@Scheduled(cron = "0 0 2 */2 * ?")
public void schedule(){ public void schedule(){
List<String> letters = new ArrayList<>(); List<String> letters = new ArrayList<>();
for (char c = 'A'; c <= 'Z'; c++) { for (char c = 'A'; c <= 'Z'; c++) {