...
|
...
|
@@ -223,15 +223,43 @@ public class TblCrawlerInfoServiceImpl implements ITblCrawlerInfoService { |
|
|
throw new PlatformException("当前爬虫数据已被发布过",405);
|
|
|
}
|
|
|
//发布到种草文章表
|
|
|
req.setArticleType(ArticleTypeEnum.TBLCRAWLER.getValue());
|
|
|
Integer articleId = grassArticleService.publishArticle(req);
|
|
|
//维护爬虫数据和种草文章关联关系
|
|
|
//维护爬虫数据和种草文章关联关系(草稿箱不用维护)
|
|
|
if(req.getAuthStatus() != 9){
|
|
|
TblCrawlerArticleRelation tblCrawlerArticleRelation = new TblCrawlerArticleRelation();
|
|
|
tblCrawlerArticleRelation.setRelateId(articleId);
|
|
|
tblCrawlerArticleRelation.setArticleType((byte) ArticleTypeEnum.NORMAL.getValue());
|
|
|
tblCrawlerArticleRelation.setArticleType((byte) ArticleTypeEnum.TBLCRAWLER.getValue());
|
|
|
tblCrawlerArticleRelation.setCrawlerId(req.getCrawlerId());
|
|
|
tblCrawlerArticleRelation.setCreateTime(System.currentTimeMillis());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 爬虫数据内容定时发布到种草文章
|
|
|
* @param req
|
|
|
* @throws PlatformException
|
|
|
*/
|
|
|
@Override
|
|
|
public void timerPublishToGrass(TbleCrawlerAddToGrassReq req) throws PlatformException {
|
|
|
//校验当前爬虫数据是否已经在种草或者mars发布过,如果是则不能二次编辑和发布
|
|
|
List<TblCrawlerArticleRelation> relationList = tblCrawlerArticleRelationDao.selectByCrawlerId(req.getCrawlerId());
|
|
|
if(!relationList.isEmpty()){
|
|
|
throw new PlatformException("当前爬虫数据已被发布过",405);
|
|
|
}
|
|
|
//发布到种草文章表
|
|
|
req.setArticleType(ArticleTypeEnum.TBLCRAWLER.getValue());
|
|
|
Integer articleId = grassArticleService.timerPublish(req);
|
|
|
//维护爬虫数据和种草文章关联关系(草稿箱不用维护)
|
|
|
if(req.getAuthStatus() != 9){
|
|
|
TblCrawlerArticleRelation tblCrawlerArticleRelation = new TblCrawlerArticleRelation();
|
|
|
tblCrawlerArticleRelation.setRelateId(articleId);
|
|
|
tblCrawlerArticleRelation.setArticleType((byte) ArticleTypeEnum.TBLCRAWLER.getValue());
|
|
|
tblCrawlerArticleRelation.setCrawlerId(req.getCrawlerId());
|
|
|
tblCrawlerArticleRelation.setCreateTime(System.currentTimeMillis());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public TblCrawlerInfoQueryRsp queryTblCrawlerInfoById(Integer id) {
|
...
|
...
|
|