feat(api): 添加免费游戏记录查询功能
- 新增 GameFreeRecordResponse 类用于免费游戏记录响应- 修改 GameGetFreeSpinDashflowRequest 类,增加开始时间和结束时间字段 - 更新 getFreeSpinDashflow 方法,支持按时间筛选免费游戏记录 - 优化免费游戏记录查询结果,增加用户账号信息 - 修复获取用户信息的方法,使用正确的参数main-p
parent
d356c7ef9a
commit
dbfa47d548
|
@ -6,10 +6,7 @@ import cn.hutool.core.util.NumberUtil;
|
||||||
import com.dtflys.forest.annotation.Post;
|
import com.dtflys.forest.annotation.Post;
|
||||||
import com.ff.annotation.CheckHeader;
|
import com.ff.annotation.CheckHeader;
|
||||||
import com.ff.api.request.*;
|
import com.ff.api.request.*;
|
||||||
import com.ff.api.response.GameBettingDetailsResponse;
|
import com.ff.api.response.*;
|
||||||
import com.ff.api.response.GameExchangeBalanceResponse;
|
|
||||||
import com.ff.api.response.GameResponse;
|
|
||||||
import com.ff.api.response.MemberInfoAllResponse;
|
|
||||||
import com.ff.base.constant.Constants;
|
import com.ff.base.constant.Constants;
|
||||||
import com.ff.base.core.controller.BaseController;
|
import com.ff.base.core.controller.BaseController;
|
||||||
import com.ff.base.core.domain.AjaxResult;
|
import com.ff.base.core.domain.AjaxResult;
|
||||||
|
@ -336,6 +333,8 @@ public class ApiGameController extends BaseController {
|
||||||
@PostMapping("/get/detail")
|
@PostMapping("/get/detail")
|
||||||
public AjaxResult getDetail(@Validated @RequestBody GameGetDetailRequest gameGetDetailRequest) {
|
public AjaxResult getDetail(@Validated @RequestBody GameGetDetailRequest gameGetDetailRequest) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GameSecretKey gameSecretKey = gameSecretKeyService.findSecretKeyByPlatformAndSystemCode(gameGetDetailRequest.getPlatformCode(), gameGetDetailRequest.getCurrencyCode());
|
GameSecretKey gameSecretKey = gameSecretKeyService.findSecretKeyByPlatformAndSystemCode(gameGetDetailRequest.getPlatformCode(), gameGetDetailRequest.getCurrencyCode());
|
||||||
Assert.notNull(gameSecretKey, "货币游戏平台不存在");
|
Assert.notNull(gameSecretKey, "货币游戏平台不存在");
|
||||||
|
|
||||||
|
@ -414,12 +413,27 @@ public class ApiGameController extends BaseController {
|
||||||
@PostMapping("/get/free/spin/dashflow")
|
@PostMapping("/get/free/spin/dashflow")
|
||||||
public TableDataInfo getFreeSpinDashflow(@Validated @RequestBody GameGetFreeSpinDashflowRequest gameGetFreeSpinDashflowRequest) {
|
public TableDataInfo getFreeSpinDashflow(@Validated @RequestBody GameGetFreeSpinDashflowRequest gameGetFreeSpinDashflowRequest) {
|
||||||
PageHelper.startPage(gameGetFreeSpinDashflowRequest.getPageNo(), gameGetFreeSpinDashflowRequest.getPageSize(), "free_update_time desc");
|
PageHelper.startPage(gameGetFreeSpinDashflowRequest.getPageNo(), gameGetFreeSpinDashflowRequest.getPageSize(), "free_update_time desc");
|
||||||
List<GameFreeRecord> gameFreeRecords = gameFreeRecordService.selectGameFreeRecordList(GameFreeRecord.builder()
|
GameFreeRecord gameFreeRecord = GameFreeRecord.builder()
|
||||||
.gameId(gameGetFreeSpinDashflowRequest.getGameId())
|
.gameId(gameGetFreeSpinDashflowRequest.getGameId())
|
||||||
.platformCode(gameGetFreeSpinDashflowRequest.getPlatformCode())
|
.platformCode(gameGetFreeSpinDashflowRequest.getPlatformCode())
|
||||||
.currencyCode(gameGetFreeSpinDashflowRequest.getCurrencyCode())
|
.currencyCode(gameGetFreeSpinDashflowRequest.getCurrencyCode())
|
||||||
.build());
|
.build();
|
||||||
return getDataTable(gameFreeRecords);
|
|
||||||
|
Map<String, Object> params = gameFreeRecord.getParams();
|
||||||
|
params.put("beginTime", gameGetFreeSpinDashflowRequest.getBeginTime());
|
||||||
|
params.put("endTime", gameGetFreeSpinDashflowRequest.getEndTime());
|
||||||
|
List<GameFreeRecord> gameFreeRecords = gameFreeRecordService.selectGameFreeRecordList(gameFreeRecord);
|
||||||
|
TableDataInfo dataTable = getDataTable(gameFreeRecords);
|
||||||
|
List<GameFreeRecordResponse> result=new ArrayList<>();
|
||||||
|
for (GameFreeRecord row : (List<GameFreeRecord>) dataTable.getRows()) {
|
||||||
|
GameFreeRecordResponse gameFreeRecordResponse=new GameFreeRecordResponse();
|
||||||
|
BeanUtils.copyProperties(row, gameFreeRecordResponse);
|
||||||
|
Member member = memberService.selectMemberById(row.getMemberId());
|
||||||
|
gameFreeRecordResponse.setMemberAccount(member.getMemberAccount());
|
||||||
|
result.add(gameFreeRecordResponse);
|
||||||
|
}
|
||||||
|
dataTable.setRows(result);
|
||||||
|
return dataTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,17 @@ public class GameGetFreeSpinDashflowRequest implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Long gameId;
|
private Long gameId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间 毫秒时间戳
|
||||||
|
*/
|
||||||
|
@NotNull(message = "beginTime不能为空")
|
||||||
|
private Long beginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间 毫秒时间戳
|
||||||
|
*/
|
||||||
|
@NotNull(message = "endTime不能为空")
|
||||||
|
private Long endTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页码,默认第1页,按订单更新时间正序返回数据
|
* 页码,默认第1页,按订单更新时间正序返回数据
|
||||||
|
@ -47,6 +58,7 @@ public class GameGetFreeSpinDashflowRequest implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页容量,默认200,最大2000
|
* 页容量,默认200,最大2000
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.ff.api.response;
|
||||||
|
|
||||||
|
import com.ff.base.annotation.Excel;
|
||||||
|
import com.ff.base.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 免费赠送游戏记录对象 ff_game_free_record
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class GameFreeRecordResponse implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = -6742890807638586336L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 币种编码 */
|
||||||
|
private String currencyCode;
|
||||||
|
|
||||||
|
/** 平台代码 */
|
||||||
|
private String platformCode;
|
||||||
|
|
||||||
|
/** 免费局数序号(唯一标识符) */
|
||||||
|
private String referenceId;
|
||||||
|
|
||||||
|
|
||||||
|
/** 系统用户账号 */
|
||||||
|
private String memberAccount;
|
||||||
|
|
||||||
|
/** 游戏id */
|
||||||
|
private Long gameId;
|
||||||
|
|
||||||
|
/** 免费游戏局数可使用的开始时间 */
|
||||||
|
private Long sendTime;
|
||||||
|
|
||||||
|
/** 免费局数过期时间 */
|
||||||
|
private Long expiredTime;
|
||||||
|
|
||||||
|
/** 免费局数记录更新时间 */
|
||||||
|
private Long freeUpdateTime;
|
||||||
|
|
||||||
|
/** 免费局数赠送的游戏名称 */
|
||||||
|
private String sendGame;
|
||||||
|
|
||||||
|
/** 免费局数赠送的数量 */
|
||||||
|
private Integer sendAmount;
|
||||||
|
|
||||||
|
/** 已使用的免费局数数量 */
|
||||||
|
private Integer usedAmount;
|
||||||
|
|
||||||
|
/** 未使用的免费局数数量 */
|
||||||
|
private Integer unusedAmount;
|
||||||
|
|
||||||
|
/** 免费状态 1正常 0 取消 */
|
||||||
|
private Integer freeStatus;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -447,7 +447,7 @@ public class GamesJILIServiceImpl implements IGamesService {
|
||||||
|
|
||||||
//判断是否获取成功
|
//判断是否获取成功
|
||||||
if (this.getIsSuccess(createFreeSpinResponseDTO.getErrorCode())) {
|
if (this.getIsSuccess(createFreeSpinResponseDTO.getErrorCode())) {
|
||||||
Member member = memberService.selectMemberByGameAccount(createFreeSpinRequest.getAccount());
|
Member member = memberService.selectMemberByMemberAccount(createFreeSpinRequest.getAccount());
|
||||||
if (ObjectUtils.isEmpty(member)) {
|
if (ObjectUtils.isEmpty(member)) {
|
||||||
member = new Member();
|
member = new Member();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue