Sfoglia il codice sorgente

fix : 游戏聊天记录功能上线03

bilingfeng 1 mese fa
parent
commit
ccff081078

+ 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服务启动成功 < (游戏聊天记录功能上线-02 ・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 < (游戏聊天记录功能上线-03 ・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 11 - 10
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserChatServiceImpl.java

@@ -106,17 +106,18 @@ public class GameUserChatServiceImpl extends ServiceImpl<GameUserChatMapper, Gam
             return;
         }
         Optional.ofNullable(this.getGameUserRole(gameIds, roleId))
-                .filter(gameUserRole -> Strings.isNotBlank(gameUserRole.getExtra()))
                 .ifPresent(gameUserRole -> {
-                    Optional.ofNullable(JsonUtil.toMap(gameUserRole.getExtra(), Map.class, String.class))
-                            .ifPresent(extraMap -> {
-                                Optional.ofNullable(extraMap.get("countryId"))
-                                        .filter(Strings::isNotBlank)
-                                        .ifPresent(guildIdSetter);
-                                Optional.ofNullable(extraMap.get("country"))
-                                        .filter(Strings::isNotBlank)
-                                        .ifPresent(guildNameSetter);
-                            });
+                    if (Strings.isNotBlank(gameUserRole.getExtra())) {
+                        Optional.ofNullable(JsonUtil.toMap(gameUserRole.getExtra(), Map.class, String.class))
+                                .ifPresent(extraMap -> {
+                                    Optional.ofNullable(extraMap.get("countryId"))
+                                            .filter(Strings::isNotBlank)
+                                            .ifPresent(guildIdSetter);
+                                    Optional.ofNullable(extraMap.get("country"))
+                                            .filter(Strings::isNotBlank)
+                                            .ifPresent(guildNameSetter);
+                                });
+                    }
                     serverInfoSetter.accept(gameUserRole);
                 });
     }