feat(api): 添加会员信息全部查询功能
- 新增 ApiGameController 中的 exchangeBalanceAll 方法 - 新增 ApiMemberController 中的 infoAll 方法 - 新增 ApiTenantController 类和 info 方法 - 添加相关请求和响应对象 - 修改 GameExchangeMoney 类和相关 mapper- 更新 HeaderCheckAspect 中的检查逻辑main-p
parent
4f39ae7038
commit
5526ad34c5
|
@ -61,6 +61,8 @@ public class HeaderCheckAspect {
|
|||
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(key);
|
||||
Assert.notNull(tenantSecretKey, "key不存在");
|
||||
|
||||
Assert.isTrue(tenantSecretKey.getTenantStatus(), "当前租户已停用");
|
||||
|
||||
String keyG = Md5Utils.md5New(random + key + tenantSecretKey.getTenantSecret());
|
||||
Assert.isTrue(keyG.equals(sign), "签名错误");
|
||||
//保存
|
||||
|
|
|
@ -7,11 +7,14 @@ import com.dtflys.forest.annotation.Post;
|
|||
import com.ff.annotation.CheckHeader;
|
||||
import com.ff.api.request.*;
|
||||
import com.ff.api.response.GameExchangeBalanceResponse;
|
||||
import com.ff.api.response.MemberInfoAllResponse;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
import com.ff.base.enums.OperationType;
|
||||
import com.ff.base.enums.TransferType;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||
|
@ -27,7 +30,10 @@ import com.ff.game.service.*;
|
|||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
@ -39,8 +45,11 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/**
|
||||
* api控制器
|
||||
|
@ -51,6 +60,7 @@ import java.util.Map;
|
|||
@RestController
|
||||
@CheckHeader
|
||||
@RequestMapping("/api/game")
|
||||
@Slf4j
|
||||
public class ApiGameController extends BaseController {
|
||||
|
||||
|
||||
|
@ -89,6 +99,10 @@ public class ApiGameController extends BaseController {
|
|||
@Resource
|
||||
private IGameExchangeMoneyService gameExchangeMoneyService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("threadPoolTaskExecutor")
|
||||
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
|
@ -187,7 +201,7 @@ public class ApiGameController extends BaseController {
|
|||
balanceRequestAmount = NumberUtil.sub(balanceOut, balanceInto);
|
||||
}
|
||||
}
|
||||
//余额扣除
|
||||
//租户余额操作
|
||||
tenantGameQuotaService.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(isOut)
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
|
@ -202,15 +216,15 @@ public class ApiGameController extends BaseController {
|
|||
.agentId(gameSecretKey.getCode())
|
||||
.agentKey(gameSecretKey.getKey())
|
||||
.account(member.getGameAccount())
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.quota(balanceRequestAmount)
|
||||
.amount(gameExchangeBalanceRequest.getAmount())
|
||||
.transferType(gameExchangeBalanceRequest.getTransferType())
|
||||
.orderId(gameExchangeBalanceRequest.getOrderId())
|
||||
.build();
|
||||
Long exchangeTransferId = iGamesService.exchangeTransferByAgentId(exchangeTransferMoneyRequestDTO);
|
||||
GameExchangeMoney gameExchangeMoney = gameExchangeMoneyService.selectGameExchangeMoneyById(exchangeTransferId);
|
||||
GameExchangeBalanceResponse gameExchangeBalanceResponse=new GameExchangeBalanceResponse();
|
||||
BeanUtils.copyProperties(gameExchangeMoney,gameExchangeBalanceResponse);
|
||||
GameExchangeBalanceResponse gameExchangeBalanceResponse = new GameExchangeBalanceResponse();
|
||||
BeanUtils.copyProperties(gameExchangeMoney, gameExchangeBalanceResponse);
|
||||
return AjaxResult.success(gameExchangeBalanceResponse);
|
||||
}
|
||||
|
||||
|
@ -261,7 +275,7 @@ public class ApiGameController extends BaseController {
|
|||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/get/bet/record")
|
||||
public TableDataInfo createFreeSpin(@Validated @RequestBody GameGetBetRecordRequest gameCreateFreeSpinRequest) {
|
||||
public TableDataInfo getBetRecord(@Validated @RequestBody GameGetBetRecordRequest gameCreateFreeSpinRequest) {
|
||||
startPage();
|
||||
PageHelper.startPage(gameCreateFreeSpinRequest.getPageNo(), gameCreateFreeSpinRequest.getPageSize(), "wagers_time desc");
|
||||
GameBettingDetails gameBettingDetails = GameBettingDetails.builder()
|
||||
|
@ -393,4 +407,110 @@ public class ApiGameController extends BaseController {
|
|||
.build());
|
||||
return AjaxResult.success(cancelFreeSpin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息全部
|
||||
*
|
||||
* @param gameExchangeBalanceAllRequest 成员信息所有api请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/exchange/balance/all")
|
||||
public AjaxResult exchangeBalanceAll(@Validated @RequestBody GameExchangeBalanceAllRequest gameExchangeBalanceAllRequest) {
|
||||
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
Member member = memberService.selectMemberByGameAccount(StringUtils.addSuffix(gameExchangeBalanceAllRequest.getAccount(), gameExchangeBalanceAllRequest.getCurrencyCode() + tenantSecretKey.getTenantSn()));
|
||||
Assert.notNull(member, "会员不存在");
|
||||
|
||||
|
||||
List<GameSecretKey> gameSecretKeys = gameSecretKeyService.selectGameSecretKeyList(GameSecretKey.builder().systemCode(gameExchangeBalanceAllRequest.getCurrencyCode()).build());
|
||||
|
||||
|
||||
// 创建线程池
|
||||
Map<String, BigDecimal> balanceMap = new LinkedHashMap<>();
|
||||
CountDownLatch latch = new CountDownLatch(gameSecretKeys.size());
|
||||
|
||||
// 使用List存储Future对象,用于获取异步执行的结果
|
||||
List<Future<Long>> futures = new ArrayList<>();
|
||||
|
||||
// 提交异步任务到线程池
|
||||
for (GameSecretKey gameSecretKey : gameSecretKeys) {
|
||||
futures.add(threadPoolTaskExecutor.submit(() -> {
|
||||
try {
|
||||
|
||||
IGamesService iGamesService = gamesService.get(gameSecretKey.getPlatform() + Constants.SERVICE);
|
||||
//操作第三方钱包
|
||||
ExchangeTransferMoneyRequestDTO exchangeTransferMoneyRequestDTO = ExchangeTransferMoneyRequestDTO.builder()
|
||||
.agentId(gameSecretKey.getCode())
|
||||
.agentKey(gameSecretKey.getKey())
|
||||
.amount(BigDecimal.ONE)
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.account(member.getGameAccount())
|
||||
.transferType(TransferType.ALL.getCode())
|
||||
.build();
|
||||
return iGamesService.exchangeTransferByAgentId(exchangeTransferMoneyRequestDTO);
|
||||
} catch (Exception e) {
|
||||
return 0L;
|
||||
} finally {
|
||||
latch.countDown(); // 任务完成后减少计数
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
BigDecimal balanceAll = BigDecimal.ZERO;
|
||||
|
||||
try {
|
||||
// 等待所有线程执行完毕
|
||||
latch.await();
|
||||
// 获取每个Future的结果
|
||||
for (Future<Long> future : futures) {
|
||||
// 汇总结果
|
||||
Long id = future.get();
|
||||
GameExchangeMoney gameExchangeMoney = gameExchangeMoneyService.selectGameExchangeMoneyById(id);
|
||||
if (ObjectUtils.isEmpty(gameExchangeMoney)) {
|
||||
continue;
|
||||
}
|
||||
balanceMap.put(gameExchangeMoney.getPlatformCode(), gameExchangeMoney.getBalance());
|
||||
BigDecimal balance = gameExchangeMoney.getBalance();
|
||||
balanceAll = NumberUtil.add(balanceAll, balance);
|
||||
//转入金额
|
||||
BigDecimal balanceInto = tenantGameQuotaFlowService.getBalanceByMemberId(TenantGameQuotaFlow.builder()
|
||||
.isOut(Boolean.TRUE)
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.memberId(member.getId())
|
||||
.build());
|
||||
//转出金额
|
||||
BigDecimal balanceOut = tenantGameQuotaFlowService.getBalanceByMemberId(TenantGameQuotaFlow.builder()
|
||||
.isOut(Boolean.FALSE)
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.memberId(member.getId())
|
||||
.build());
|
||||
//如果转入金额+本次转入金额 大于转出额度则取差值
|
||||
if (NumberUtil.add(balanceInto, balance).compareTo(NumberUtil.add(balanceOut, BigDecimal.ZERO)) > 0) {
|
||||
balance = NumberUtil.sub(balanceOut, balanceInto);
|
||||
}
|
||||
//更新租户额度
|
||||
gameExchangeMoney.setQuota(balance);
|
||||
gameExchangeMoneyService.updateGameExchangeMoney(gameExchangeMoney);
|
||||
|
||||
//余额扣除
|
||||
tenantGameQuotaService.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.TRUE)
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.balance(balance)
|
||||
.memberId(member.getId())
|
||||
.operationType(OperationType.API_BALANCE.getCode())
|
||||
.remark(OperationType.API_BALANCE.getDescription())
|
||||
.build());
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("拉回用户余额失败", e);
|
||||
throw new BaseException("拉回用户余额失败");
|
||||
}
|
||||
balanceMap.put("balanceAll", balanceAll);
|
||||
|
||||
|
||||
return AjaxResult.success(balanceMap);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +1,47 @@
|
|||
package com.ff.api.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ff.annotation.CheckHeader;
|
||||
import com.ff.api.request.MemberCreateApiRequest;
|
||||
import com.ff.api.request.MemberInfoAllApiRequest;
|
||||
import com.ff.api.request.MemberInfoApiRequest;
|
||||
import com.ff.api.response.MemberInfoAllResponse;
|
||||
import com.ff.api.response.MemberInfoResponse;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.manager.AsyncManager;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
import com.ff.config.KeyConfig;
|
||||
import com.ff.game.api.IGamesService;
|
||||
import com.ff.game.api.request.CreateMemberRequestDTO;
|
||||
import com.ff.game.api.request.GamesBaseRequestDTO;
|
||||
import com.ff.game.api.request.MemberInfoRequestDTO;
|
||||
import com.ff.game.api.request.*;
|
||||
import com.ff.game.domain.GameSecretKey;
|
||||
import com.ff.game.service.IGameSecretKeyService;
|
||||
import com.ff.game.service.IGameService;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/**
|
||||
* api控制器
|
||||
|
@ -37,6 +52,7 @@ import java.util.Map;
|
|||
@RestController
|
||||
@CheckHeader
|
||||
@RequestMapping("/api/member")
|
||||
@Slf4j
|
||||
public class ApiMemberController extends BaseController {
|
||||
|
||||
|
||||
|
@ -58,6 +74,10 @@ public class ApiMemberController extends BaseController {
|
|||
private IMemberService memberService;
|
||||
|
||||
|
||||
@Autowired
|
||||
@Qualifier("threadPoolTaskExecutor")
|
||||
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
||||
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
|
@ -106,20 +126,20 @@ public class ApiMemberController extends BaseController {
|
|||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param memberCreateApiRequest 成员创建api请求
|
||||
* @param memberInfoApiRequest 成员信息api请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/info")
|
||||
public AjaxResult getMemberInfo(@Validated @RequestBody MemberCreateApiRequest memberCreateApiRequest) {
|
||||
IGamesService iGamesService = gamesService.get(memberCreateApiRequest.getPlatformCode() + Constants.SERVICE);
|
||||
public AjaxResult getMemberInfo(@Validated @RequestBody MemberInfoApiRequest memberInfoApiRequest) {
|
||||
IGamesService iGamesService = gamesService.get(memberInfoApiRequest.getPlatformCode() + Constants.SERVICE);
|
||||
Assert.notNull(iGamesService, "平台不存在");
|
||||
|
||||
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
GameSecretKey gameSecretKey = gameSecretKeyService.findSecretKeyByPlatformAndSystemCode(memberCreateApiRequest.getPlatformCode(), memberCreateApiRequest.getCurrencyCode());
|
||||
GameSecretKey gameSecretKey = gameSecretKeyService.findSecretKeyByPlatformAndSystemCode(memberInfoApiRequest.getPlatformCode(), memberInfoApiRequest.getCurrencyCode());
|
||||
Assert.notNull(gameSecretKey, "货币游戏平台不存在");
|
||||
|
||||
Member member = memberService.selectMemberByGameAccount(StringUtils.addSuffix(memberCreateApiRequest.getAccount(), memberCreateApiRequest.getCurrencyCode() + tenantSecretKey.getTenantSn()));
|
||||
Member member = memberService.selectMemberByGameAccount(StringUtils.addSuffix(memberInfoApiRequest.getAccount(), memberInfoApiRequest.getCurrencyCode() + tenantSecretKey.getTenantSn()));
|
||||
Assert.notNull(member, "会员不存在");
|
||||
|
||||
//向第三方查询账号
|
||||
|
@ -128,8 +148,81 @@ public class ApiMemberController extends BaseController {
|
|||
.agentId(gameSecretKey.getCode())
|
||||
.agentKey(gameSecretKey.getKey())
|
||||
.build();
|
||||
return AjaxResult.success(iGamesService.getMemberInfo(gamesBaseRequestDTO));
|
||||
MemberInfoResponseDTO memberInfo = iGamesService.getMemberInfo(gamesBaseRequestDTO);
|
||||
MemberInfoResponse memberInfoResponse=new MemberInfoResponse();
|
||||
BeanUtils.copyProperties(memberInfo,memberInfoResponse);
|
||||
return AjaxResult.success(memberInfoResponse);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息全部
|
||||
*
|
||||
* @param memberInfoAllApiRequest 成员信息所有api请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/info/all")
|
||||
public AjaxResult infoAll(@Validated @RequestBody MemberInfoAllApiRequest memberInfoAllApiRequest) {
|
||||
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
Member member = memberService.selectMemberByGameAccount(StringUtils.addSuffix(memberInfoAllApiRequest.getAccount(), memberInfoAllApiRequest.getCurrencyCode() + tenantSecretKey.getTenantSn()));
|
||||
Assert.notNull(member, "会员不存在");
|
||||
|
||||
|
||||
List<GameSecretKey> gameSecretKeys = gameSecretKeyService.selectGameSecretKeyList(GameSecretKey.builder().systemCode(memberInfoAllApiRequest.getCurrencyCode()).build());
|
||||
|
||||
|
||||
// 创建线程池
|
||||
Map<String, BigDecimal> balanceMap = new LinkedHashMap<>();
|
||||
CountDownLatch latch = new CountDownLatch(gameSecretKeys.size());
|
||||
|
||||
// 使用List存储Future对象,用于获取异步执行的结果
|
||||
List<Future<MemberInfoAllResponse>> futures = new ArrayList<>();
|
||||
|
||||
// 提交异步任务到线程池
|
||||
for (GameSecretKey gameSecretKey : gameSecretKeys) {
|
||||
futures.add(threadPoolTaskExecutor.submit(() -> {
|
||||
try {
|
||||
IGamesService iGamesService = gamesService.get(gameSecretKey.getPlatform() + Constants.SERVICE);
|
||||
MemberInfoRequestDTO gamesBaseRequestDTO = MemberInfoRequestDTO.builder()
|
||||
.accounts(member.getGameAccount())
|
||||
.agentId(gameSecretKey.getCode())
|
||||
.agentKey(gameSecretKey.getKey())
|
||||
.build();
|
||||
//查询余额
|
||||
MemberInfoResponseDTO memberInfo = iGamesService.getMemberInfo(gamesBaseRequestDTO);
|
||||
return MemberInfoAllResponse.builder()
|
||||
.account(member.getGameAccount())
|
||||
.balance(memberInfo.getBalance())
|
||||
.status(memberInfo.getStatus())
|
||||
.platformCode(gameSecretKey.getPlatform())
|
||||
.build();
|
||||
} finally {
|
||||
latch.countDown(); // 任务完成后减少计数
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
// 等待所有线程执行完毕
|
||||
try {
|
||||
latch.await();
|
||||
// 获取每个Future的结果
|
||||
for (Future<MemberInfoAllResponse> future : futures) {
|
||||
// 汇总结果
|
||||
MemberInfoAllResponse memberInfoAllResponse = future.get();
|
||||
balanceMap.put(memberInfoAllResponse.getPlatformCode(), memberInfoAllResponse.getBalance());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("获取会员信息失败", e);
|
||||
throw new BaseException("获取会员信息失败");
|
||||
}
|
||||
|
||||
|
||||
return AjaxResult.success(balanceMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
package com.ff.api.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.ff.annotation.CheckHeader;
|
||||
import com.ff.api.request.*;
|
||||
import com.ff.api.response.GameExchangeBalanceResponse;
|
||||
import com.ff.api.response.TenantInfoResponse;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
import com.ff.base.enums.OperationType;
|
||||
import com.ff.base.enums.TenantQuotaType;
|
||||
import com.ff.base.enums.TransferType;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.common.domain.TenantGameQuota;
|
||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import com.ff.config.KeyConfig;
|
||||
import com.ff.game.api.IGamesService;
|
||||
import com.ff.game.api.request.*;
|
||||
import com.ff.game.domain.*;
|
||||
import com.ff.game.service.*;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/**
|
||||
* api控制器
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@RestController
|
||||
@CheckHeader
|
||||
@RequestMapping("/api/tenant")
|
||||
@Slf4j
|
||||
public class ApiTenantController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ITenantGameQuotaService tenantGameQuotaService;
|
||||
@Resource
|
||||
private KeyConfig keyConfig;
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/info")
|
||||
public AjaxResult info() {
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
TenantGameQuota tenantGameQuota = tenantGameQuotaService.selectTenantGameQuotaByTenantKey(tenantSecretKey.getTenantKey(), TenantQuotaType.BALANCE.getCode());
|
||||
TenantInfoResponse tenantInfoResponse= new TenantInfoResponse();
|
||||
BeanUtils.copyProperties(tenantGameQuota,tenantInfoResponse);
|
||||
return AjaxResult.success(tenantInfoResponse);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏兑换余额请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/11
|
||||
*/
|
||||
@Data
|
||||
public class GameExchangeBalanceAllRequest implements Serializable {
|
||||
private final static long serialVersionUID = -881298930995538038L;
|
||||
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
@NotBlank(message = "account不能为空")
|
||||
private String account;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 币种编码 */
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
private String currencyCode;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -57,12 +57,6 @@ public class GameExchangeBalanceRequest implements Serializable {
|
|||
@Max(value = 2, message = "transferType最大值为2")
|
||||
private Integer transferType;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@NotBlank(message = "orderId不能为空")
|
||||
@Length(min = 32,max = 32, message = "orderId长度不能超过32个字符")
|
||||
private String orderId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 创建成员请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Data
|
||||
public class MemberInfoAllApiRequest implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 8071608271351542925L;
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
@NotBlank(message = "account不能为空")
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 货币代码
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
private String currencyCode;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.ff.api.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录对象 ff_game_exchange_money
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class MemberInfoAllResponse implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 状态:
|
||||
* 1: 在线
|
||||
* 2: 脱机
|
||||
* 3: 账号不存在
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 平台代码
|
||||
*/
|
||||
private String platformCode;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.ff.api.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录对象 ff_game_exchange_money
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class MemberInfoResponse implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 状态:
|
||||
* 1: 在线
|
||||
* 2: 脱机
|
||||
* 3: 账号不存在
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.ff.api.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 租户信息
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/14
|
||||
*/
|
||||
@Data
|
||||
public class TenantInfoResponse implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 租户密钥
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
|
||||
}
|
|
@ -8,13 +8,11 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 租户游戏配额对象 ff_tenant_game_quota
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
* @date 2025-02-14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
@ -35,7 +33,9 @@ public class TenantGameQuota extends BaseEntity
|
|||
@Excel(name = "游戏额度")
|
||||
private BigDecimal balance;
|
||||
|
||||
|
||||
/** 额度类型 TenantQuotaType 枚举 */
|
||||
@Excel(name = "额度类型 TenantQuotaType 枚举")
|
||||
private Integer quotaType;
|
||||
|
||||
/** 版本号 */
|
||||
@Excel(name = "版本号")
|
||||
|
|
|
@ -2,14 +2,21 @@ package com.ff.common.domain;
|
|||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 用户租户密钥对象 ff_tenant_secret_key
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-11
|
||||
* @date 2025-02-14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantSecretKey extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -29,9 +36,12 @@ public class TenantSecretKey extends BaseEntity
|
|||
@Excel(name = "租户密钥")
|
||||
private String tenantSecret;
|
||||
|
||||
/** 租户状态(0正常 1停用) */
|
||||
@Excel(name = "租户状态", readConverterExp = "0=正常,1=停用")
|
||||
private String tenantStatus;
|
||||
/** 租户状态 1正常 0停用 */
|
||||
private Boolean tenantStatus;
|
||||
|
||||
/** 租户类型 TenantType 枚举 */
|
||||
@Excel(name = "租户类型 TenantType 枚举")
|
||||
private Integer tenantType;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.ff.common.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.common.domain.TenantGameQuota;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 租户游戏配额Mapper接口
|
||||
|
@ -9,24 +11,23 @@ import com.ff.common.domain.TenantGameQuota;
|
|||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
public interface TenantGameQuotaMapper
|
||||
{
|
||||
public interface TenantGameQuotaMapper {
|
||||
/**
|
||||
* 查询租户游戏配额
|
||||
*
|
||||
* @param id 租户游戏配额主键
|
||||
* @return 租户游戏配额
|
||||
*/
|
||||
TenantGameQuota selectTenantGameQuotaById(Long id);
|
||||
TenantGameQuota selectTenantGameQuotaById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询租户游戏配额
|
||||
*
|
||||
* @param tenantKey 租户游戏配额主键
|
||||
* @return 租户游戏配额
|
||||
*/
|
||||
TenantGameQuota selectTenantGameQuotaByTenantKey(String tenantKey);
|
||||
TenantGameQuota selectTenantGameQuotaByTenantKey(@Param("tenantKey") String tenantKey,@Param("quotaType") Integer quotaType);
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额列表
|
||||
|
@ -34,7 +35,7 @@ public interface TenantGameQuotaMapper
|
|||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 租户游戏配额集合
|
||||
*/
|
||||
List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota);
|
||||
List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota);
|
||||
|
||||
/**
|
||||
* 新增租户游戏配额
|
||||
|
@ -42,7 +43,7 @@ public interface TenantGameQuotaMapper
|
|||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||
int insertTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||
|
||||
/**
|
||||
* 修改租户游戏配额
|
||||
|
@ -50,7 +51,7 @@ public interface TenantGameQuotaMapper
|
|||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||
int updateTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -67,7 +68,7 @@ public interface TenantGameQuotaMapper
|
|||
* @param id 租户游戏配额主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaById(Long id);
|
||||
int deleteTenantGameQuotaById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除租户游戏配额
|
||||
|
@ -75,5 +76,5 @@ public interface TenantGameQuotaMapper
|
|||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaByIds(Long[] ids);
|
||||
int deleteTenantGameQuotaByIds(Long[] ids);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ff.common.service;
|
|||
import java.util.List;
|
||||
import com.ff.common.domain.TenantGameQuota;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 租户游戏配额Service接口
|
||||
|
@ -67,4 +68,13 @@ public interface ITenantGameQuotaService
|
|||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean balanceChanges(BalanceChangesDTO balanceChangesDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额
|
||||
*
|
||||
* @param tenantKey 租户游戏配额主键
|
||||
* @return 租户游戏配额
|
||||
*/
|
||||
TenantGameQuota selectTenantGameQuotaByTenantKey(String tenantKey, Integer quotaType);
|
||||
}
|
||||
|
|
|
@ -5,10 +5,13 @@ import java.util.List;
|
|||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.enums.TenantQuotaType;
|
||||
import com.ff.base.enums.TenantType;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.SecurityUtils;
|
||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import com.ff.common.mapper.TenantGameQuotaFlowMapper;
|
||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||
|
@ -30,8 +33,7 @@ import javax.annotation.Resource;
|
|||
* @date 2025-02-12
|
||||
*/
|
||||
@Service
|
||||
public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
||||
{
|
||||
public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService {
|
||||
@Autowired
|
||||
private TenantGameQuotaMapper tenantGameQuotaMapper;
|
||||
|
||||
|
@ -39,6 +41,8 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
@Resource
|
||||
private ITenantGameQuotaFlowService tenantGameQuotaFlowService;
|
||||
|
||||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额
|
||||
|
@ -47,8 +51,7 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
* @return 租户游戏配额
|
||||
*/
|
||||
@Override
|
||||
public TenantGameQuota selectTenantGameQuotaById(Long id)
|
||||
{
|
||||
public TenantGameQuota selectTenantGameQuotaById(Long id) {
|
||||
return tenantGameQuotaMapper.selectTenantGameQuotaById(id);
|
||||
}
|
||||
|
||||
|
@ -59,8 +62,7 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
* @return 租户游戏配额
|
||||
*/
|
||||
@Override
|
||||
public List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota)
|
||||
{
|
||||
public List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota) {
|
||||
return tenantGameQuotaMapper.selectTenantGameQuotaList(tenantGameQuota);
|
||||
}
|
||||
|
||||
|
@ -71,8 +73,7 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantGameQuota(TenantGameQuota tenantGameQuota)
|
||||
{
|
||||
public int insertTenantGameQuota(TenantGameQuota tenantGameQuota) {
|
||||
tenantGameQuota.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantGameQuotaMapper.insertTenantGameQuota(tenantGameQuota);
|
||||
}
|
||||
|
@ -84,8 +85,7 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantGameQuota(TenantGameQuota tenantGameQuota)
|
||||
{
|
||||
public int updateTenantGameQuota(TenantGameQuota tenantGameQuota) {
|
||||
tenantGameQuota.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantGameQuotaMapper.updateTenantGameQuota(tenantGameQuota);
|
||||
}
|
||||
|
@ -97,8 +97,7 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantGameQuotaByIds(Long[] ids)
|
||||
{
|
||||
public int deleteTenantGameQuotaByIds(Long[] ids) {
|
||||
return tenantGameQuotaMapper.deleteTenantGameQuotaByIds(ids);
|
||||
}
|
||||
|
||||
|
@ -109,8 +108,7 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantGameQuotaById(Long id)
|
||||
{
|
||||
public int deleteTenantGameQuotaById(Long id) {
|
||||
return tenantGameQuotaMapper.deleteTenantGameQuotaById(id);
|
||||
}
|
||||
|
||||
|
@ -122,11 +120,12 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
*/
|
||||
@Override
|
||||
public Boolean balanceChanges(BalanceChangesDTO balanceChangesDTO) {
|
||||
TenantGameQuota tenantGameQuota = tenantGameQuotaMapper.selectTenantGameQuotaByTenantKey(balanceChangesDTO.getTenantKey());
|
||||
TenantGameQuota tenantGameQuota = tenantGameQuotaMapper.selectTenantGameQuotaByTenantKey(balanceChangesDTO.getTenantKey(), TenantQuotaType.BALANCE.getCode());
|
||||
|
||||
Assert.isTrue(!ObjectUtils.isEmpty(tenantGameQuota), "余额额度不足");
|
||||
|
||||
BigDecimal balanceBefore = tenantGameQuota.getBalance();
|
||||
BigDecimal balance =balanceChangesDTO.getBalance();
|
||||
BigDecimal balance = balanceChangesDTO.getBalance();
|
||||
if (BigDecimal.ZERO.compareTo(balance) >= 0) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
@ -138,11 +137,23 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
balanceAfter = NumberUtil.sub(balanceBefore, balance);
|
||||
}
|
||||
//判断剩余额度是否大于0
|
||||
Assert.isTrue(balanceAfter.compareTo(BigDecimal.ZERO)>=0, "余额额度不足");
|
||||
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(balanceChangesDTO.getTenantKey());
|
||||
if (TenantType.DEPOSIT.getCode().equals(tenantSecretKey.getTenantType())) {
|
||||
TenantGameQuota depositQuota = tenantGameQuotaMapper.selectTenantGameQuotaByTenantKey(balanceChangesDTO.getTenantKey(), TenantQuotaType.DEPOSIT.getCode());
|
||||
|
||||
//判断剩余额度是否大于0
|
||||
Assert.isTrue(balanceAfter.compareTo(depositQuota.getBalance().negate()) >= 0, "余额额度不足");
|
||||
} else {
|
||||
//判断剩余额度是否大于0
|
||||
Assert.isTrue(balanceAfter.compareTo(BigDecimal.ZERO) >= 0, "余额额度不足");
|
||||
}
|
||||
|
||||
|
||||
//修改余额
|
||||
Boolean changedBalanceResult = tenantGameQuotaMapper.changeBalance(TenantGameQuota.builder()
|
||||
.tenantKey(balanceChangesDTO.getTenantKey())
|
||||
.balance(balanceAfter)
|
||||
.quotaType(TenantQuotaType.BALANCE.getCode())
|
||||
.version(tenantGameQuota.getVersion())
|
||||
.build());
|
||||
Assert.isTrue(changedBalanceResult, "租户游戏额度操作失败");
|
||||
|
@ -163,4 +174,16 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService
|
|||
tenantGameQuotaFlowService.insertTenantGameQuotaFlow(tenantGameQuotaFlow);
|
||||
return changedBalanceResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按租户密钥选择租户游戏配额
|
||||
*
|
||||
* @param tenantKey 租户密钥
|
||||
* @param quotaType 配额类型
|
||||
* @return {@link TenantGameQuota }
|
||||
*/
|
||||
@Override
|
||||
public TenantGameQuota selectTenantGameQuotaByTenantKey(String tenantKey, Integer quotaType) {
|
||||
return tenantGameQuotaMapper.selectTenantGameQuotaByTenantKey(tenantKey, quotaType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -293,27 +293,20 @@ public class GamesJILIServiceImpl implements IGamesService {
|
|||
String systemByCode = gameSecretKeyService.findSystemByCode(exchangeTransferMoneyRequestDTO.getAgentId(), GamePlatforms.JILI.getInfo());
|
||||
Member member = memberService.selectMemberByGameAccount(exchangeTransferMoneyRequestDTO.getAccount());
|
||||
String transactionId = GamePlatforms.JILI.getCode() + IdUtils.simpleUUID();
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
List<GameExchangeMoney> gameExchangeMonies = gameExchangeMoneyService.selectGameExchangeMoneyList(
|
||||
GameExchangeMoney.builder()
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.orderId(exchangeTransferMoneyRequestDTO.getOrderId())
|
||||
.build()
|
||||
);
|
||||
Assert.isTrue(CollectionUtils.isEmpty(gameExchangeMonies), "订单号重复");
|
||||
|
||||
|
||||
|
||||
|
||||
//获取下一个自增id
|
||||
GameExchangeMoney exchangeMoney = GameExchangeMoney
|
||||
.builder()
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.tenantKey(exchangeTransferMoneyRequestDTO.getTenantKey())
|
||||
.quota(exchangeTransferMoneyRequestDTO.getQuota())
|
||||
.balance(exchangeTransferMoneyRequestDTO.getAmount())
|
||||
.exchangeType(exchangeTransferMoneyRequestDTO.getTransferType())
|
||||
.currencyCode(systemByCode)
|
||||
.memberId(member.getId())
|
||||
.transactionId(transactionId)
|
||||
.orderId(exchangeTransferMoneyRequestDTO.getOrderId())
|
||||
.platformCode(GamePlatforms.JILI.getCode())
|
||||
.build();
|
||||
exchangeMoney.setCreateBy(Constants.SYSTEM);
|
||||
|
|
|
@ -27,7 +27,10 @@ public class ExchangeTransferMoneyRequestDTO extends GamesBaseRequestDTO {
|
|||
*/
|
||||
private String account;
|
||||
|
||||
|
||||
/**
|
||||
* 租户密钥
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -51,8 +54,4 @@ public class ExchangeTransferMoneyRequestDTO extends GamesBaseRequestDTO {
|
|||
*/
|
||||
private Integer transferType;
|
||||
|
||||
/**
|
||||
* 交易id
|
||||
*/
|
||||
private String orderId;
|
||||
}
|
||||
|
|
|
@ -303,25 +303,16 @@ public class GamesXKServiceImpl implements IGamesService {
|
|||
String systemByCode = gameSecretKeyService.findSystemByCode(exchangeTransferMoneyRequestDTO.getAgentId(), GamePlatforms.XK.getInfo());
|
||||
Member member = memberService.selectMemberByGameAccount(exchangeTransferMoneyRequestDTO.getAccount());
|
||||
String transactionId = GamePlatforms.XK.getCode() + IdUtils.simpleUUID();
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
List<GameExchangeMoney> gameExchangeMonies = gameExchangeMoneyService.selectGameExchangeMoneyList(
|
||||
GameExchangeMoney.builder()
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.orderId(exchangeTransferMoneyRequestDTO.getOrderId())
|
||||
.build()
|
||||
);
|
||||
Assert.isTrue(CollectionUtils.isEmpty(gameExchangeMonies), "订单号重复");
|
||||
//获取下一个自增id
|
||||
GameExchangeMoney exchangeMoney = GameExchangeMoney
|
||||
.builder()
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.tenantKey(exchangeTransferMoneyRequestDTO.getTenantKey())
|
||||
.quota(exchangeTransferMoneyRequestDTO.getQuota())
|
||||
.balance(exchangeTransferMoneyRequestDTO.getAmount())
|
||||
.exchangeType(exchangeTransferMoneyRequestDTO.getTransferType())
|
||||
.currencyCode(systemByCode)
|
||||
.memberId(member.getId())
|
||||
.transactionId(transactionId)
|
||||
.orderId(exchangeTransferMoneyRequestDTO.getOrderId())
|
||||
.platformCode(GamePlatforms.XK.getCode())
|
||||
.build();
|
||||
exchangeMoney.setCreateBy(Constants.SYSTEM);
|
||||
|
|
|
@ -69,9 +69,7 @@ public class GameExchangeMoney extends BaseEntity
|
|||
@Excel(name = "转账后金额(指定货币)")
|
||||
private BigDecimal currencyAfter;
|
||||
|
||||
/** 系统订单id */
|
||||
@Excel(name = "系统订单id")
|
||||
private String orderId;
|
||||
|
||||
|
||||
/** 转出类型 1游戏商转入到用户全部转出 2 用户转移到游戏商 3 游戏商转移额度到平台商 */
|
||||
@Excel(name = "转出类型 1游戏商转入到用户全部转出 2 用户转移到游戏商 3 游戏商转移额度到平台商")
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
</delete>
|
||||
|
||||
<select id="getBalanceByMemberId" parameterType="TenantGameQuotaFlow" resultType="java.math.BigDecimal">
|
||||
select sum(balance) from ff_tenant_game_quota_flow
|
||||
select ifnull(sum(balance),0) from ff_tenant_game_quota_flow
|
||||
<where>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ff.common.mapper.TenantGameQuotaMapper">
|
||||
|
||||
<resultMap type="TenantGameQuota" id="TenantGameQuotaResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tenantKey" column="tenant_key" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="quotaType" column="quota_type" />
|
||||
<result property="version" column="version" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
|
@ -16,14 +17,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectTenantGameQuotaVo">
|
||||
select id, tenant_key, balance, version, create_by, create_time, update_by, update_time from ff_tenant_game_quota
|
||||
select id, tenant_key, balance, quota_type, version, create_by, create_time, update_by, update_time from ff_tenant_game_quota
|
||||
</sql>
|
||||
|
||||
<select id="selectTenantGameQuotaByTenantKey" resultMap="TenantGameQuotaResult">
|
||||
<include refid="selectTenantGameQuotaVo"/>
|
||||
where tenant_key = #{tenantKey} and quota_type = #{quotaType}
|
||||
</select>
|
||||
|
||||
<select id="selectTenantGameQuotaList" parameterType="TenantGameQuota" resultMap="TenantGameQuotaResult">
|
||||
<include refid="selectTenantGameQuotaVo"/>
|
||||
<where>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||
<if test="balance != null "> and balance = #{balance}</if>
|
||||
<if test="quotaType != null "> and quota_type = #{quotaType}</if>
|
||||
<if test="version != null "> and version = #{version}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
@ -33,31 +40,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectTenantGameQuotaByTenantKey" parameterType="String" resultMap="TenantGameQuotaResult">
|
||||
<include refid="selectTenantGameQuotaVo"/>
|
||||
where tenant_key = #{tenantKey}
|
||||
</select>
|
||||
<update id="changeBalance" parameterType="TenantGameQuota">
|
||||
update ff_tenant_game_quota set balance = #{balance},version =version+1
|
||||
where tenant_key = #{tenantKey} and quota_type = #{quotaType} and version = #{version}
|
||||
</update>
|
||||
|
||||
<insert id="insertTenantGameQuota" parameterType="TenantGameQuota" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ff_tenant_game_quota
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
||||
<if test="balance != null">balance,</if>
|
||||
<if test="quotaType != null">quota_type,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
||||
<if test="balance != null">#{balance},</if>
|
||||
<if test="quotaType != null">#{quotaType},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTenantGameQuota" parameterType="TenantGameQuota">
|
||||
|
@ -65,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key = #{tenantKey},</if>
|
||||
<if test="balance != null">balance = #{balance},</if>
|
||||
<if test="quotaType != null">quota_type = #{quotaType},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
|
@ -74,13 +84,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="changeBalance" parameterType="TenantGameQuota">
|
||||
update ff_tenant_game_quota set balance = #{balance},version =version+1
|
||||
where tenant_key = #{tenantKey} and version = #{version}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteTenantGameQuotaById" parameterType="Long">
|
||||
delete from ff_tenant_game_quota where id = #{id}
|
||||
</delete>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ff.common.mapper.TenantSecretKeyMapper">
|
||||
|
||||
<resultMap type="TenantSecretKey" id="TenantSecretKeyResult">
|
||||
|
@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="tenantSn" column="tenant_sn" />
|
||||
<result property="tenantSecret" column="tenant_secret" />
|
||||
<result property="tenantStatus" column="tenant_status" />
|
||||
<result property="tenantType" column="tenant_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
@ -17,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectTenantSecretKeyVo">
|
||||
select id, tenant_key, tenant_sn, tenant_secret, tenant_status, create_by, create_time, update_by, update_time from ff_tenant_secret_key
|
||||
select id, tenant_key, tenant_sn, tenant_secret, tenant_status, tenant_type, create_by, create_time, update_by, update_time from ff_tenant_secret_key
|
||||
</sql>
|
||||
|
||||
<select id="selectTenantSecretKeyList" parameterType="TenantSecretKey" resultMap="TenantSecretKeyResult">
|
||||
|
@ -26,7 +27,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||
<if test="tenantSn != null and tenantSn != ''"> and tenant_sn = #{tenantSn}</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''"> and tenant_secret = #{tenantSecret}</if>
|
||||
<if test="tenantStatus != null and tenantStatus != ''"> and tenant_status = #{tenantStatus}</if>
|
||||
<if test="tenantStatus != null "> and tenant_status = #{tenantStatus}</if>
|
||||
<if test="tenantType != null "> and tenant_type = #{tenantType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -46,22 +48,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
||||
<if test="tenantSn != null">tenant_sn,</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''">tenant_secret,</if>
|
||||
<if test="tenantStatus != null and tenantStatus != ''">tenant_status,</if>
|
||||
<if test="tenantStatus != null">tenant_status,</if>
|
||||
<if test="tenantType != null">tenant_type,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
||||
<if test="tenantSn != null">#{tenantSn},</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''">#{tenantSecret},</if>
|
||||
<if test="tenantStatus != null and tenantStatus != ''">#{tenantStatus},</if>
|
||||
<if test="tenantStatus != null">#{tenantStatus},</if>
|
||||
<if test="tenantType != null">#{tenantType},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTenantSecretKey" parameterType="TenantSecretKey">
|
||||
|
@ -70,7 +74,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="tenantKey != null and tenantKey != ''">tenant_key = #{tenantKey},</if>
|
||||
<if test="tenantSn != null">tenant_sn = #{tenantSn},</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''">tenant_secret = #{tenantSecret},</if>
|
||||
<if test="tenantStatus != null and tenantStatus != ''">tenant_status = #{tenantStatus},</if>
|
||||
<if test="tenantStatus != null">tenant_status = #{tenantStatus},</if>
|
||||
<if test="tenantType != null">tenant_type = #{tenantType},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
<result property="coinAfter" column="coin_after" />
|
||||
<result property="currencyBefore" column="currency_before" />
|
||||
<result property="currencyAfter" column="currency_after" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="exchangeType" column="exchange_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
|
@ -27,7 +26,7 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectGameExchangeMoneyVo">
|
||||
select id, tenant_key, currency_code, transaction_id, member_id, platform_code, balance, quota, coin_before, coin_after, currency_before, currency_after, order_id, exchange_type, status, create_by, create_time, update_by, update_time from ff_game_exchange_money
|
||||
select id, tenant_key, currency_code, transaction_id, member_id, platform_code, balance, quota, coin_before, coin_after, currency_before, currency_after, exchange_type, status, create_by, create_time, update_by, update_time from ff_game_exchange_money
|
||||
</sql>
|
||||
|
||||
<select id="selectGameExchangeMoneyList" parameterType="GameExchangeMoney" resultMap="GameExchangeMoneyResult">
|
||||
|
@ -44,7 +43,6 @@
|
|||
<if test="coinAfter != null "> and coin_after = #{coinAfter}</if>
|
||||
<if test="currencyBefore != null "> and currency_before = #{currencyBefore}</if>
|
||||
<if test="currencyAfter != null "> and currency_after = #{currencyAfter}</if>
|
||||
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
||||
<if test="exchangeType != null "> and exchange_type = #{exchangeType}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
|
@ -69,7 +67,6 @@
|
|||
<if test="coinAfter != null">coin_after,</if>
|
||||
<if test="currencyBefore != null">currency_before,</if>
|
||||
<if test="currencyAfter != null">currency_after,</if>
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="exchangeType != null">exchange_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
|
@ -89,7 +86,6 @@
|
|||
<if test="coinAfter != null">#{coinAfter},</if>
|
||||
<if test="currencyBefore != null">#{currencyBefore},</if>
|
||||
<if test="currencyAfter != null">#{currencyAfter},</if>
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="exchangeType != null">#{exchangeType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
|
@ -113,7 +109,6 @@
|
|||
<if test="coinAfter != null">coin_after = #{coinAfter},</if>
|
||||
<if test="currencyBefore != null">currency_before = #{currencyBefore},</if>
|
||||
<if test="currencyAfter != null">currency_after = #{currencyAfter},</if>
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="exchangeType != null">exchange_type = #{exchangeType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
<result property="coinAfter" column="coin_after" />
|
||||
<result property="currencyBefore" column="currency_before" />
|
||||
<result property="currencyAfter" column="currency_after" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="exchangeType" column="exchange_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
|
@ -27,7 +26,7 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectGameExchangeMoneyVo">
|
||||
select id, tenant_key, currency_code, transaction_id, member_id, platform_code, balance, quota, coin_before, coin_after, currency_before, currency_after, order_id, exchange_type, status, create_by, create_time, update_by, update_time from ff_game_exchange_money
|
||||
select id, tenant_key, currency_code, transaction_id, member_id, platform_code, balance, quota, coin_before, coin_after, currency_before, currency_after, exchange_type, status, create_by, create_time, update_by, update_time from ff_game_exchange_money
|
||||
</sql>
|
||||
|
||||
<select id="selectGameExchangeMoneyList" parameterType="GameExchangeMoney" resultMap="GameExchangeMoneyResult">
|
||||
|
@ -44,7 +43,6 @@
|
|||
<if test="coinAfter != null "> and coin_after = #{coinAfter}</if>
|
||||
<if test="currencyBefore != null "> and currency_before = #{currencyBefore}</if>
|
||||
<if test="currencyAfter != null "> and currency_after = #{currencyAfter}</if>
|
||||
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
||||
<if test="exchangeType != null "> and exchange_type = #{exchangeType}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
|
@ -69,7 +67,6 @@
|
|||
<if test="coinAfter != null">coin_after,</if>
|
||||
<if test="currencyBefore != null">currency_before,</if>
|
||||
<if test="currencyAfter != null">currency_after,</if>
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="exchangeType != null">exchange_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
|
@ -89,7 +86,6 @@
|
|||
<if test="coinAfter != null">#{coinAfter},</if>
|
||||
<if test="currencyBefore != null">#{currencyBefore},</if>
|
||||
<if test="currencyAfter != null">#{currencyAfter},</if>
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="exchangeType != null">#{exchangeType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
|
@ -113,7 +109,6 @@
|
|||
<if test="coinAfter != null">coin_after = #{coinAfter},</if>
|
||||
<if test="currencyBefore != null">currency_before = #{currencyBefore},</if>
|
||||
<if test="currencyAfter != null">currency_after = #{currencyAfter},</if>
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="exchangeType != null">exchange_type = #{exchangeType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
/**
|
||||
* 租户配额类型
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/14
|
||||
*/
|
||||
public enum TenantQuotaType {
|
||||
BALANCE(1, "余额"),
|
||||
DEPOSIT(2, "押金");
|
||||
private final Integer code;
|
||||
private final String info;
|
||||
|
||||
TenantQuotaType(Integer code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
/**
|
||||
* 租户类型
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/14
|
||||
*/
|
||||
public enum TenantType {
|
||||
NORMAL(1, "正常开户"),
|
||||
DEPOSIT(2, "押金开户");
|
||||
private final Integer code;
|
||||
private final String info;
|
||||
|
||||
TenantType(Integer code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
|
||||
/**
|
||||
* 传输类型
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/29
|
||||
*/
|
||||
public enum TransferType {
|
||||
ALL(1, "从游戏商转移额度到平台商(不看amount值,全部转出"),
|
||||
GAMES(2, "从平台商转移额度到游戏商"),
|
||||
SYSTEM(3, "从游戏商转移额度到平台商 无用");
|
||||
private final Integer code;
|
||||
private final String info;
|
||||
|
||||
TransferType(Integer code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue