15 changed files with 197 additions and 37 deletions
@ -1,4 +1,4 @@ |
|||
package com.bnyer.img.service.impl; |
|||
package com.bnyer.img.service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@ -0,0 +1,28 @@ |
|||
package com.bnyer.img.task; |
|||
|
|||
import com.bnyer.img.service.TiktokCollectionService; |
|||
import com.xxl.job.core.biz.model.ReturnT; |
|||
import com.xxl.job.core.handler.annotation.XxlJob; |
|||
import com.xxl.job.core.log.XxlJobLogger; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/12 18:13 |
|||
*/ |
|||
@Component |
|||
@Slf4j |
|||
public class CollectionSyncTask { |
|||
|
|||
@Autowired |
|||
private TiktokCollectionService tiktokCollectionService; |
|||
|
|||
@XxlJob("collectionSyncTask") |
|||
public ReturnT<String> syncCollection(String param) throws Exception { |
|||
tiktokCollectionService.insertNum(); |
|||
XxlJobLogger.log("{} 我执行了同步收藏记录任务", System.currentTimeMillis()); |
|||
return ReturnT.SUCCESS; |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package com.bnyer.img.task; |
|||
|
|||
import com.bnyer.img.service.TiktokImgService; |
|||
import com.xxl.job.core.biz.model.ReturnT; |
|||
import com.xxl.job.core.handler.annotation.XxlJob; |
|||
import com.xxl.job.core.log.XxlJobLogger; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/12 18:13 |
|||
*/ |
|||
@Component |
|||
@Slf4j |
|||
public class DownloadSyncTask { |
|||
|
|||
@Autowired |
|||
private TiktokImgService tiktokImgService; |
|||
|
|||
@XxlJob("collectionSyncTask") |
|||
public ReturnT<String> syncDownload(String param) throws Exception { |
|||
tiktokImgService.insertDownloadNum(); |
|||
XxlJobLogger.log("{} 我执行了同步图片下载数量任务", System.currentTimeMillis()); |
|||
return ReturnT.SUCCESS; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue