浏览代码

fix : 聊天记录兼容奇侠

lingfeng 5 天之前
父节点
当前提交
a8b4d27856

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

@@ -21,7 +21,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 < (JDK升级17 ・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 < (聊天记录兼容奇侠 ・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 8 - 2
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserChatServiceImpl.java

@@ -20,7 +20,7 @@ import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
-import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
@@ -50,7 +50,13 @@ public class GameUserChatServiceImpl extends ServiceImpl<GameUserChatMapper, Gam
 
     @Override
     public Map<Long, String> chatGameMap() {
-        return Collections.singletonMap(12L, "仙剑");
+        List<GameSupper> gameSupperList = gameSupperService.list(new LambdaQueryWrapper<GameSupper>()
+                .eq(GameSupper::getChatLogSwitch, Boolean.TRUE));
+        Map<Long, String> map = new HashMap<>(gameSupperList.size());
+        for (GameSupper gameSupper : gameSupperList) {
+            map.put(gameSupper.getId(), gameSupper.getName());
+        }
+        return map;
     }
 
     @Override

+ 5 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameSupper.java

@@ -65,6 +65,11 @@ public class GameSupper implements Serializable {
      */
     private Boolean serverMaintain;
 
+    /**
+     * 玩家聊天记录开关
+     */
+    private Boolean chatLogSwitch;
+
     /**
      * 1 删除  0 正常
      */