Explorar o código

fix : Websocket图片消息处理04

bilingfeng hai 1 ano
pai
achega
c64ca28396

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -23,7 +23,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <Websocket图片消息处理3> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <Websocket图片消息处理4> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/dto/KfUploadTempMediaDTO.java

@@ -20,7 +20,7 @@ public class KfUploadTempMediaDTO {
     /**
      * 错误码, 成功返回 0, 40001 : access_token错误, 40004 : 不合法的媒体文件类型
      */
-    private long errcode;
+    private Long errcode;
 
     /**
      * 错误消息

+ 5 - 4
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/api/KfWxApiService.java

@@ -3,6 +3,7 @@ package com.zanxiang.game.module.manage.service.api;
 import com.zanxiang.game.module.base.ServerInfo;
 import com.zanxiang.game.module.base.rpc.IWxApiServiceRpc;
 import com.zanxiang.game.module.manage.pojo.dto.GameAppletDTO;
+import com.zanxiang.game.module.manage.pojo.dto.KfUploadTempMediaDTO;
 import com.zanxiang.game.module.manage.service.IGameAppletService;
 import com.zanxiang.module.util.JsonUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -105,10 +106,10 @@ public class KfWxApiService {
             return Tuples.of(400L, e.getMessage());
         }
         log.error("客服消息上传临时素材结果, result : {}", result);
-        Map<String, String> resultMap = JsonUtil.toMap(result, Map.class, String.class);
-        //错误码
-        long resultCode = Long.parseLong(resultMap.get("errcode"));
+        KfUploadTempMediaDTO resultDTO = JsonUtil.toObj(result, KfUploadTempMediaDTO.class);
+        log.error("客服消息上传临时素材结果, resultDTO : {}", resultDTO);
         //返回
-        return resultCode == 0 ? Tuples.of(resultCode, resultMap.get("media_id")) : Tuples.of(resultCode, resultMap.get("errmsg"));
+        return resultDTO.isSuccess() ? Tuples.of(resultDTO.getErrcode(), resultDTO.getMedia_id())
+                : Tuples.of(resultDTO.getErrcode(), resultDTO.getErrmsg());
     }
 }