|
@@ -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
|