浏览代码

Merge remote-tracking branch 'origin/test' into test

yumeng 5 年之前
父节点
当前提交
8e4ab93c31
共有 23 个文件被更改,包括 1574 次插入233 次删除
  1. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CrawlerController.java
  2. 248 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouEffectAdInfoController.java
  3. 172 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouHotPhotoInfoController.java
  4. 248 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouInspiredAdController.java
  5. 17 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCceDataJob.java
  6. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICrawlerService.java
  7. 134 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CrawlerServiceImpl.java
  8. 0 232
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  9. 161 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/entity/KuaishouEffectAdInfo.java
  10. 140 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/entity/KuaishouHotPhotoInfo.java
  11. 120 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/entity/KuaishouInspiredAd.java
  12. 19 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/KuaishouEffectAdInfoMapper.java
  13. 19 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/KuaishouHotPhotoInfoMapper.java
  14. 19 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/KuaishouInspiredAdMapper.java
  15. 52 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/xml/KuaishouEffectAdInfoMapper.xml
  16. 42 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/xml/KuaishouHotPhotoInfoMapper.xml
  17. 38 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/xml/KuaishouInspiredAdMapper.xml
  18. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/IKuaishouEffectAdInfoService.java
  19. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/IKuaishouHotPhotoInfoService.java
  20. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/IKuaishouInspiredAdService.java
  21. 28 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouEffectAdInfoServiceImpl.java
  22. 28 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouHotPhotoInfoServiceImpl.java
  23. 28 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouInspiredAdServiceImpl.java

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CrawlerController.java

@@ -17,4 +17,9 @@ public class CrawlerController {
     public Map<String, Object> runTask(@RequestBody KuaishouAppiumJobVO jobVO) {
         return crawlerService.startJob(jobVO);
     }
+
+    @GetMapping("loadInspiration")
+    public Map<String, Object> loadInspiration() {
+        return crawlerService.loadInspiration();
+    }
 }

+ 248 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouEffectAdInfoController.java

@@ -0,0 +1,248 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouEffectAdInfo;
+import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouEffectAdInfoService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 快手效果广告信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-02
+ */
+@Slf4j
+@Api(tags = "快手效果广告信息")
+@RestController
+@RequestMapping("/ctop/kuaishouEffectAdInfo")
+public class KuaishouEffectAdInfoController {
+    @Autowired
+    private IKuaishouEffectAdInfoService kuaishouEffectAdInfoService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaishouEffectAdInfo
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "快手效果广告信息-分页列表查询")
+    @ApiOperation(value = "快手效果广告信息-分页列表查询", notes = "快手效果广告信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaishouEffectAdInfo>> queryPageList(KuaishouEffectAdInfo kuaishouEffectAdInfo,
+                                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                             HttpServletRequest req) {
+        Result<IPage<KuaishouEffectAdInfo>> result = new Result<IPage<KuaishouEffectAdInfo>>();
+        QueryWrapper<KuaishouEffectAdInfo> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouEffectAdInfo, req.getParameterMap());
+        Page<KuaishouEffectAdInfo> page = new Page<KuaishouEffectAdInfo>(pageNo, pageSize);
+        IPage<KuaishouEffectAdInfo> pageList = kuaishouEffectAdInfoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaishouEffectAdInfo
+     * @return
+     */
+    @AutoLog(value = "快手效果广告信息-添加")
+    @ApiOperation(value = "快手效果广告信息-添加", notes = "快手效果广告信息-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaishouEffectAdInfo> add(@RequestBody KuaishouEffectAdInfo kuaishouEffectAdInfo) {
+        Result<KuaishouEffectAdInfo> result = new Result<KuaishouEffectAdInfo>();
+        try {
+            kuaishouEffectAdInfoService.save(kuaishouEffectAdInfo);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaishouEffectAdInfo
+     * @return
+     */
+    @AutoLog(value = "快手效果广告信息-编辑")
+    @ApiOperation(value = "快手效果广告信息-编辑", notes = "快手效果广告信息-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaishouEffectAdInfo> edit(@RequestBody KuaishouEffectAdInfo kuaishouEffectAdInfo) {
+        Result<KuaishouEffectAdInfo> result = new Result<KuaishouEffectAdInfo>();
+        KuaishouEffectAdInfo kuaishouEffectAdInfoEntity = kuaishouEffectAdInfoService.getById(kuaishouEffectAdInfo.getId());
+        if (kuaishouEffectAdInfoEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaishouEffectAdInfoService.updateById(kuaishouEffectAdInfo);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "快手效果广告信息-通过id删除")
+    @ApiOperation(value = "快手效果广告信息-通过id删除", notes = "快手效果广告信息-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            kuaishouEffectAdInfoService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "快手效果广告信息-批量删除")
+    @ApiOperation(value = "快手效果广告信息-批量删除", notes = "快手效果广告信息-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<KuaishouEffectAdInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaishouEffectAdInfo> result = new Result<KuaishouEffectAdInfo>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaishouEffectAdInfoService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "快手效果广告信息-通过id查询")
+    @ApiOperation(value = "快手效果广告信息-通过id查询", notes = "快手效果广告信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaishouEffectAdInfo> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaishouEffectAdInfo> result = new Result<KuaishouEffectAdInfo>();
+        KuaishouEffectAdInfo kuaishouEffectAdInfo = kuaishouEffectAdInfoService.getById(id);
+        if (kuaishouEffectAdInfo == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaishouEffectAdInfo);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaishouEffectAdInfo> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaishouEffectAdInfo kuaishouEffectAdInfo = JSON.parseObject(deString, KuaishouEffectAdInfo.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaishouEffectAdInfo, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaishouEffectAdInfo> pageList = kuaishouEffectAdInfoService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "快手效果广告信息列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaishouEffectAdInfo.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("快手效果广告信息列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<KuaishouEffectAdInfo> listKuaishouEffectAdInfos = ExcelImportUtil.importExcel(file.getInputStream(), KuaishouEffectAdInfo.class, params);
+                kuaishouEffectAdInfoService.saveBatch(listKuaishouEffectAdInfos);
+                return Result.ok("文件导入成功!数据行数:" + listKuaishouEffectAdInfos.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 172 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouHotPhotoInfoController.java

@@ -0,0 +1,172 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouHotPhotoInfo;
+import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouHotPhotoInfoService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+/**
+ * 快手热门作品信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-03
+ */
+@Slf4j
+@Api(tags = "快手热门作品信息")
+@RestController
+@RequestMapping("/ctop/kuaishouHotPhotoInfo")
+public class KuaishouHotPhotoInfoController {
+    @Autowired
+    private IKuaishouHotPhotoInfoService kuaishouHotPhotoInfoService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaishouHotPhotoInfo
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "快手热门作品信息-分页列表查询")
+    @ApiOperation(value = "快手热门作品信息-分页列表查询", notes = "快手热门作品信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaishouHotPhotoInfo>> queryPageList(KuaishouHotPhotoInfo kuaishouHotPhotoInfo,
+                                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                             @RequestParam(name = "sortType", defaultValue = "1") Integer sortType,
+                                                             HttpServletRequest req) {
+        Result<IPage<KuaishouHotPhotoInfo>> result = new Result<IPage<KuaishouHotPhotoInfo>>();
+        QueryWrapper<KuaishouHotPhotoInfo> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouHotPhotoInfo, req.getParameterMap());
+        if (sortType == 1) {
+            queryWrapper.orderByDesc("playing_time");
+        } else if (sortType == 2) {
+            queryWrapper.orderByDesc("like_time");
+        } else {
+            queryWrapper.orderByDesc("comment_time");
+        }
+        Page<KuaishouHotPhotoInfo> page = new Page<KuaishouHotPhotoInfo>(pageNo, pageSize);
+        IPage<KuaishouHotPhotoInfo> pageList = kuaishouHotPhotoInfoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaishouHotPhotoInfo
+     * @return
+     */
+    @AutoLog(value = "快手热门作品信息-添加")
+    @ApiOperation(value = "快手热门作品信息-添加", notes = "快手热门作品信息-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaishouHotPhotoInfo> add(@RequestBody KuaishouHotPhotoInfo kuaishouHotPhotoInfo) {
+        Result<KuaishouHotPhotoInfo> result = new Result<KuaishouHotPhotoInfo>();
+        try {
+            kuaishouHotPhotoInfoService.save(kuaishouHotPhotoInfo);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaishouHotPhotoInfo
+     * @return
+     */
+    @AutoLog(value = "快手热门作品信息-编辑")
+    @ApiOperation(value = "快手热门作品信息-编辑", notes = "快手热门作品信息-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaishouHotPhotoInfo> edit(@RequestBody KuaishouHotPhotoInfo kuaishouHotPhotoInfo) {
+        Result<KuaishouHotPhotoInfo> result = new Result<KuaishouHotPhotoInfo>();
+        KuaishouHotPhotoInfo kuaishouHotPhotoInfoEntity = kuaishouHotPhotoInfoService.getById(kuaishouHotPhotoInfo.getId());
+        if (kuaishouHotPhotoInfoEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaishouHotPhotoInfoService.updateById(kuaishouHotPhotoInfo);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "快手热门作品信息-通过id删除")
+    @ApiOperation(value = "快手热门作品信息-通过id删除", notes = "快手热门作品信息-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            kuaishouHotPhotoInfoService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "快手热门作品信息-批量删除")
+    @ApiOperation(value = "快手热门作品信息-批量删除", notes = "快手热门作品信息-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<KuaishouHotPhotoInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaishouHotPhotoInfo> result = new Result<KuaishouHotPhotoInfo>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaishouHotPhotoInfoService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "快手热门作品信息-通过id查询")
+    @ApiOperation(value = "快手热门作品信息-通过id查询", notes = "快手热门作品信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaishouHotPhotoInfo> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaishouHotPhotoInfo> result = new Result<KuaishouHotPhotoInfo>();
+        KuaishouHotPhotoInfo kuaishouHotPhotoInfo = kuaishouHotPhotoInfoService.getById(id);
+        if (kuaishouHotPhotoInfo == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaishouHotPhotoInfo);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+}

+ 248 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouInspiredAdController.java

@@ -0,0 +1,248 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouInspiredAd;
+import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouInspiredAdService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 快手创意视频
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-03
+ */
+@Slf4j
+@Api(tags = "快手创意视频")
+@RestController
+@RequestMapping("/ctop/kuaishouInspiredAd")
+public class KuaishouInspiredAdController {
+    @Autowired
+    private IKuaishouInspiredAdService kuaishouInspiredAdService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaishouInspiredAd
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "快手创意视频-分页列表查询")
+    @ApiOperation(value = "快手创意视频-分页列表查询", notes = "快手创意视频-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaishouInspiredAd>> queryPageList(KuaishouInspiredAd kuaishouInspiredAd,
+                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                           HttpServletRequest req) {
+        Result<IPage<KuaishouInspiredAd>> result = new Result<IPage<KuaishouInspiredAd>>();
+        QueryWrapper<KuaishouInspiredAd> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouInspiredAd, req.getParameterMap());
+        Page<KuaishouInspiredAd> page = new Page<KuaishouInspiredAd>(pageNo, pageSize);
+        IPage<KuaishouInspiredAd> pageList = kuaishouInspiredAdService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaishouInspiredAd
+     * @return
+     */
+    @AutoLog(value = "快手创意视频-添加")
+    @ApiOperation(value = "快手创意视频-添加", notes = "快手创意视频-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaishouInspiredAd> add(@RequestBody KuaishouInspiredAd kuaishouInspiredAd) {
+        Result<KuaishouInspiredAd> result = new Result<KuaishouInspiredAd>();
+        try {
+            kuaishouInspiredAdService.save(kuaishouInspiredAd);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaishouInspiredAd
+     * @return
+     */
+    @AutoLog(value = "快手创意视频-编辑")
+    @ApiOperation(value = "快手创意视频-编辑", notes = "快手创意视频-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaishouInspiredAd> edit(@RequestBody KuaishouInspiredAd kuaishouInspiredAd) {
+        Result<KuaishouInspiredAd> result = new Result<KuaishouInspiredAd>();
+        KuaishouInspiredAd kuaishouInspiredAdEntity = kuaishouInspiredAdService.getById(kuaishouInspiredAd.getId());
+        if (kuaishouInspiredAdEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaishouInspiredAdService.updateById(kuaishouInspiredAd);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "快手创意视频-通过id删除")
+    @ApiOperation(value = "快手创意视频-通过id删除", notes = "快手创意视频-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            kuaishouInspiredAdService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "快手创意视频-批量删除")
+    @ApiOperation(value = "快手创意视频-批量删除", notes = "快手创意视频-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<KuaishouInspiredAd> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaishouInspiredAd> result = new Result<KuaishouInspiredAd>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaishouInspiredAdService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "快手创意视频-通过id查询")
+    @ApiOperation(value = "快手创意视频-通过id查询", notes = "快手创意视频-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaishouInspiredAd> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaishouInspiredAd> result = new Result<KuaishouInspiredAd>();
+        KuaishouInspiredAd kuaishouInspiredAd = kuaishouInspiredAdService.getById(id);
+        if (kuaishouInspiredAd == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaishouInspiredAd);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaishouInspiredAd> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaishouInspiredAd kuaishouInspiredAd = JSON.parseObject(deString, KuaishouInspiredAd.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaishouInspiredAd, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaishouInspiredAd> pageList = kuaishouInspiredAdService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "快手创意视频列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaishouInspiredAd.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("快手创意视频列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<KuaishouInspiredAd> listKuaishouInspiredAds = ExcelImportUtil.importExcel(file.getInputStream(), KuaishouInspiredAd.class, params);
+                kuaishouInspiredAdService.saveBatch(listKuaishouInspiredAds);
+                return Result.ok("文件导入成功!数据行数:" + listKuaishouInspiredAds.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 17 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCceDataJob.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.ctop.job;
+
+import org.jeecg.modules.ctop.service.ICrawlerService;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class KuaishouCceDataJob implements Job {
+    @Autowired
+    private ICrawlerService crawlerService;
+
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        crawlerService.loadInspiration();
+    }
+}

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICrawlerService.java

@@ -6,4 +6,6 @@ import java.util.Map;
 
 public interface ICrawlerService {
     Map<String, Object> startJob(KuaishouAppiumJobVO jobVO);
+
+    Map<String, Object> loadInspiration();
 }

+ 134 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CrawlerServiceImpl.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.ctop.service.impl;
 
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
+import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumDevice;
@@ -10,17 +11,29 @@ import cn.com.ctop.crawler.modules.appium.mapper.AppiumTaskLogMapper;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumDeviceService;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumJobService;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskService;
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouEffectAdInfo;
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouHotPhotoInfo;
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouInspiredAd;
+import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouEffectAdInfoService;
+import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouHotPhotoInfoService;
+import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouInspiredAdService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
 import org.jeecg.modules.ctop.service.ICrawlerService;
 import org.jeecg.modules.ctop.vo.KuaishouAppiumJobVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
 @Service
+@Slf4j
 public class CrawlerServiceImpl implements ICrawlerService {
     static ExecutorService executorService = null;
     @Autowired
@@ -37,7 +50,6 @@ public class CrawlerServiceImpl implements ICrawlerService {
     @Override
     public Map<String, Object> startJob(KuaishouAppiumJobVO jobVO) {
         Map<String, Object> result = new HashMap<>();
-        //TODO 需要考虑多个任务并行的问题
         //1:根据id查询快手账号信息
         BindAccountLogin accountLogin = bindAccountLoginService.getById(jobVO.getAccountId());
         if (null == accountLogin) {
@@ -108,4 +120,125 @@ public class CrawlerServiceImpl implements ICrawlerService {
         ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_CRAWLER_APP_JOB_StART.getCode());
         return result;
     }
+
+    @Override
+    public Map<String, Object> loadInspiration() {
+        //(1):效果广告解析
+        loadeffectAdByPage(100, 1);
+
+        //(2):广告创意视频
+        loadInspiredAdByPage(100, 1);
+
+        //(3):快手热门作品
+        loadHotPhotoByPage(100, 1);
+
+        return null;
+    }
+
+    private void loadHotPhotoByPage(int pageSize, int pageNum) {
+        String url = "https://cc.e.kuaishou.com/rest/creativeCentor/hotPhoto/list";
+        JSONObject param = new JSONObject();
+        param.put("pageNum", pageNum);
+        param.put("pageSize", pageSize);
+        param.put("sortType", 1);
+        String result = HttpUtils.httpPostRequest(url, param, new HashMap<>());
+        JSONObject resultObject = JSONObject.parseObject(result);
+        if (null == resultObject.getLong("result") || resultObject.getLong("result") != 1) {
+            log.info("热门作品数据获取失败");
+            return;
+        }
+        JSONArray hotPhotoInfos = resultObject.getJSONObject("data").getJSONArray("hotPhotoInfos");
+        if (null == hotPhotoInfos || hotPhotoInfos.size() <= 0) {
+            log.info("热门作品数据获取完成");
+            return;
+        }
+        List<KuaishouHotPhotoInfo> photoInfos = new ArrayList<>();
+        for (int i = 0; i < hotPhotoInfos.size(); i++) {
+            JSONObject photoInfoJSONObject = hotPhotoInfos.getJSONObject(i);
+            KuaishouHotPhotoInfo hotPhotoInfo = new KuaishouHotPhotoInfo(photoInfoJSONObject);
+            photoInfos.add(hotPhotoInfo);
+        }
+        hotPhotoInfoService.replaceBatch(photoInfos);
+        loadHotPhotoByPage(pageSize, pageNum + 1);
+    }
+
+    private void loadInspiredAdByPage(int pageSize, int pageNumber) {
+        String url = "https://cc.e.kuaishou.com/rest/creativeCentor/inspired/list";
+        JSONObject param = new JSONObject();
+        param.put("pageNum", pageNumber);
+        param.put("pageSize", pageSize);
+        param.put("firstIndustryId", 0);
+        param.put("formatId", 0);
+        param.put("inspiredSortTypeId", 0);
+        param.put("platformSourceId", 0);
+        param.put("queryCond", "");
+        String result = HttpUtils.httpPostRequest(url, param, new HashMap<>());
+        JSONObject resultObject = JSONObject.parseObject(result);
+        if (null == resultObject.getLong("result") || resultObject.getLong("result") != 1) {
+            log.info("广告创意数据获取失败");
+            return;
+        }
+        JSONArray inspiredAds = resultObject.getJSONObject("data").getJSONArray("inspiredAds");
+        if (null == inspiredAds || inspiredAds.size() <= 0) {
+            log.info("广告创意数据获取完成");
+            return;
+        }
+        List<KuaishouInspiredAd> ads = new ArrayList<>();
+        for (int i = 0; i < inspiredAds.size(); i++) {
+            JSONObject ad = inspiredAds.getJSONObject(i);
+            KuaishouInspiredAd inspiredAd = new KuaishouInspiredAd(ad);
+            ads.add(inspiredAd);
+        }
+        inspiredAdService.replaceBatch(ads);
+        loadInspiredAdByPage(pageSize, pageNumber + 1);
+    }
+
+    @Autowired
+    private IKuaishouInspiredAdService inspiredAdService;
+    @Autowired
+    private IKuaishouHotPhotoInfoService hotPhotoInfoService;
+    @Autowired
+    private IKuaishouEffectAdInfoService effectAdInfoService;
+
+    private void loadeffectAdByPage(int pageSize, int pageNum) {
+        String url = "https://cc.e.kuaishou.com/rest/creativeCentor/adCase/effectAd/list";
+        JSONObject param = new JSONObject();
+        param.put("caseType", 1);
+        param.put("pageNum", pageNum);
+        param.put("pageSize", pageSize);
+        String result = HttpUtils.httpPostRequest(url, param, new HashMap<>());
+        JSONObject resultObject = JSONObject.parseObject(result);
+        if (null == resultObject.getLong("result") || resultObject.getLong("result") != 1) {
+            log.info("效果广告数据获取失败");
+            return;
+        }
+        JSONArray effectAds = resultObject.getJSONObject("data").getJSONArray("effectAds");
+        if (null == effectAds || effectAds.size() <= 0) {
+            log.info("效果广告数据获取完成");
+            return;
+        }
+        List<KuaishouEffectAdInfo> adInfos = new ArrayList<>();
+        for (int i = 0; i < effectAds.size(); i++) {
+            JSONObject ad = effectAds.getJSONObject(i);
+            Long contentId = ad.getLong("contentId");
+            if (null != contentId) {
+                JSONObject content = getEffectAdDetail(contentId).getJSONObject("data").getJSONObject("effectAdDetail");
+                KuaishouEffectAdInfo adInfo = new KuaishouEffectAdInfo(content);
+                adInfos.add(adInfo);
+            }
+        }
+        if (adInfos.size() > 0) {
+            effectAdInfoService.replaceBatch(adInfos);
+        }
+        loadeffectAdByPage(pageSize, pageNum + 1);
+    }
+
+    private JSONObject getEffectAdDetail(Long contentId) {
+        String url = "https://cc.e.kuaishou.com/rest/creativeCentor/adCase/effectAd/detail";
+        JSONObject param = new JSONObject();
+        param.put("caseType", 1);
+        param.put("contentId", contentId);
+        String result = HttpUtils.httpPostRequest(url, param, new HashMap<>());
+        return JSONObject.parseObject(result);
+    }
 }

+ 0 - 232
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -1,249 +1,17 @@
 package org.jeecg;
 
-import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
-import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
-import cn.com.ctop.bytedance.service.IReportService;
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.UserAllocation;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IUserAllocationService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.crawler.modules.appium.service.IAppiumJobService;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
-import cn.com.ctop.toutiao.service.IByteDanceCreativeService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.mq.Sender;
-import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
 @RunWith(SpringRunner.class)
 @SpringBootTest
 @Slf4j
 public class SampleTest {
     @Value("${jeecg.path.chrome-driver}")
     private String chromeDriver;
-    @Autowired
-    private IAppiumJobService jobService;
-
-    @Test
-    public void getAgentData() {
-        jobService.loadTantanData();
-    }
-    @Test
-    public void testMq() {
-        Sender sender = new Sender();
-        sender.send();
-    }
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-
-    @Test
-    public void getYddData()throws Exception{
-        String dateString = "2020-01-06";
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date getDate = dateFormat.parse(dateString);
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条数据异常:为获取到可用的token");
-            return;
-        }
-//        tokens.forEach(token -> {
-//            reportService.getAdvertiserPlanReport(token,getDate,getDate,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-//        });
-
-        //清洗关于缘多多数据
-        //1:查询缘多多相关的用户数据
-        QueryWrapper<UserAllocation> yddWrapper = new QueryWrapper<>();
-        yddWrapper.eq("project_id",113);
-        List<UserAllocation> yddallocations = userAllocationService.list(yddWrapper);
-        if(null!=yddallocations&&yddallocations.size()>0){
-            yddallocations.forEach(allocation->{
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("advertiser_id",allocation.getAccountId())
-                        //.eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport>bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if(null!=bytedancePlanDailyReports&&bytedancePlanDailyReports.size()>0){
-                    bytedancePlanDailyReports.forEach(report->{
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setChannelCode(tags[0]);
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-
-        //清洗关于缘多多数据
-        //1:查询缘多多相关的用户数据
-        QueryWrapper<UserAllocation> dsjyWrapper = new QueryWrapper<>();
-        yddWrapper.eq("project_id",112);
-        List<UserAllocation> dsjyAllocations = userAllocationService.list(dsjyWrapper);
-        if(null!=dsjyAllocations&&dsjyAllocations.size()>0){
-            dsjyAllocations.forEach(allocation->{
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("advertiser_id",allocation.getAccountId())
-                //.eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport>bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if(null!=bytedancePlanDailyReports&&bytedancePlanDailyReports.size()>0){
-                    bytedancePlanDailyReports.forEach(report->{
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setChannelCode(tags[0]);
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-
-        //清洗关于缘多多数据
-        //1:查询缘多多相关的用户数据
-        QueryWrapper<UserAllocation> fjyhWrapper = new QueryWrapper<>();
-        yddWrapper.eq("project_id",222);
-        List<UserAllocation> fjyhAllocations = userAllocationService.list(fjyhWrapper);
-        if(null!=fjyhAllocations&&fjyhAllocations.size()>0){
-            fjyhAllocations.forEach(allocation->{
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("advertiser_id",allocation.getAccountId())
-                //.eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport>bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if(null!=bytedancePlanDailyReports&&bytedancePlanDailyReports.size()>0){
-                    bytedancePlanDailyReports.forEach(report->{
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setChannelCode(tags[0]);
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-    }
-    @Test
-    public void getZybBytedancePlanReport(){
-
-//        Date getDate = DateUtils.addDay(new Date(), -1);
-        Date getDate = new Date();
-        //1:查询作业帮相关的用户数据
-        QueryWrapper<UserAllocation> wrapper = new QueryWrapper<>();
-        wrapper.eq("project_id",215);
-        List<UserAllocation> allocations = userAllocationService.list(wrapper);
-        if(null!=allocations){
-            allocations.forEach(allocation->{
-                CtopOauthToken token = tokenService.getOauthTokenByAccountId(allocation.getAccountId()+"");
-                //3:获取广告计划信息数据
-                reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-            });
-        }
-
-        //清洗关于作业帮数据
-        if(null!=allocations&&allocations.size()>0){
-            allocations.forEach(allocation->{
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                String dateString = dateFormat.format(getDate)+" 00:00:00";
-                queryWrapper.eq("advertiser_id",allocation.getAccountId())
-//                        .eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport>bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if(null!=bytedancePlanDailyReports&&bytedancePlanDailyReports.size()>0){
-                    bytedancePlanDailyReports.forEach(report->{
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setAdsense(tags[1]);
-                        report.setPlanCode(tags[2]);
-                        String tag = tags[3];
-                        if(tag.contains("其他")){
-                            report.setMaterialType("其他");
-                        }else if (tag.contains("图片轮播")){
-                            report.setMaterialType("图片轮播");
-                        }else if(tag.contains("大字报")){
-                            report.setMaterialType("大字报");
-                        }else if(tag.contains("文字动画")){
-                            report.setMaterialType("文字动画");
-                        }else if(tag.contains("采访形式")){
-                            report.setMaterialType("采访形式");
-                        }else if(tag.contains("剧情")){
-                            report.setMaterialType("剧情");
-                        }else if(tag.contains("口播")){
-                            report.setMaterialType("口播");
-                        }else{
-                            report.setMaterialType("其他");
-                        }
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-    }
-
-    @Test
-    public void getByteDanceCreativeDate()throws Exception{
-        String dateString = "2020-01-06";
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date getDate = dateFormat.parse(dateString);
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条数据异常:为获取到可用的token");
-            return;
-        }
-        tokens.forEach(token -> {
-            //3:获取广告计划信息数据
-//            creativeService.getAdvertiserCreative(token.getAccountId() + "", "", null);
-            //2:获取全量素材数据
-//            advertiserDataService.getMaterialList(token);
-            reportService.getAdvertiserPlanReport(token,getDate,getDate,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        });
-    }
-
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-    @Autowired
-    private IByteDanceCreativeService creativeService;
-
-    @Test
-    public void getBytedancePlanHourReport(){
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条数据异常:为获取到可用的token");
-            return;
-        }
-        tokens.forEach(token -> {
-            //3:获取广告计划信息数据
-            advertiserDataService.getAdvertiserPlan(token, "", null, null);
-        });
-    }
-
-    @Test
-    public void loadRegistOrderData(){
-
-    }
-
-    @Autowired
-    private IUserAllocationService userAllocationService;
-
-    @Autowired
-    private IBytedancePlanDailyReportService planDailyReportService;
-
 }
 
 

+ 161 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/entity/KuaishouEffectAdInfo.java

@@ -0,0 +1,161 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.entity;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 快手效果广告信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-02
+ */
+@Data
+@TableName("kuaishou_effect_ad_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "kuaishou_effect_ad_info对象", description = "快手效果广告信息")
+public class KuaishouEffectAdInfo {
+    @TableId()
+    private Long id;
+    /**
+     * mainMvUrl
+     */
+    @Excel(name = "mainMvUrl", width = 15)
+    @ApiModelProperty(value = "mainMvUrl")
+    private String mainMvUrl;
+    /**
+     * coverThumbnailUrl
+     */
+    @Excel(name = "coverThumbnailUrl", width = 15)
+    @ApiModelProperty(value = "coverThumbnailUrl")
+    private String coverThumbnailUrl;
+    /**
+     * photoId
+     */
+    @Excel(name = "photoId", width = 15)
+    @ApiModelProperty(value = "photoId")
+    private Long photoId;
+    /**
+     * width
+     */
+    @Excel(name = "width", width = 15)
+    @ApiModelProperty(value = "width")
+    private Integer width;
+    /**
+     * height
+     */
+    @Excel(name = "height", width = 15)
+    @ApiModelProperty(value = "height")
+    private Integer height;
+    /**
+     * videoDuration
+     */
+    @Excel(name = "videoDuration", width = 15)
+    @ApiModelProperty(value = "videoDuration")
+    private Integer videoDuration;
+    /**
+     * adminTime
+     */
+    @Excel(name = "adminTime", width = 15)
+    @ApiModelProperty(value = "adminTime")
+    private Long adminTime;
+    /**
+     * likeRatio
+     */
+    @Excel(name = "likeRatio", width = 15)
+    @ApiModelProperty(value = "likeRatio")
+    private java.math.BigDecimal likeRatio;
+    /**
+     * likeCount
+     */
+    @Excel(name = "likeCount", width = 15)
+    @ApiModelProperty(value = "likeCount")
+    private Long likeCount;
+    /**
+     * timeGrowthRatio
+     */
+    @Excel(name = "timeGrowthRatio", width = 15)
+    @ApiModelProperty(value = "timeGrowthRatio")
+    private java.math.BigDecimal timeGrowthRatio;
+    /**
+     * theme
+     */
+    @Excel(name = "theme", width = 15)
+    @ApiModelProperty(value = "theme")
+    private String theme;
+    /**
+     * text
+     */
+    @Excel(name = "text", width = 15)
+    @ApiModelProperty(value = "text")
+    private String text;
+    /**
+     * caption
+     */
+    @Excel(name = "caption", width = 15)
+    @ApiModelProperty(value = "caption")
+    private String caption;
+    /**
+     * source
+     */
+    @Excel(name = "source", width = 15)
+    @ApiModelProperty(value = "source")
+    private String source;
+    /**
+     * bannerUrl
+     */
+    @Excel(name = "bannerUrl", width = 15)
+    @ApiModelProperty(value = "bannerUrl")
+    private String bannerUrl;
+    /**
+     * majorIndustryName
+     */
+    @Excel(name = "majorIndustryName", width = 15)
+    @ApiModelProperty(value = "majorIndustryName")
+    private String majorIndustryName;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    public KuaishouEffectAdInfo() {
+    }
+
+    public KuaishouEffectAdInfo(JSONObject data) {
+        this.id = data.getLong("contentId");
+        this.mainMvUrl = data.getJSONArray("mainMvUrls").getJSONObject(0).getString("url");
+        this.coverThumbnailUrl = data.getJSONArray("coverThumbnailUrls").getJSONObject(0).getString("url");
+        this.photoId = data.getLong("photoId");
+        this.width = data.getInteger("width");
+        this.height = data.getInteger("height");
+        this.videoDuration = data.getInteger("videoDuration");
+        this.adminTime = data.getLong("adminTime");
+        this.likeRatio = data.getBigDecimal("likeRatio");
+        this.likeCount = data.getLong("likeCount");
+        this.timeGrowthRatio = data.getBigDecimal("timeGrowthRatio");
+        this.theme = data.getString("theme");
+        this.text = data.getString("text");
+        this.caption = data.getString("caption");
+        this.source = data.getString("source");
+        this.bannerUrl = data.getString("bannerUrl");
+        this.majorIndustryName = data.getString("majorIndustryName");
+        this.createTime = new Date();
+        this.updateTime = new Date();
+    }
+}

+ 140 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/entity/KuaishouHotPhotoInfo.java

@@ -0,0 +1,140 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.entity;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 快手热门作品信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-03
+ */
+@Data
+@TableName("kuaishou_hot_photo_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "kuaishou_hot_photo_info对象", description = "快手热门作品信息")
+public class KuaishouHotPhotoInfo {
+
+    /**
+     * photoId
+     */
+    @Excel(name = "photoId", width = 15)
+    @ApiModelProperty(value = "photoId")
+    @TableId
+    private Long id;
+    /**
+     * mainMvUrl
+     */
+    @Excel(name = "mainMvUrl", width = 15)
+    @ApiModelProperty(value = "mainMvUrl")
+    private String mainMvUrl;
+    /**
+     * coverThumbnailUrl
+     */
+    @Excel(name = "coverThumbnailUrl", width = 15)
+    @ApiModelProperty(value = "coverThumbnailUrl")
+    private String coverThumbnailUrl;
+    /**
+     * width
+     */
+    @Excel(name = "width", width = 15)
+    @ApiModelProperty(value = "width")
+    private Integer width;
+    /**
+     * height
+     */
+    @Excel(name = "height", width = 15)
+    @ApiModelProperty(value = "height")
+    private Integer height;
+    /**
+     * videoDuration
+     */
+    @Excel(name = "videoDuration", width = 15)
+    @ApiModelProperty(value = "videoDuration")
+    private Integer videoDuration;
+    /**
+     * playingTime
+     */
+    @Excel(name = "playingTime", width = 15)
+    @ApiModelProperty(value = "playingTime")
+    private Integer playingTime;
+    /**
+     * likeTime
+     */
+    @Excel(name = "likeTime", width = 15)
+    @ApiModelProperty(value = "likeTime")
+    private Integer likeTime;
+    /**
+     * commentTime
+     */
+    @Excel(name = "commentTime", width = 15)
+    @ApiModelProperty(value = "commentTime")
+    private Integer commentTime;
+    /**
+     * headUrl
+     */
+    @Excel(name = "headUrl", width = 15)
+    @ApiModelProperty(value = "headUrl")
+    private String headUrl;
+    /**
+     * nickName
+     */
+    @Excel(name = "nickName", width = 15)
+    @ApiModelProperty(value = "nickName")
+    private String nickName;
+    /**
+     * caption
+     */
+    @Excel(name = "caption", width = 15)
+    @ApiModelProperty(value = "caption")
+    private String caption;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    public KuaishouHotPhotoInfo() {
+    }
+
+    public KuaishouHotPhotoInfo(JSONObject data) {
+        this.id = data.getLong("photoId");
+        this.mainMvUrl = data.getJSONArray("mainMvUrls").getJSONObject(0).getString("url");
+        this.coverThumbnailUrl = data.getJSONArray("coverThumbnailUrls").getJSONObject(0).getString("url");
+        this.width = data.getInteger("width");
+        this.height = data.getInteger("height");
+        ;
+        this.videoDuration = data.getInteger("videoDuration");
+        ;
+        this.playingTime = data.getInteger("playingTimes");
+        ;
+        this.likeTime = data.getInteger("likeTimes");
+        ;
+        this.commentTime = data.getInteger("commentTimes");
+        ;
+        this.headUrl = data.getJSONArray("headUrls").getJSONObject(0).getString("url");
+        ;
+        this.nickName = data.getString("nickName");
+        ;
+        this.caption = data.getString("caption");
+        ;
+        this.createTime = new Date();
+        this.updateTime = new Date();
+    }
+}

+ 120 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/entity/KuaishouInspiredAd.java

@@ -0,0 +1,120 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.entity;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 快手创意视频
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-03
+ */
+@Data
+@TableName("kuaishou_inspired_ad")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "kuaishou_inspired_ad对象", description = "快手创意视频")
+public class KuaishouInspiredAd {
+
+    /**
+     * id
+     */
+    @TableId
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * mainMvUrl
+     */
+    @Excel(name = "mainMvUrl", width = 15)
+    @ApiModelProperty(value = "mainMvUrl")
+    private String mainMvUrl;
+    /**
+     * coverThumbnailUrl
+     */
+    @Excel(name = "coverThumbnailUrl", width = 15)
+    @ApiModelProperty(value = "coverThumbnailUrl")
+    private String coverThumbnailUrl;
+    /**
+     * width
+     */
+    @Excel(name = "width", width = 15)
+    @ApiModelProperty(value = "width")
+    private Integer width;
+    /**
+     * height
+     */
+    @Excel(name = "height", width = 15)
+    @ApiModelProperty(value = "height")
+    private Integer height;
+    /**
+     * videoDuration
+     */
+    @Excel(name = "videoDuration", width = 15)
+    @ApiModelProperty(value = "videoDuration")
+    private Long videoDuration;
+    /**
+     * headUrl
+     */
+    @Excel(name = "headUrl", width = 15)
+    @ApiModelProperty(value = "headUrl")
+    private String headUrl;
+    /**
+     * firstIndustryName
+     */
+    @Excel(name = "firstIndustryName", width = 15)
+    @ApiModelProperty(value = "firstIndustryName")
+    private String firstIndustryName;
+    /**
+     * nickName
+     */
+    @Excel(name = "nickName", width = 15)
+    @ApiModelProperty(value = "nickName")
+    private String nickName;
+    /**
+     * caption
+     */
+    @Excel(name = "caption", width = 15)
+    @ApiModelProperty(value = "caption")
+    private String caption;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    public KuaishouInspiredAd() {
+    }
+
+    public KuaishouInspiredAd(JSONObject data) {
+        this.id = data.getLong("photoId");
+        this.mainMvUrl = data.getJSONArray("mainMvUrls").getJSONObject(0).getString("url");
+        this.coverThumbnailUrl = data.getJSONArray("coverThumbnailUrls").getJSONObject(0).getString("url");
+        ;
+        this.width = data.getInteger("width");
+        this.height = data.getInteger("height");
+        this.videoDuration = data.getLong("videoDuration");
+        this.headUrl = data.getJSONArray("headUrls").getJSONObject(0).getString("url");
+        ;
+        ;
+        this.firstIndustryName = data.getString("firstIndustryName");
+        this.nickName = data.getString("nickName");
+        this.caption = data.getString("caption");
+        this.createTime = new Date();
+        this.updateTime = new Date();
+    }
+}

+ 19 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/KuaishouEffectAdInfoMapper.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.mapper;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouEffectAdInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 快手效果广告信息
+ *
+ * @author: jeecg-boot
+ * @date: 2020-03-02
+ * @cersion: V1.0
+ */
+public interface KuaishouEffectAdInfoMapper extends BaseMapper<KuaishouEffectAdInfo> {
+
+    void replaceBatch(@Param(value = "adInfos") List<KuaishouEffectAdInfo> adInfos);
+}

+ 19 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/KuaishouHotPhotoInfoMapper.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.mapper;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouHotPhotoInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 快手热门作品信息
+ *
+ * @author: jeecg-boot
+ * @date: 2020-03-03
+ * @cersion: V1.0
+ */
+public interface KuaishouHotPhotoInfoMapper extends BaseMapper<KuaishouHotPhotoInfo> {
+
+    void replaceBatch(@Param(value = "photoInfos") List<KuaishouHotPhotoInfo> photoInfos);
+}

+ 19 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/KuaishouInspiredAdMapper.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.mapper;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouInspiredAd;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 快手创意视频
+ *
+ * @author: jeecg-boot
+ * @date: 2020-03-03
+ * @cersion: V1.0
+ */
+public interface KuaishouInspiredAdMapper extends BaseMapper<KuaishouInspiredAd> {
+
+    void replaceBatch(@Param(value = "ads") List<KuaishouInspiredAd> ads);
+}

+ 52 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/xml/KuaishouEffectAdInfoMapper.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.crawler.modules.kuaishoucce.mapper.KuaishouEffectAdInfoMapper">
+
+    <insert id="replaceBatch">
+        replace into kuaishou_effect_ad_info(
+        id,
+        main_mv_url,
+        cover_thumbnail_url,
+        photo_id,
+        width,
+        height,
+        video_duration,
+        admin_time,
+        like_ratio,
+        like_count,
+        time_growth_ratio,
+        theme,
+        text,
+        caption,
+        source,
+        banner_url,
+        major_industry_name,
+        create_time,
+        update_time
+        )
+        values
+        <foreach collection="adInfos" item="ad" separator=",">
+            (
+            #{ad.id},
+            #{ad.mainMvUrl},
+            #{ad.coverThumbnailUrl},
+            #{ad.photoId},
+            #{ad.width},
+            #{ad.height},
+            #{ad.videoDuration},
+            #{ad.adminTime},
+            #{ad.likeRatio},
+            #{ad.likeCount},
+            #{ad.timeGrowthRatio},
+            #{ad.theme},
+            #{ad.text},
+            #{ad.caption},
+            #{ad.source},
+            #{ad.bannerUrl},
+            #{ad.majorIndustryName},
+            #{ad.createTime},
+            #{ad.updateTime}
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 42 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/xml/KuaishouHotPhotoInfoMapper.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.crawler.modules.kuaishoucce.mapper.KuaishouHotPhotoInfoMapper">
+
+    <insert id="replaceBatch">
+        replace into kuaishou_hot_photo_info(
+        id ,
+        main_mv_url ,
+        cover_thumbnail_url ,
+        width ,
+        height ,
+        video_duration ,
+        playing_time ,
+        like_time ,
+        comment_time ,
+        head_url ,
+        nick_name ,
+        caption ,
+        create_time ,
+        update_time
+        )
+        values
+        <foreach collection="photoInfos" item="photoInfo" separator=",">
+            (
+            #{photoInfo.id},
+            #{photoInfo.mainMvUrl},
+            #{photoInfo.coverThumbnailUrl},
+            #{photoInfo.width},
+            #{photoInfo.height},
+            #{photoInfo.videoDuration},
+            #{photoInfo.playingTime},
+            #{photoInfo.likeTime},
+            #{photoInfo.commentTime},
+            #{photoInfo.headUrl},
+            #{photoInfo.nickName},
+            #{photoInfo.caption},
+            #{photoInfo.createTime},
+            #{photoInfo.updateTime}
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 38 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/mapper/xml/KuaishouInspiredAdMapper.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.crawler.modules.kuaishoucce.mapper.KuaishouInspiredAdMapper">
+
+    <insert id="replaceBatch">
+        replace into kuaishou_inspired_ad(
+        id,
+        main_mv_url,
+        cover_thumbnail_url,
+        width,
+        height,
+        video_duration,
+        head_url,
+        first_industry_name,
+        nick_name,
+        caption,
+        create_time,
+        update_time
+        )
+        values
+        <foreach collection="ads" item="ad" separator=",">
+            (
+            #{ad.id},
+            #{ad.mainMvUrl},
+            #{ad.coverThumbnailUrl},
+            #{ad.width},
+            #{ad.height},
+            #{ad.videoDuration},
+            #{ad.headUrl},
+            #{ad.firstIndustryName},
+            #{ad.nickName},
+            #{ad.caption},
+            #{ad.createTime},
+            #{ad.updateTime}
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 18 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/IKuaishouEffectAdInfoService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.service;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouEffectAdInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 快手效果广告信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-02
+ */
+public interface IKuaishouEffectAdInfoService extends IService<KuaishouEffectAdInfo> {
+
+    void replaceBatch(List<KuaishouEffectAdInfo> adInfos);
+}

+ 18 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/IKuaishouHotPhotoInfoService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.service;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouHotPhotoInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 快手热门作品信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-03
+ */
+public interface IKuaishouHotPhotoInfoService extends IService<KuaishouHotPhotoInfo> {
+
+    void replaceBatch(List<KuaishouHotPhotoInfo> photoInfos);
+}

+ 18 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/IKuaishouInspiredAdService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.service;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouInspiredAd;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 快手创意视频
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-03
+ */
+public interface IKuaishouInspiredAdService extends IService<KuaishouInspiredAd> {
+
+    void replaceBatch(List<KuaishouInspiredAd> ads);
+}

+ 28 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouEffectAdInfoServiceImpl.java

@@ -0,0 +1,28 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.service.impl;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouEffectAdInfo;
+import cn.com.ctop.crawler.modules.kuaishoucce.mapper.KuaishouEffectAdInfoMapper;
+import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouEffectAdInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 快手效果广告信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-02
+ */
+@Service
+public class KuaishouEffectAdInfoServiceImpl extends ServiceImpl<KuaishouEffectAdInfoMapper, KuaishouEffectAdInfo> implements IKuaishouEffectAdInfoService {
+    @Autowired
+    private KuaishouEffectAdInfoMapper adInfoMapper;
+
+    @Override
+    public void replaceBatch(List<KuaishouEffectAdInfo> adInfos) {
+        adInfoMapper.replaceBatch(adInfos);
+    }
+}

+ 28 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouHotPhotoInfoServiceImpl.java

@@ -0,0 +1,28 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.service.impl;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouHotPhotoInfo;
+import cn.com.ctop.crawler.modules.kuaishoucce.mapper.KuaishouHotPhotoInfoMapper;
+import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouHotPhotoInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 快手热门作品信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-03
+ */
+@Service
+public class KuaishouHotPhotoInfoServiceImpl extends ServiceImpl<KuaishouHotPhotoInfoMapper, KuaishouHotPhotoInfo> implements IKuaishouHotPhotoInfoService {
+    @Autowired
+    private KuaishouHotPhotoInfoMapper photoInfoMapper;
+
+    @Override
+    public void replaceBatch(List<KuaishouHotPhotoInfo> photoInfos) {
+        photoInfoMapper.replaceBatch(photoInfos);
+    }
+}

+ 28 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/service/impl/KuaishouInspiredAdServiceImpl.java

@@ -0,0 +1,28 @@
+package cn.com.ctop.crawler.modules.kuaishoucce.service.impl;
+
+import cn.com.ctop.crawler.modules.kuaishoucce.entity.KuaishouInspiredAd;
+import cn.com.ctop.crawler.modules.kuaishoucce.mapper.KuaishouInspiredAdMapper;
+import cn.com.ctop.crawler.modules.kuaishoucce.service.IKuaishouInspiredAdService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 快手创意视频
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-03
+ */
+@Service
+public class KuaishouInspiredAdServiceImpl extends ServiceImpl<KuaishouInspiredAdMapper, KuaishouInspiredAd> implements IKuaishouInspiredAdService {
+    @Autowired
+    private KuaishouInspiredAdMapper inspiredAdMapper;
+
+    @Override
+    public void replaceBatch(List<KuaishouInspiredAd> ads) {
+        inspiredAdMapper.replaceBatch(ads);
+    }
+}