项目完善,全自动获取腾讯体育NBA比赛直播源

This commit is contained in:
2025-04-21 17:31:05 +08:00
parent 48c1e03945
commit 31dc7c9cde
11 changed files with 121 additions and 244 deletions

View File

@@ -1,6 +1,7 @@
package com.ping.study.controller.tx;
import com.ping.study.service.tx.LiveInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@@ -10,6 +11,7 @@ import reactor.core.publisher.Mono;
@RestController
@RequestMapping("/tx/nba")
@Slf4j
public class LiveInfoController {
private final LiveInfoService liveInfoService;
@@ -19,7 +21,7 @@ public class LiveInfoController {
}
@GetMapping("/live/{cnlid}")
public String getLiveInfo(@PathVariable String cnlid) {
public String getLiveInfo(@PathVariable String cnlid) throws Exception {
return liveInfoService.getLiveInfo(cnlid);
}
@@ -27,7 +29,8 @@ public class LiveInfoController {
//定时任务 从北京时间凌晨到12点每过半个小时执行一次
@Scheduled(cron = "0 0/30 0-11 * * ?")
@RequestMapping("/live/refresh")
public String refreshLiveInfo() {
public String refreshLiveInfo() throws Exception {
log.info("=========开始执行更新直播链接=========");
return liveInfoService.refreshLiveInfo();
}
}