|
@@ -79,20 +79,37 @@ public class TestController {
|
|
|
@Autowired
|
|
|
private CrawlerDouyinMusicTaskService crawlerDouyinMusicTaskService;
|
|
|
@Autowired
|
|
|
+ private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
|
|
|
+ @Autowired
|
|
|
private MusicInfoService musicInfoService;
|
|
|
|
|
|
static ExecutorService executorService = Executors.newFixedThreadPool(15);
|
|
|
static ExecutorService videoService = Executors.newFixedThreadPool(5);
|
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping(value = "/getVideoReport")
|
|
|
+ public void getVideoReport() {
|
|
|
+ kuaiShouHistoryReportTaskService.getTaskList();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping(value = "/getMd5")
|
|
|
+ public void getMd5() {
|
|
|
+ kuaiShouHistoryReportTaskService.getMd5();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@GetMapping(value = "/syncDouyinMusicAsc")
|
|
|
- public String syncDouyinMusicAsc(){
|
|
|
+ public String syncDouyinMusicAsc() {
|
|
|
QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("status","init").orderByAsc("id").last(" limit 20");
|
|
|
+ queryWrapper.eq("status", "init").orderByAsc("id").last(" limit 20");
|
|
|
|
|
|
List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
|
|
|
|
|
|
- while (list != null){
|
|
|
- for(CrawlerDouyinMusicTask crawlerDouyinMusicTask : list){
|
|
|
+ while (list != null) {
|
|
|
+ for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
|
|
|
MusicInfo musicInfo = new MusicInfo();
|
|
|
musicInfo.setExtId(crawlerDouyinMusicTask.getId());
|
|
|
musicInfo = douyinMusicService.getMusicInfo(musicInfo);
|
|
@@ -104,19 +121,20 @@ public class TestController {
|
|
|
}
|
|
|
return "success";
|
|
|
}
|
|
|
+
|
|
|
@GetMapping(value = "/syncDouyinMusic")
|
|
|
- public String syncDouyinMusic(){
|
|
|
- for(int i =0;i<10;i++){
|
|
|
+ public String syncDouyinMusic() {
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
final int j = i;
|
|
|
- Thread thread = new Thread(){
|
|
|
+ Thread thread = new Thread() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("status","init").likeLeft("id",j).orderByDesc("id").last(" limit 20");
|
|
|
+ queryWrapper.eq("status", "init").likeLeft("id", j).orderByDesc("id").last(" limit 20");
|
|
|
List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
|
|
|
- while (list != null){
|
|
|
- log.info("【同步歌曲】第"+j+"线程正在处理:"+list.size()+"条数据");
|
|
|
- for(CrawlerDouyinMusicTask crawlerDouyinMusicTask : list){
|
|
|
+ while (list != null) {
|
|
|
+ log.info("【同步歌曲】第" + j + "线程正在处理:" + list.size() + "条数据");
|
|
|
+ for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
|
|
|
MusicInfo musicInfo = new MusicInfo();
|
|
|
musicInfo.setExtId(crawlerDouyinMusicTask.getId());
|
|
|
douyinMusicService.getMusicInfo(musicInfo);
|
|
@@ -130,23 +148,24 @@ public class TestController {
|
|
|
|
|
|
return "success";
|
|
|
}
|
|
|
+
|
|
|
@GetMapping(value = "/parseDouyinMusic")
|
|
|
- public String parseDouyinMusic(){
|
|
|
- for(int i =0;i<10;i++){
|
|
|
+ public String parseDouyinMusic() {
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
final int j = i;
|
|
|
- Thread thread = new Thread(){
|
|
|
+ Thread thread = new Thread() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("status","done").likeLeft("id",j).orderByDesc("id").last(" limit 20");
|
|
|
+ queryWrapper.eq("status", "done").likeLeft("id", j).orderByDesc("id").last(" limit 20");
|
|
|
List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
|
|
|
- while (list != null){
|
|
|
- log.info("【解析分类】第"+j+"线程正在处理:"+list.size()+"条数据");
|
|
|
- for(CrawlerDouyinMusicTask crawlerDouyinMusicTask : list){
|
|
|
+ while (list != null) {
|
|
|
+ log.info("【解析分类】第" + j + "线程正在处理:" + list.size() + "条数据");
|
|
|
+ for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
|
|
|
QueryWrapper<MusicInfo> queryWrapper1 = new QueryWrapper<>();
|
|
|
- queryWrapper1.eq("ext_id",crawlerDouyinMusicTask.getId()).last(" limit 1");
|
|
|
+ queryWrapper1.eq("ext_id", crawlerDouyinMusicTask.getId()).last(" limit 1");
|
|
|
MusicInfo musicInfo = musicInfoService.getOne(queryWrapper1);
|
|
|
- if(musicInfo != null){
|
|
|
+ if (musicInfo != null) {
|
|
|
douyinMusicService.parseTag(musicInfo);
|
|
|
}
|
|
|
}
|
|
@@ -159,8 +178,9 @@ public class TestController {
|
|
|
|
|
|
return "success";
|
|
|
}
|
|
|
+
|
|
|
@GetMapping(value = "/testdouyinmusic")
|
|
|
- public String testDouyinMusic(){
|
|
|
+ public String testDouyinMusic() {
|
|
|
douyinMusicService.getHotMusicList();
|
|
|
return "success";
|
|
|
}
|
|
@@ -172,7 +192,7 @@ public class TestController {
|
|
|
|
|
|
QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
|
|
|
userAllocationQueryWrapper.eq("project_id", projectId);
|
|
|
- // userAllocationQueryWrapper.eq("account_status", 0);
|
|
|
+ // userAllocationQueryWrapper.eq("account_status", 0);
|
|
|
List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
|
|
|
if (!Check.isNull(list)) {
|
|
|
for (UserAllocation allocation : list) {
|
|
@@ -205,7 +225,7 @@ public class TestController {
|
|
|
|
|
|
QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
|
|
|
userAllocationQueryWrapper.eq("project_id", projectId);
|
|
|
- // userAllocationQueryWrapper.eq("account_status", 0);
|
|
|
+ // userAllocationQueryWrapper.eq("account_status", 0);
|
|
|
List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
|
|
|
if (!Check.isNull(list)) {
|
|
|
for (UserAllocation allocation : list) {
|