|
@@ -1,18 +1,20 @@
|
|
|
-package com.tzld.piaoquan.longarticle.service.impl;
|
|
|
+package com.tzld.piaoquan.longarticle.service.local.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
import com.tzld.piaoquan.longarticle.common.enums.PublishGzhPushTypeEnum;
|
|
|
import com.tzld.piaoquan.longarticle.dao.mapper.PlanAccountMapper;
|
|
|
import com.tzld.piaoquan.longarticle.dao.mapper.PublishContentMapper;
|
|
|
import com.tzld.piaoquan.longarticle.dao.mapper.PublishMiniprogramMapper;
|
|
|
import com.tzld.piaoquan.longarticle.dao.mapper.RootSourceMapper;
|
|
|
+import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
|
|
|
import com.tzld.piaoquan.longarticle.model.dto.*;
|
|
|
-import com.tzld.piaoquan.longarticle.model.bo.*;
|
|
|
import com.tzld.piaoquan.longarticle.model.po.*;
|
|
|
-import com.tzld.piaoquan.longarticle.model.po.PlanAccount;
|
|
|
import com.tzld.piaoquan.longarticle.model.vo.*;
|
|
|
-import com.tzld.piaoquan.longarticle.service.CoreService;
|
|
|
+import com.tzld.piaoquan.longarticle.service.local.CoreService;
|
|
|
+import com.tzld.piaoquan.longarticle.service.remote.AigcService;
|
|
|
+import com.tzld.piaoquan.longarticle.service.remote.MatchService;
|
|
|
+import com.tzld.piaoquan.longarticle.service.remote.VideoService;
|
|
|
+import com.tzld.piaoquan.longarticle.service.remote.impl.SortServiceImpl;
|
|
|
import com.tzld.piaoquan.longarticle.utils.DateUtil;
|
|
|
import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
|
|
|
import com.tzld.piaoquan.longarticle.utils.TimeZoneUtil;
|
|
@@ -32,7 +34,7 @@ import java.util.stream.Collectors;
|
|
|
public class CoreServiceImpl implements CoreService {
|
|
|
|
|
|
@Autowired
|
|
|
- private PlanServiceImpl planService;
|
|
|
+ private AigcService aigcService;
|
|
|
|
|
|
@Autowired
|
|
|
private SortServiceImpl sortService;
|
|
@@ -41,16 +43,16 @@ public class CoreServiceImpl implements CoreService {
|
|
|
private ContentServiceImpl contentService;
|
|
|
|
|
|
@Autowired
|
|
|
- private PublishServiceImpl publishService;
|
|
|
+ private MatchService matchService;
|
|
|
|
|
|
@Autowired
|
|
|
- private KimiServiceImpl kimiService;
|
|
|
+ private VideoService videoService;
|
|
|
|
|
|
@Autowired
|
|
|
- private CardServiceImpl cardService;
|
|
|
+ private KimiServiceImpl kimiService;
|
|
|
|
|
|
@Autowired
|
|
|
- private CoverServiceImpl coverService;
|
|
|
+ private CardServiceImpl cardService;
|
|
|
|
|
|
@Autowired
|
|
|
private PlanAccountMapper planAccountMapper;
|
|
@@ -69,7 +71,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
|
|
|
@Override
|
|
|
public void initPlanAccount() {
|
|
|
- List<LongArticleSystemPlan> allLongArticleSystemPlans = planService.getAllLongArticleSystemPlan();
|
|
|
+ List<LongArticleSystemPlan> allLongArticleSystemPlans = aigcService.getAllLongArticleSystemPlan();
|
|
|
for (LongArticleSystemPlan longArticleSystemPlan : allLongArticleSystemPlans) {
|
|
|
if (longArticleSystemPlan.getPublishRate() == 1) {
|
|
|
List<Integer> weeks = JSON.parseArray(longArticleSystemPlan.getPublishDate(), Integer.class);
|
|
@@ -149,7 +151,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
LongArticleSystemGetContentsParam param = new LongArticleSystemGetContentsParam();
|
|
|
param.setAccountId(planAccount.getAccountId());
|
|
|
param.setPlanId(planAccount.getPlanId());
|
|
|
- LongArticleSystemContentVO longArticleSystemContentVO = planService.getContentItemList(param);
|
|
|
+ LongArticleSystemContentVO longArticleSystemContentVO = aigcService.getContentItemList(param);
|
|
|
if (longArticleSystemContentVO == null) {
|
|
|
continue;
|
|
|
}
|
|
@@ -166,7 +168,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
|
|
|
statusParam.setStatus(2);
|
|
|
statusParam.setPublishContentId(contentItemVO.getPublishContentId());
|
|
|
- planService.updateMatchMiniprogramStatus(statusParam);
|
|
|
+ aigcService.updateMatchMiniprogramStatus(statusParam);
|
|
|
continue;
|
|
|
}
|
|
|
if (contentStatus == 99 || contentStatus == 97) {
|
|
@@ -179,7 +181,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
if (contentStatus == 97) {
|
|
|
statusParam.setErrorMsg("文章晋级或者退场");
|
|
|
}
|
|
|
- planService.updateMatchMiniprogramStatus(statusParam);
|
|
|
+ aigcService.updateMatchMiniprogramStatus(statusParam);
|
|
|
}
|
|
|
} else {
|
|
|
MiniprogramCardRequest request = new MiniprogramCardRequest();
|
|
@@ -191,7 +193,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
request.setStrategy("strategy_v2");
|
|
|
request.setArticleId(contentItemVO.getSourceId());
|
|
|
request.setFlowPoolLevelTag(contentItemVO.getFlowPoolLevelTag());
|
|
|
- contentService.matchMiniprogramVideo(request);
|
|
|
+ matchService.matchMiniprogramVideo(request);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -328,7 +330,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
}
|
|
|
FilterSortParam param = new FilterSortParam();
|
|
|
param.setFilterSortContentList(list);
|
|
|
- planService.filterSortContents(param);
|
|
|
+ aigcService.filterSortContents(param);
|
|
|
}
|
|
|
List<LongArticleSystemPushContentParam> pushContentList = new ArrayList<>();
|
|
|
//排序结束
|
|
@@ -347,7 +349,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
sendIds.add(publishContent.getId());
|
|
|
//获取小程序
|
|
|
List<CrawlerVideo> contentVideos =
|
|
|
- contentService.getContentVideo(publishArticleData.getSourceId(), publishArticleData.getContentPoolType(), planAccount.getGhId());
|
|
|
+ contentService.getContentMiniVideo(publishArticleData.getSourceId(), publishArticleData.getContentPoolType(), planAccount.getGhId());
|
|
|
List<VideoDetail> videoDetails = new ArrayList<>();
|
|
|
//发布小程序
|
|
|
for (CrawlerVideo crawlerVideo : contentVideos) {
|
|
@@ -362,7 +364,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
} else {
|
|
|
kimiTitle = crawlerVideo.getVideoTitle();
|
|
|
}
|
|
|
- VideoDetail publish = publishService.publish(videoOssPath, userId, kimiTitle, platform, traceId);
|
|
|
+ VideoDetail publish = videoService.publish(videoOssPath, userId, kimiTitle, platform, traceId);
|
|
|
if (publish == null) {
|
|
|
continue;
|
|
|
}
|
|
@@ -373,7 +375,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
statusParam.setStatus(3);
|
|
|
statusParam.setPublishContentId(publishContentId);
|
|
|
statusParam.setErrorMsg("小程序视频数量不足");
|
|
|
- planService.updateMatchMiniprogramStatus(statusParam);
|
|
|
+ aigcService.updateMatchMiniprogramStatus(statusParam);
|
|
|
|
|
|
PublishContent update = new PublishContent();
|
|
|
update.setId(publishContent.getId());
|
|
@@ -391,7 +393,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
List<PublishMiniprogramParam> publishCardList = new ArrayList<>();
|
|
|
for (PublishMiniprogram publishMiniprogram : cardList) {
|
|
|
String videoCover = publishMiniprogram.getVideoCover();
|
|
|
- String wxUrl = coverService.pushCover(videoCover, publishMiniprogram.getPublishContentId());
|
|
|
+ String wxUrl = aigcService.pushCover(videoCover, publishMiniprogram.getPublishContentId());
|
|
|
if (StringUtils.isEmpty(wxUrl)) {
|
|
|
continue;
|
|
|
}
|
|
@@ -439,7 +441,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
statusParam.setStatus(3);
|
|
|
statusParam.setPublishContentId(publishContentId);
|
|
|
statusParam.setErrorMsg("小程序视频数量不足");
|
|
|
- planService.updateMatchMiniprogramStatus(statusParam);
|
|
|
+ aigcService.updateMatchMiniprogramStatus(statusParam);
|
|
|
|
|
|
PublishContent update = new PublishContent();
|
|
|
update.setId(publishContent.getId());
|
|
@@ -469,7 +471,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
continue;
|
|
|
}
|
|
|
log.info("gzhPushParam={}", gzhPushParam);
|
|
|
- String pushId = planService.createPushTask(gzhPushParam);
|
|
|
+ String pushId = aigcService.createPushTask(gzhPushParam);
|
|
|
log.info("pushId = {}", pushId);
|
|
|
if (StringUtils.isNotEmpty(pushId)) {
|
|
|
for (Long id : sendIds) {
|
|
@@ -496,7 +498,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
for (String pushId : collect) {
|
|
|
PushStatusParam param = new PushStatusParam();
|
|
|
param.setPushId(pushId);
|
|
|
- PushStatusVO pushStatusVO = planService.queryPushStatus(param);
|
|
|
+ PushStatusVO pushStatusVO = aigcService.queryPushStatus(param);
|
|
|
if (pushStatusVO == null) {
|
|
|
continue;
|
|
|
}
|