Procházet zdrojové kódy

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

bilingfeng před 1 měsícem
rodič
revize
630018df71

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

+ 14 - 12
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserChatServiceImpl.java

@@ -105,18 +105,20 @@ public class GameUserChatServiceImpl extends ServiceImpl<GameUserChatMapper, Gam
         if (Strings.isBlank(roleId)) {
             return;
         }
-        Optional.ofNullable(this.getGameUserRole(gameIds, roleId)).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);
-                    });
-            serverInfoSetter.accept(gameUserRole);
-        });
+        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);
+                            });
+                    serverInfoSetter.accept(gameUserRole);
+                });
     }
 
     private List<Long> getGameIdBySuperGameId(Long superGameId) {