|
@@ -4,15 +4,60 @@ import cn.com.ctop.toutiao.modules.report.entity.EtlBytedanceReportVideoDaily;
|
|
import cn.com.ctop.toutiao.modules.report.mapper.EtlBytedanceReportVideoDailyMapper;
|
|
import cn.com.ctop.toutiao.modules.report.mapper.EtlBytedanceReportVideoDailyMapper;
|
|
import cn.com.ctop.toutiao.modules.report.service.IEtlBytedanceReportVideoDailyService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IEtlBytedanceReportVideoDailyService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.google.api.client.util.Data;
|
|
|
|
+import com.google.common.base.Function;
|
|
|
|
+import org.checkerframework.checker.nullness.qual.Nullable;
|
|
|
|
+import org.jeecg.common.api.vo.Result;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
|
+import java.util.function.BiFunction;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 头条视频分日报表信息
|
|
* 头条视频分日报表信息
|
|
|
|
+ *
|
|
* @author jeecg-boot
|
|
* @author jeecg-boot
|
|
- * @date 2021-02-20
|
|
|
|
* @version V1.0
|
|
* @version V1.0
|
|
|
|
+ * @date 2021-02-20
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
public class EtlBytedanceReportVideoDailyServiceImpl extends ServiceImpl<EtlBytedanceReportVideoDailyMapper, EtlBytedanceReportVideoDaily> implements IEtlBytedanceReportVideoDailyService {
|
|
public class EtlBytedanceReportVideoDailyServiceImpl extends ServiceImpl<EtlBytedanceReportVideoDailyMapper, EtlBytedanceReportVideoDaily> implements IEtlBytedanceReportVideoDailyService {
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private EtlBytedanceReportVideoDailyMapper etlBytedanceReportVideoDailyMapper;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result updBytedanceVideo() throws Exception{
|
|
|
|
+ CompletableFuture future = CompletableFuture.supplyAsync(()->{
|
|
|
|
+ return etlBytedanceReportVideoDailyMapper.getBytedanceVideoInfo();
|
|
|
|
+ }).handle(new BiFunction<List<Map<String, Object>>, Throwable, Object>() {
|
|
|
|
+ @Override
|
|
|
|
+ public Object apply(List<Map<String, Object>> list, Throwable throwable) {
|
|
|
|
+ if (throwable != null){
|
|
|
|
+ return Result.error(throwable.getMessage());
|
|
|
|
+ }
|
|
|
|
+ list.forEach(map ->{
|
|
|
|
+ String coverUrl = map.get("posterUrl")+"";
|
|
|
|
+ String url = map.get("videoUrl")+"";
|
|
|
|
+ String md5 = map.get("md5")+"";
|
|
|
|
+ etlBytedanceReportVideoDailyMapper.updBytedanceVideoByMd5(md5,coverUrl,url);
|
|
|
|
+ });
|
|
|
|
+ return Result.ok("修改成功。");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return Result.ok(future.get());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|