Przeglądaj źródła

Merge branch 'dev' of GameCenter/game-center into master

zhimo 1 miesiąc temu
rodzic
commit
4e3bb531a9

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

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

@@ -22,7 +22,7 @@ import java.util.Map;
  * @time : 2025-03-13
  * @description :
  */
-@Api(tags = {"游戏分类标签管理接口"})
+@Api(tags = {"游戏聊天记录相关接口"})
 @RestController
 @RequestMapping("/game/chat")
 @Slf4j

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameUserChatVO.java

@@ -20,7 +20,7 @@ public class GameUserChatVO {
     /**
      * 游戏名称
      */
-    private Long gameName;
+    private String gameName;
 
     /**
      * 区服id

+ 15 - 4
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserChatServiceImpl.java

@@ -7,9 +7,11 @@ import com.zanxiang.game.module.manage.pojo.params.ChatSubmitParam;
 import com.zanxiang.game.module.manage.pojo.params.GameUserChatListParam;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserChatVO;
 import com.zanxiang.game.module.manage.service.IGameService;
+import com.zanxiang.game.module.manage.service.IGameSupperService;
 import com.zanxiang.game.module.manage.service.IGameUserChatService;
 import com.zanxiang.game.module.manage.service.IGameUserRoleService;
 import com.zanxiang.game.module.mybatis.entity.Game;
+import com.zanxiang.game.module.mybatis.entity.GameSupper;
 import com.zanxiang.game.module.mybatis.entity.GameUserChat;
 import com.zanxiang.game.module.mybatis.entity.GameUserRole;
 import com.zanxiang.game.module.mybatis.mapper.GameUserChatMapper;
@@ -43,17 +45,22 @@ public class GameUserChatServiceImpl extends ServiceImpl<GameUserChatMapper, Gam
     @Autowired
     private IGameService gameService;
 
+    @Autowired
+    private IGameSupperService gameSupperService;
+
     @Autowired
     private IGameUserRoleService gameUserRoleService;
 
     @Override
     public Map<Long, String> chatGameMap() {
-        return Collections.singletonMap(12L, "仙剑奇侠传");
+        return Collections.singletonMap(12L, "仙剑");
     }
 
     @Override
     public IPage<GameUserChatVO> listOfPage(GameUserChatListParam param) {
+        GameSupper gameSupper = gameSupperService.getById(param.getSupperGameId());
         return super.page(param.toPage(), new LambdaQueryWrapper<GameUserChat>()
+                .eq(GameUserChat::getSupperGameId, param.getSupperGameId())
                 .eq(Strings.isNotBlank(param.getRoleId()), GameUserChat::getRoleId, param.getRoleId())
                 .like(Strings.isNotBlank(param.getRoleName()), GameUserChat::getRoleName, param.getRoleName())
                 .ge(param.getChatStart() != null, GameUserChat::getChatTime,
@@ -61,14 +68,18 @@ public class GameUserChatServiceImpl extends ServiceImpl<GameUserChatMapper, Gam
                 .le(param.getChatEnd() != null, GameUserChat::getChatTime,
                         param.getChatEnd() == null ? null : LocalDateTime.of(param.getChatEnd(), LocalTime.MAX))
                 .orderByDesc(GameUserChat::getCreateTime)
-        ).convert(this::toVO);
+        ).convert(c -> this.toVO(gameSupper, c));
     }
 
-    private GameUserChatVO toVO(GameUserChat gameUserChat) {
+    private GameUserChatVO toVO(GameSupper gameSupper, GameUserChat gameUserChat) {
         if (gameUserChat == null) {
             return null;
         }
-        return BeanUtil.copy(gameUserChat, GameUserChatVO.class);
+        GameUserChatVO vo = BeanUtil.copy(gameUserChat, GameUserChatVO.class);
+        if (gameSupper != null) {
+            vo.setGameName(gameSupper.getName());
+        }
+        return vo;
     }
 
     @Override