|
@@ -11,6 +11,7 @@ import com.tzld.longarticle.recommend.server.model.cgi.*;
|
|
|
import com.tzld.longarticle.recommend.server.repository.model.*;
|
|
|
import com.tzld.longarticle.recommend.server.service.cgi.TouLiuHttpClientService;
|
|
|
import com.tzld.longarticle.recommend.server.service.strategy.reply.ReplyStrategyService;
|
|
|
+import com.tzld.longarticle.recommend.server.util.LarkRobotUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -68,7 +69,7 @@ public class BuckStrategyV1 implements ReplyStrategyService {
|
|
|
// 1 处理文章--算法引擎--排序文章数据
|
|
|
// getWenzhangData();
|
|
|
// 2 处理小程序--读取离线数据表--获取策略排序小程序数据
|
|
|
- List<CgiReplyBucketData> smallDataCgiReplyList = readStrategyOrderSmallData(keyedSet);
|
|
|
+ List<CgiReplyBucketData> smallDataCgiReplyList = readStrategyOrderSmallData(keyedSet, bucketDataParam);
|
|
|
// 2.1 获取小程序落地页地址 http调用
|
|
|
smallDataCgiReplyList = setSmallPageUrl(smallDataCgiReplyList);
|
|
|
log.info(JSON.toJSONString(smallDataCgiReplyList));
|
|
@@ -220,12 +221,14 @@ public class BuckStrategyV1 implements ReplyStrategyService {
|
|
|
GhDetailExample example = new GhDetailExample();
|
|
|
example.createCriteria().andGhIdEqualTo(ghId);
|
|
|
List<GhDetail> ghDetails = ghDetailMapper.selectByExample(example);
|
|
|
- if (!CollectionUtils.isEmpty(ghDetails)) {
|
|
|
- GhDetail ghDetail = ghDetails.get(0);
|
|
|
- if (Objects.equals(ghDetail.getType(), GhTypeEnum.THIRD_PARTY_GH.type)) {
|
|
|
- putScene = "dyyjs";
|
|
|
- channel = ghDetail.getChannel();
|
|
|
- }
|
|
|
+ if (CollectionUtils.isEmpty(ghDetails)) {
|
|
|
+ LarkRobotUtil.sendMessage("公众号信息查询失败 ghId=" + ghId);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ GhDetail ghDetail = ghDetails.get(0);
|
|
|
+ if (Objects.equals(ghDetail.getType(), GhTypeEnum.THIRD_PARTY_GH.type)) {
|
|
|
+ putScene = "dyyjs";
|
|
|
+ channel = ghDetail.getChannel();
|
|
|
}
|
|
|
String response = httpClientService.sendAdFlowAddRequest(GET_SMALL_PAGE_URL, videoId, putScene, channel, "自动", "公众号", "自动回复小程序", "位置" + sort, ghId);
|
|
|
JSONObject jsonObject = JSON.parseObject(response);
|
|
@@ -259,7 +262,7 @@ public class BuckStrategyV1 implements ReplyStrategyService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private List<CgiReplyBucketData> readStrategyOrderSmallData(Set<String> keyedSet) {
|
|
|
+ private List<CgiReplyBucketData> readStrategyOrderSmallData(Set<String> keyedSet, BucketDataParam bucketDataParam) {
|
|
|
List<CgiReplyBucketData> result = new ArrayList<>();
|
|
|
for (String key : keyedSet) {
|
|
|
if ("base".equals(key)) {
|