Bläddra i källkod

fix : 玩家封禁新增字段, 聊天记录增加查询条件

bilingfeng 5 dagar sedan
förälder
incheckning
c33b84df25

+ 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服务启动成功 < (头条渠道兼容星广联投任务id-01 ・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 < (玩家封禁新增字段, 聊天记录增加查询条件 ・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

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

@@ -20,7 +20,7 @@ import java.util.Map;
 /**
  * @author : lingfeng
  * @time : 2025-03-13
- * @description :
+ * @description : 游戏聊天记录
  */
 @Api(tags = {"游戏聊天记录相关接口"})
 @RestController
@@ -35,10 +35,18 @@ public class GameUserChatController {
     @GetMapping(value = "/game/list")
     @PreAuthorize(permissionKey = "manage:gameChat:gameList")
     @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Map.class)})
-    public ResultVO<Map<Long, String>> listOfPage() {
+    public ResultVO<Map<Long, String>> chatGameMap() {
         return ResultVO.ok(gameUserChatService.chatGameMap());
     }
 
+    @ApiOperation(value = "查询指定游戏区服")
+    @GetMapping(value = "/game/server/list")
+    @PreAuthorize(permissionKey = "manage:gameChat:gameServerList")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Map.class)})
+    public ResultVO<Map<String, String>> chatGameServerMap(@RequestParam Long supperGameId) {
+        return ResultVO.ok(gameUserChatService.chatGameServerMap(supperGameId));
+    }
+
     @ApiOperation(value = "查询游戏聊天记录")
     @PostMapping(value = "/list")
     @PreAuthorize(permissionKey = "manage:gameChat:chatList")

+ 15 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/dto/UserDTO.java

@@ -133,11 +133,26 @@ public class UserDTO {
      */
     private String imei;
 
+    /**
+     * 设备OAID
+     */
+    private String oaid;
+
     /**
      * 安卓id, (仅安卓设备才有值)
      */
     private String androidId;
 
+    /**
+     * IOS设备IDFA
+     */
+    private String idfa;
+
+    /**
+     * IOS设备CAID
+     */
+    private String caid;
+
     /**
      * 注册时间
      */

+ 5 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameUserChatListParam.java

@@ -42,4 +42,9 @@ public class GameUserChatListParam extends BaseListDTO<GameUserChat> {
      * 聊天结束日期
      */
     private LocalDate chatEnd;
+
+    /**
+     * 区服id
+     */
+    private String serverId;
 }

+ 2 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameUserChatService.java

@@ -18,6 +18,8 @@ public interface IGameUserChatService extends IService<GameUserChat> {
 
     Map<Long, String> chatGameMap();
 
+    Map<String, String> chatGameServerMap(Long supperGameId);
+
     IPage<GameUserChatVO> listOfPage(GameUserChatListParam param);
 
     void addGameUserChat(ChatSubmitParam param);

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

@@ -6,14 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 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.manage.service.*;
+import com.zanxiang.game.module.mybatis.entity.*;
 import com.zanxiang.game.module.mybatis.mapper.GameUserChatMapper;
 import com.zanxiang.module.util.DateUtil;
 import com.zanxiang.module.util.JsonUtil;
@@ -45,6 +39,9 @@ public class GameUserChatServiceImpl extends ServiceImpl<GameUserChatMapper, Gam
     @Autowired
     private IGameService gameService;
 
+    @Autowired
+    private IGameServerService gameServerService;
+
     @Autowired
     private IGameSupperService gameSupperService;
 
@@ -56,6 +53,15 @@ public class GameUserChatServiceImpl extends ServiceImpl<GameUserChatMapper, Gam
         return Collections.singletonMap(12L, "仙剑");
     }
 
+    @Override
+    public Map<String, String> chatGameServerMap(Long supperGameId) {
+        return gameServerService.list(new LambdaQueryWrapper<GameServer>()
+                .select(GameServer::getServerId, GameServer::getServerName)
+                .eq(GameServer::getGameId, supperGameId)
+                .eq(GameServer::getIsSourceServer, Boolean.TRUE)
+        ).stream().collect(Collectors.toMap(GameServer::getServerId, GameServer::getServerName));
+    }
+
     @Override
     public IPage<GameUserChatVO> listOfPage(GameUserChatListParam param) {
         GameSupper gameSupper = gameSupperService.getById(param.getSupperGameId());
@@ -63,6 +69,7 @@ public class GameUserChatServiceImpl extends ServiceImpl<GameUserChatMapper, Gam
                 .eq(GameUserChat::getSupperGameId, param.getSupperGameId())
                 .eq(Strings.isNotBlank(param.getRoleId()), GameUserChat::getRoleId, param.getRoleId())
                 .like(Strings.isNotBlank(param.getRoleName()), GameUserChat::getRoleName, param.getRoleName())
+                .eq(Strings.isNotBlank(param.getServerId()), GameUserChat::getServerId, param.getServerId())
                 .ge(param.getChatStart() != null, GameUserChat::getChatTime,
                         param.getChatStart() == null ? null : LocalDateTime.of(param.getChatStart(), LocalTime.MIN))
                 .le(param.getChatEnd() != null, GameUserChat::getChatTime,

+ 31 - 5
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserBanServiceImpl.java

@@ -11,10 +11,13 @@ import com.zanxiang.game.module.manage.pojo.dto.UserDTO;
 import com.zanxiang.game.module.manage.pojo.params.UserBanListParam;
 import com.zanxiang.game.module.manage.pojo.params.UserBanUpdateParam;
 import com.zanxiang.game.module.manage.pojo.vo.UserBanVO;
+import com.zanxiang.game.module.manage.pojo.vo.UserCardVO;
 import com.zanxiang.game.module.manage.service.IUserBanService;
+import com.zanxiang.game.module.manage.service.IUserCardService;
 import com.zanxiang.game.module.manage.service.IUserService;
 import com.zanxiang.game.module.mybatis.entity.User;
 import com.zanxiang.game.module.mybatis.entity.UserBan;
+import com.zanxiang.game.module.mybatis.entity.UserCard;
 import com.zanxiang.game.module.mybatis.mapper.UserBanMapper;
 import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.module.util.exception.BaseException;
@@ -40,6 +43,9 @@ public class UserBanServiceImpl extends ServiceImpl<UserBanMapper, UserBan> impl
     @Autowired
     private IUserService userService;
 
+    @Autowired
+    private IUserCardService userCardService;
+
     @Override
     public IPage<UserBanVO> list(UserBanListParam param) {
         return page(param.toPage(), new QueryWrapper<UserBan>().lambda()
@@ -51,10 +57,10 @@ public class UserBanServiceImpl extends ServiceImpl<UserBanMapper, UserBan> impl
                 .ge(param.getBeginDate() != null, UserBan::getBanTime, param.getBeginDate() == null ? null : LocalDateTime.of(param.getBeginDate(), LocalTime.MIN))
                 .le(param.getEndDate() != null, UserBan::getBanTime, param.getEndDate() == null ? null : LocalDateTime.of(param.getEndDate(), LocalTime.MAX))
                 .orderByDesc(UserBan::getCreateTime))
-                .convert(this::toVo);
+                .convert(this::toVO);
     }
 
-    private UserBanVO toVo(UserBan userBan) {
+    private UserBanVO toVO(UserBan userBan) {
         if (Objects.isNull(userBan)) {
             return null;
         }
@@ -87,18 +93,38 @@ public class UserBanServiceImpl extends ServiceImpl<UserBanMapper, UserBan> impl
                     .eq(UserBan::getUserId, param.getUserId()));
         }
         //添加玩家封禁信息
-        return super.save(UserBan.builder()
+        userBan = this.transform(userDTO, param.getStatus());
+        //查询玩家实名信息
+        UserCard userCard = userCardService.getOne(new LambdaQueryWrapper<UserCard>()
+                .eq(UserCard::getUserId, userBan.getUserId())
+                .orderByDesc(UserCard::getCreateTime)
+                .last("limit 1"));
+        if (userCard != null){
+            userBan.setCardId(userCard.getCardId());
+        }
+        return super.save(userBan);
+    }
+
+    private UserBan transform(UserDTO userDTO, Integer status) {
+        return UserBan.builder()
                 .userId(userDTO.getId())
                 .userName(userDTO.getUsername())
                 .userNickName(userDTO.getNickname())
                 .regTime(userDTO.getCreateTime())
                 .banTime(LocalDateTime.now())
-                .status(param.getStatus())
+                .status(status)
+                .ip(userDTO.getIp())
+                .mac(userDTO.getMac())
+                .imei(userDTO.getImei())
+                .oaid(userDTO.getOaid())
+                .androidId(userDTO.getAndroidId())
+                .idfa(userDTO.getIdfa())
+                .caid(userDTO.getCaid())
                 .operateId(SecurityUtil.getUserId())
                 .operateName(SecurityUtil.getTokenInfo().getNickname())
                 .createTime(LocalDateTime.now())
                 .updateTime(LocalDateTime.now())
-                .build());
+                .build();
     }
 
 }

+ 40 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/UserBan.java

@@ -60,6 +60,46 @@ public class UserBan implements Serializable {
      */
     private Integer status;
 
+    /**
+     * 用户注册ip
+     */
+    private String ip;
+
+    /**
+     * 用户设备mac地址
+     */
+    private String mac;
+
+    /**
+     * 设备唯一编号IMEI
+     */
+    private String imei;
+
+    /**
+     * 设备OAID
+     */
+    private String oaid;
+
+    /**
+     * 安卓id, (仅安卓设备才有值)
+     */
+    private String androidId;
+
+    /**
+     * IOS设备IDFA
+     */
+    private String idfa;
+
+    /**
+     * IOS设备CAID
+     */
+    private String caid;
+
+    /**
+     * 身份证号
+     */
+    private String cardId;
+
     /**
      * 操作者id
      */