|
@@ -3,10 +3,13 @@ package com.tzld.longarticle.recommend.server.service.exterior.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.aliyun.odps.data.Record;
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
+import com.tzld.longarticle.recommend.server.common.enums.GhTypeEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.SecretEnum;
|
|
|
+import com.tzld.longarticle.recommend.server.common.enums.StatusEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.cgi.ReplyStrategyServiceEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.response.CommonResponse;
|
|
|
import com.tzld.longarticle.recommend.server.common.response.ExceptionCodeEnum;
|
|
|
+import com.tzld.longarticle.recommend.server.mapper.growth.GhDetailMapper;
|
|
|
import com.tzld.longarticle.recommend.server.model.bo.MiniData;
|
|
|
import com.tzld.longarticle.recommend.server.model.cgi.BucketDataParam;
|
|
|
import com.tzld.longarticle.recommend.server.model.cgi.GroupData;
|
|
@@ -15,10 +18,13 @@ import com.tzld.longarticle.recommend.server.model.cgi.ReplyBucketData;
|
|
|
import com.tzld.longarticle.recommend.server.model.param.PushMessageParam;
|
|
|
import com.tzld.longarticle.recommend.server.model.vo.PushMessageVo;
|
|
|
import com.tzld.longarticle.recommend.server.model.vo.ReportUvVo;
|
|
|
+import com.tzld.longarticle.recommend.server.repository.model.GhDetail;
|
|
|
+import com.tzld.longarticle.recommend.server.repository.model.GhDetailExample;
|
|
|
import com.tzld.longarticle.recommend.server.service.exterior.AccessTokenService;
|
|
|
import com.tzld.longarticle.recommend.server.service.exterior.ThirdPartyService;
|
|
|
import com.tzld.longarticle.recommend.server.service.strategy.reply.ReplyStrategyService;
|
|
|
import com.tzld.longarticle.recommend.server.util.DateUtils;
|
|
|
+import com.tzld.longarticle.recommend.server.util.LarkRobotUtil;
|
|
|
import lombok.Data;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -47,6 +53,9 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
|
|
|
@Autowired
|
|
|
private ODPSManager odpsManager;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private GhDetailMapper ghDetailMapper;
|
|
|
+
|
|
|
@ApolloJsonValue("${canViewReportDate:2024-10-31}")
|
|
|
private String canViewReportDate;
|
|
|
|
|
@@ -70,7 +79,17 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
|
|
|
if (secretEnum == null) {
|
|
|
return CommonResponse.create(ExceptionCodeEnum.PARAM_ERROR, "获取secret失败");
|
|
|
}
|
|
|
- String channel = secretEnum.channel;
|
|
|
+ log.info("getPushMessage param={} secretEnum desc={}", param, secretEnum.desc);
|
|
|
+ GhDetailExample example = new GhDetailExample();
|
|
|
+ example.createCriteria().andTypeEqualTo(GhTypeEnum.THIRD_PARTY_GH.type).andGhIdEqualTo(param.getGhId());
|
|
|
+ List<GhDetail> ghDetails = ghDetailMapper.selectByExample(example);
|
|
|
+ if (CollectionUtils.isEmpty(ghDetails)) {
|
|
|
+ return CommonResponse.create(ExceptionCodeEnum.PARAM_ERROR, "ghId不存在,请联系管理员配置");
|
|
|
+ }
|
|
|
+ String channel = ghDetails.get(0).getChannel();
|
|
|
+ if (channel == null) {
|
|
|
+ LarkRobotUtil.sendMessage("channel不存在,请查看详情 ghId=", param.getGhId());
|
|
|
+ }
|
|
|
List<PushMessageVo> pushMessageVoList = new ArrayList<>();
|
|
|
ReplyBucketData replyBucketData = getPushMessageData(param, channel);
|
|
|
log.info("replyBucketData={}", JSON.toJSONString(replyBucketData));
|