Browse Source

华为HAG权益同步接口修改

xushengqiang 4 năm trước cách đây
mục cha
commit
0d90862c6f

+ 8 - 6
src/main/java/cn/efunbox/audio/impl/hag/HagOrderServiceImpl.java

@@ -13,9 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * HagOrderServiceImpl
@@ -95,7 +93,7 @@ public class HagOrderServiceImpl implements HagOrderService {
     private HagSkillResp fillSuccessResp(String orderId) {
         HagSkillResp hagSkillResp = new HagSkillResp();
         hagSkillResp.setVersion("1.0.0");
-        HagSkillResp.Reply<OrderSyncResult> reply = new HagSkillResp.Reply();
+        HagSkillResp.Reply<Map> reply = new HagSkillResp.Reply();
         reply.setIsEndSession(Boolean.TRUE);
         HagSkillResp.Reply.Command command = new HagSkillResp.Reply.Command();
         command.setNamespace("Charge");
@@ -103,7 +101,9 @@ public class HagOrderServiceImpl implements HagOrderService {
         OrderSyncResult orderSyncResult = new OrderSyncResult();
         orderSyncResult.setResultCode("SUCCESS");
         orderSyncResult.setCpOrderId(orderId);
-        command.setBody(orderSyncResult);
+        Map<String,OrderSyncResult> syncResultMap = new HashMap<>();
+        syncResultMap.put("syncResult",orderSyncResult);
+        command.setBody(syncResultMap);
         reply.setCommands(Arrays.asList(command));
         hagSkillResp.setReply(reply);
         return hagSkillResp;
@@ -122,7 +122,9 @@ public class HagOrderServiceImpl implements HagOrderService {
         OrderSyncResult orderSyncResult = new OrderSyncResult();
         orderSyncResult.setResultCode("FAIL");
         orderSyncResult.setCpOrderId("");
-        command.setBody(orderSyncResult);
+        Map<String,OrderSyncResult> syncResultMap = new HashMap<>();
+        syncResultMap.put("syncResult",orderSyncResult);
+        command.setBody(syncResultMap);
         reply.setCommands(Arrays.asList(command));
         hagSkillResp.setReply(reply);
         return hagSkillResp;