Преглед изворни кода

fix : 发码器后台代码提交

bilingfeng пре 5 месеци
родитељ
комит
3dd156a392
12 измењених фајлова са 294 додато и 7 уклоњено
  1. 1 1
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java
  2. 27 5
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GameGiftPackCodeController.java
  3. 37 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameGiftPackCodeLogListParam.java
  4. 37 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameGiftPackLinkLogListParam.java
  5. 69 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameGiftPackCodeLogVO.java
  6. 45 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameGiftPackLinkLogVO.java
  7. 11 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameGiftPackCodeLogService.java
  8. 11 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameGiftPackLinkLogService.java
  9. 18 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameGiftPackCodeLogServiceImpl.java
  10. 18 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameGiftPackLinkLogServiceImpl.java
  11. 10 1
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameGiftPackCodeLog.java
  12. 10 0
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameGiftPackLinkLog.java

+ 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服务启动成功 < (玩家渠道列表记录数据修正・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 < (发码器后台代码提交・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 27 - 5
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GameGiftPackCodeController.java

@@ -4,11 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.sd4324530.jtuple.Tuple3;
 import com.zanxiang.erp.security.annotation.PreAuthorize;
 import com.zanxiang.game.module.manage.pojo.params.*;
+import com.zanxiang.game.module.manage.pojo.vo.GameGiftPackCodeLogVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameGiftPackCodeVO;
+import com.zanxiang.game.module.manage.pojo.vo.GameGiftPackLinkLogVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameGiftPackLinkVO;
-import com.zanxiang.game.module.manage.service.IGameGiftPackCodeService;
-import com.zanxiang.game.module.manage.service.IGameGiftPackConfigService;
-import com.zanxiang.game.module.manage.service.IGameGiftPackLinkService;
+import com.zanxiang.game.module.manage.service.*;
 import com.zanxiang.module.util.pojo.ResultVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -25,10 +25,10 @@ import java.util.Map;
 /**
  * @author : lingfeng
  * @time : 2024-10-31
- * @description : 游戏礼包发码器
+ * @description : 游戏发码器
  */
 @Slf4j
-@Api(tags = {"游戏礼包发码器"})
+@Api(tags = {"游戏发码器"})
 @RestController
 @RequestMapping("/game/gift/pack")
 public class GameGiftPackCodeController {
@@ -42,6 +42,12 @@ public class GameGiftPackCodeController {
     @Autowired
     private IGameGiftPackConfigService gameGiftPackConfigService;
 
+    @Autowired
+    private IGameGiftPackLinkLogService gameGiftPackLinkLogService;
+
+    @Autowired
+    private IGameGiftPackCodeLogService gameGiftPackCodeLogService;
+
     @ApiOperation(value = "获取发码器配置")
     @GetMapping(value = "/config/list")
     @PreAuthorize(permissionKey = "manage:giftPack:configList")
@@ -105,4 +111,20 @@ public class GameGiftPackCodeController {
     public ResultVO<Boolean> updateGiftPackLin(@Validated @RequestBody GameGiftPackCodeUpdateParam param) {
         return ResultVO.ok(gameGiftPackCodeService.updateGiftPackCode(param));
     }
+
+    @ApiOperation(value = "查询链接访问记录")
+    @PostMapping(value = "/link/log/list")
+    @PreAuthorize(permissionKey = "manage:giftPack:linkLogList")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameGiftPackLinkLogVO.class)})
+    public ResultVO<IPage<GameGiftPackLinkLogVO>> linkLogList(@Validated @RequestBody GameGiftPackLinkLogListParam param) {
+        return ResultVO.ok(gameGiftPackLinkLogService.list(param));
+    }
+
+    @ApiOperation(value = "查询礼包码领取记录")
+    @PostMapping(value = "/code/log/list")
+    @PreAuthorize(permissionKey = "manage:giftPack:codeLogList")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameGiftPackCodeLogVO.class)})
+    public ResultVO<IPage<GameGiftPackCodeLogVO>> codeLogList(@Validated @RequestBody GameGiftPackCodeLogListParam param) {
+        return ResultVO.ok(gameGiftPackCodeLogService.list(param));
+    }
 }

+ 37 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameGiftPackCodeLogListParam.java

@@ -0,0 +1,37 @@
+package com.zanxiang.game.module.manage.pojo.params;
+
+import com.zanxiang.game.module.mybatis.entity.GameGiftPackCodeLog;
+import com.zanxiang.module.web.pojo.BaseListDTO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.time.LocalDate;
+
+/**
+ * @author : lingfeng
+ * @time : 2024-11-04
+ * @description : 礼包码领取查询记录参数
+ */
+@Data
+public class GameGiftPackCodeLogListParam extends BaseListDTO<GameGiftPackCodeLog> {
+
+    /**
+     * 链接id
+     */
+    @NotNull(message = "链接id不可为空")
+    @ApiModelProperty(notes = "链接id, 必传")
+    private Long linkId;
+
+    /**
+     * 创建开始时间
+     */
+    @ApiModelProperty(notes = "领取开始时间")
+    private LocalDate createBeginTime;
+
+    /**
+     * 创建结束时间
+     */
+    @ApiModelProperty(notes = "领取结束时间")
+    private LocalDate createEndTime;
+}

+ 37 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameGiftPackLinkLogListParam.java

@@ -0,0 +1,37 @@
+package com.zanxiang.game.module.manage.pojo.params;
+
+import com.zanxiang.game.module.mybatis.entity.GameGiftPackLinkLog;
+import com.zanxiang.module.web.pojo.BaseListDTO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.time.LocalDate;
+
+/**
+ * @author : lingfeng
+ * @time : 2024-11-04
+ * @description :
+ */
+@Data
+public class GameGiftPackLinkLogListParam extends BaseListDTO<GameGiftPackLinkLog> {
+
+    /**
+     * 链接id
+     */
+    @NotNull(message = "链接id不可为空")
+    @ApiModelProperty(notes = "链接id, 必传")
+    private Long linkId;
+
+    /**
+     * 创建开始时间
+     */
+    @ApiModelProperty(notes = "创建时间开始时间")
+    private LocalDate createBeginTime;
+
+    /**
+     * 创建结束时间
+     */
+    @ApiModelProperty(notes = "创建时间结束时间")
+    private LocalDate createEndTime;
+}

+ 69 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameGiftPackCodeLogVO.java

@@ -0,0 +1,69 @@
+package com.zanxiang.game.module.manage.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2024-11-04
+ * @description : 礼包码领取记录
+ */
+@Data
+public class GameGiftPackCodeLogVO {
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(notes = "主键id")
+    private Long id;
+
+    /**
+     * 礼包码
+     */
+    @ApiModelProperty(notes = "礼包码")
+    private String code;
+
+    /**
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Integer userId;
+
+    /**
+     * 角色id
+     */
+    @ApiModelProperty(notes = "角色id")
+    private String roleId;
+
+    /**
+     * 角色名称
+     */
+    @ApiModelProperty(notes = "角色名称")
+    private String roleName;
+
+    /**
+     * 企业id
+     */
+    @ApiModelProperty(notes = "企业id")
+    private String corpId;
+
+    /**
+     * 客服号id
+     */
+    @ApiModelProperty(notes = "客服号id")
+    private String corpUserId;
+
+    /**
+     * 企微用户id
+     */
+    @ApiModelProperty(notes = "企微用户id")
+    private String externalUserId;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(notes = "创建时间")
+    private LocalDateTime createTime;
+}

+ 45 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameGiftPackLinkLogVO.java

@@ -0,0 +1,45 @@
+package com.zanxiang.game.module.manage.pojo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2024-11-04
+ * @description : 链接访问记录
+ */
+@Data
+public class GameGiftPackLinkLogVO {
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(notes = "主键id")
+    private Long id;
+
+    /**
+     * 企业id
+     */
+    @ApiModelProperty(notes = "企业id")
+    private String corpId;
+
+    /**
+     * 客服号id
+     */
+    @ApiModelProperty(notes = "客服号id")
+    private String corpUserId;
+
+    /**
+     * 企微用户id
+     */
+    @ApiModelProperty(notes = "企微用户id")
+    private String externalUserId;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(notes = "创建时间")
+    private LocalDateTime createTime;
+}

+ 11 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameGiftPackCodeLogService.java

@@ -1,6 +1,9 @@
 package com.zanxiang.game.module.manage.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.game.module.manage.pojo.params.GameGiftPackCodeLogListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameGiftPackCodeLogVO;
 import com.zanxiang.game.module.mybatis.entity.GameGiftPackCodeLog;
 
 /**
@@ -9,4 +12,12 @@ import com.zanxiang.game.module.mybatis.entity.GameGiftPackCodeLog;
  * @description : 游戏礼包码领取日志
  */
 public interface IGameGiftPackCodeLogService extends IService<GameGiftPackCodeLog> {
+
+    /**
+     * 查询访问记录
+     *
+     * @param param : 查询参数
+     * @return : 返回访问记录列表
+     */
+    IPage<GameGiftPackCodeLogVO> list(GameGiftPackCodeLogListParam param);
 }

+ 11 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameGiftPackLinkLogService.java

@@ -1,6 +1,9 @@
 package com.zanxiang.game.module.manage.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.game.module.manage.pojo.params.GameGiftPackLinkLogListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameGiftPackLinkLogVO;
 import com.zanxiang.game.module.mybatis.entity.GameGiftPackLinkLog;
 
 /**
@@ -9,4 +12,12 @@ import com.zanxiang.game.module.mybatis.entity.GameGiftPackLinkLog;
  * @description : 游戏礼包码链接访问日志
  */
 public interface IGameGiftPackLinkLogService extends IService<GameGiftPackLinkLog> {
+
+    /**
+     * 分页查新访问记录
+     *
+     * @param param : 查询参数
+     * @return : 返回数据列表
+     */
+    IPage<GameGiftPackLinkLogVO> list(GameGiftPackLinkLogListParam param);
 }

+ 18 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameGiftPackCodeLogServiceImpl.java

@@ -1,11 +1,19 @@
 package com.zanxiang.game.module.manage.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.game.module.manage.pojo.params.GameGiftPackCodeLogListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameGiftPackCodeLogVO;
 import com.zanxiang.game.module.manage.service.IGameGiftPackCodeLogService;
 import com.zanxiang.game.module.mybatis.entity.GameGiftPackCodeLog;
 import com.zanxiang.game.module.mybatis.mapper.GameGiftPackCodeLogMapper;
+import com.zanxiang.module.util.bean.BeanUtil;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
 /**
  * @author : lingfeng
  * @time : 2022-06-22
@@ -14,4 +22,14 @@ import org.springframework.stereotype.Service;
 @Service
 public class GameGiftPackCodeLogServiceImpl extends ServiceImpl<GameGiftPackCodeLogMapper, GameGiftPackCodeLog> implements IGameGiftPackCodeLogService {
 
+    @Override
+    public IPage<GameGiftPackCodeLogVO> list(GameGiftPackCodeLogListParam param) {
+        return page(param.toPage(), new QueryWrapper<GameGiftPackCodeLog>().lambda()
+                .eq(GameGiftPackCodeLog::getLinkId, param.getLinkId())
+                .ge(param.getCreateBeginTime() != null, GameGiftPackCodeLog::getCreateTime, param.getCreateBeginTime() == null ? null : LocalDateTime.of(param.getCreateBeginTime(), LocalTime.MIN))
+                .le(param.getCreateEndTime() != null, GameGiftPackCodeLog::getCreateTime, param.getCreateEndTime() == null ? null : LocalDateTime.of(param.getCreateEndTime(), LocalTime.MAX))
+                .orderByDesc(GameGiftPackCodeLog::getCreateTime)
+        ).convert(log -> BeanUtil.copy(log, GameGiftPackCodeLogVO.class));
+    }
+
 }

+ 18 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameGiftPackLinkLogServiceImpl.java

@@ -1,11 +1,19 @@
 package com.zanxiang.game.module.manage.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.game.module.manage.pojo.params.GameGiftPackLinkLogListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameGiftPackLinkLogVO;
 import com.zanxiang.game.module.manage.service.IGameGiftPackLinkLogService;
 import com.zanxiang.game.module.mybatis.entity.GameGiftPackLinkLog;
 import com.zanxiang.game.module.mybatis.mapper.GameGiftPackLinkLogMapper;
+import com.zanxiang.module.util.bean.BeanUtil;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
 /**
  * @author : lingfeng
  * @time : 2022-06-22
@@ -14,6 +22,16 @@ import org.springframework.stereotype.Service;
 @Service
 public class GameGiftPackLinkLogServiceImpl extends ServiceImpl<GameGiftPackLinkLogMapper, GameGiftPackLinkLog> implements IGameGiftPackLinkLogService {
 
+    @Override
+    public IPage<GameGiftPackLinkLogVO> list(GameGiftPackLinkLogListParam param) {
+        return page(param.toPage(), new QueryWrapper<GameGiftPackLinkLog>().lambda()
+                .eq(GameGiftPackLinkLog::getLinkId, param.getLinkId())
+                .ge(param.getCreateBeginTime() != null, GameGiftPackLinkLog::getCreateTime, param.getCreateBeginTime() == null ? null : LocalDateTime.of(param.getCreateBeginTime(), LocalTime.MIN))
+                .le(param.getCreateEndTime() != null, GameGiftPackLinkLog::getCreateTime, param.getCreateEndTime() == null ? null : LocalDateTime.of(param.getCreateEndTime(), LocalTime.MAX))
+                .orderByDesc(GameGiftPackLinkLog::getCreateTime)
+        ).convert(log -> BeanUtil.copy(log, GameGiftPackLinkLogVO.class));
+    }
+
 }
 
 

+ 10 - 1
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameGiftPackCodeLog.java

@@ -7,7 +7,6 @@ import lombok.*;
 
 import java.io.Serializable;
 import java.time.LocalDateTime;
-import java.util.Date;
 
 /**
  * @author : lingfeng
@@ -75,8 +74,18 @@ public class GameGiftPackCodeLog implements Serializable {
      */
     private String externalUserId;
 
+    /**
+     * 关联访问记录id
+     */
+    private Long linkLogId;
+
     /**
      * 创建时间
      */
     private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
 }

+ 10 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameGiftPackLinkLog.java

@@ -54,8 +54,18 @@ public class GameGiftPackLinkLog implements Serializable {
      */
     private String externalUserId;
 
+    /**
+     * 关联code领取记录id
+     */
+    private Long codeLogId;
+
     /**
      * 创建时间
      */
     private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
 }