admin
2021-04-19 eb7f3343af839a7c71f16e8ada2b25d5e2201c08
src/main/java/com/yeshi/buwan/job/video/PPTVVideoUpdate.java
@@ -2,6 +2,8 @@
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yeshi.buwan.dao.juhe.pptv.PPTVSeriesDao;
import com.yeshi.buwan.dao.juhe.pptv.VideoPPTVMapDao;
import com.yeshi.buwan.funtv.FunTVNewApi;
import com.yeshi.buwan.funtv.entity.FunTVAlbum2;
import com.yeshi.buwan.funtv.entity.FunTVShortVideo2;
@@ -30,6 +32,12 @@
    @Resource
    private PPTVService pptvService;
    @Resource
    private PPTVSeriesDao pptvSeriesDao;
    @Resource
    private VideoPPTVMapDao videoPPTVMapDao;
    /**
     * 更新最近几天的视频
@@ -50,4 +58,28 @@
    }
    @XxlJob("video-update-pptv-syncVideo")
    public ReturnT<String> syncVideo(String param) throws Exception {
        List<PPTVSeries> list = pptvSeriesDao.list(0, 10000);
        for (PPTVSeries s : list) {
            if (s != null) {
                switch (s.getStatus()) {
                    case "add":
                    case "update":
                        if (videoPPTVMapDao.selectByInfoId(s.getInfoID()) == null) {
                            PPTVSeries series = PPTVApiUtil.getDetail(s.getSeriesCode());
                            pptvService.save(series);
                            Thread.sleep(1000);
                            System.out.println(s.getName());
                            series = pptvService.getSeriesDetail(s.getInfoID());
                            if (series != null)
                                pptvService.addToVideoInfo(series);
                        }
                        break;
                }
            }
        }
        return ReturnT.SUCCESS;
    }
}