Pārlūkot izejas kodu

华为hag接口 bug fix

xushengqiang 5 gadi atpakaļ
vecāks
revīzija
e887a6754b

+ 12 - 3
src/main/java/cn/efunbox/audio/impl/hag/HagContentServiceImpl.java

@@ -108,10 +108,21 @@ public class HagContentServiceImpl implements HagContentService {
             return fillFailResp("400","deviceId为空");
         }
         HagSkillReq.HagInquire inquire = skillReq.getInquire();
+        if (Objects.isNull(inquire.getIntent())) {
+            return fillFailResp("400","intent为空");
+        }
         HagSkillReq.HagInquire.Intent.Slots slots = inquire.getIntent().getSlots();
+        if (Objects.isNull(slots)) {
+            return fillFailResp("400","slots为空");
+        }
         HagSkillReq.HagInquire.Intent.Slots.ContentCode albumCode = slots.getAlbumCode();
+        if (Objects.isNull(albumCode)) {
+            return fillFailResp("400","albumCode为空");
+        }
         HagSkillReq.HagInquire.Intent.Slots.ContentCode contentCode = slots.getContentCode();
-
+        if (Objects.isNull(contentCode)) {
+            return fillFailResp("400","contentCode为空");
+        }
         List<HagSkillReq.HagInquire.Intent.Slots.ContentCode.Value> values = contentCode.getValues();
         if (CollectionUtils.isEmpty(values)) {
             return fillFailResp("400","contentCode为空");
@@ -123,8 +134,6 @@ public class HagContentServiceImpl implements HagContentService {
             return fillFailResp("404","媒资数据未找到");
         }
 
-
-
         return fillSuccessResp(hagContent.getUrl());
     }
 

+ 3 - 0
src/main/java/cn/efunbox/audio/vo/hag/HagProductReq.java

@@ -11,6 +11,9 @@ import java.io.Serializable;
 @Data
 public class HagProductReq implements Serializable {
 
+    private String appKey;
+    private String appSecret;
+    private String ts;
     private Pagination pagination;
     private String updateTime;
     private String abilityId;