Parcourir la source

增加限制ghId

xueyiming il y a 6 mois
Parent
commit
402e71bc4c

+ 7 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/exterior/impl/ThirdPartyServiceImpl.java

@@ -39,6 +39,7 @@ import javax.annotation.PostConstruct;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 @Slf4j
 @Service
@@ -89,6 +90,12 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
         String channel = ghDetails.get(0).getChannel();
         if (channel == null) {
             LarkRobotUtil.sendMessage("channel不存在,请查看详情 ghId=", param.getGhId());
+            return CommonResponse.create(ExceptionCodeEnum.PARAM_ERROR, "ghId异常,请联系管理员检查");
+        }
+        if (!Objects.equals(secretEnum.channel, channel)) {
+            LarkRobotUtil.sendMessage(String.format("channel异常 secretEnum.channel=%s ghDetail.channel=%s ghId=%s",
+                    secretEnum.channel, channel, param.getGhId()));
+            return CommonResponse.create(ExceptionCodeEnum.PARAM_ERROR, "ghId异常,请联系管理员检查");
         }
         List<PushMessageVo> pushMessageVoList = new ArrayList<>();
         ReplyBucketData replyBucketData = getPushMessageData(param, channel);