Kaynağa Gözat

feat : 虚拟游戏更改为可接待03

bilingfeng 10 ay önce
ebeveyn
işleme
b68379b02b

+ 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" +

+ 3 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/KfSessionUserServiceImpl.java

@@ -51,6 +51,8 @@ public class KfSessionUserServiceImpl extends ServiceImpl<KfSessionUserMapper, K
         return super.list(new LambdaQueryWrapper<KfSessionUser>()
                 .eq(KfSessionUser::getGameId, gameId)
                 .eq(KfSessionUser::getIsWait, Boolean.TRUE)
+                .orderByDesc(KfSessionUser::getWaitStartTime)
+                .last("limit 16")
         ).stream().map(this::transform).collect(Collectors.toList());
     }
 
@@ -61,6 +63,7 @@ public class KfSessionUserServiceImpl extends ServiceImpl<KfSessionUserMapper, K
         KfWebSocketMsgDTO.WaitUserBean waitUserBean = BeanUtil.copy(kfSessionUser, KfWebSocketMsgDTO.WaitUserBean.class);
         Page<KfRoomMsg> kfRoomMsgPage = kfRoomMsgService.page(new Page<>(1, 10),
                 new QueryWrapper<KfRoomMsg>().lambda()
+                        .eq(KfRoomMsg::getGameId, kfSessionUser.getGameId())
                         .eq(KfRoomMsg::getOpenId, kfSessionUser.getOpenId())
                         .eq(KfRoomMsg::getReadStatus, Boolean.FALSE)
                         .isNull(KfRoomMsg::getRoomId)