refactor(工程): 调整工程代码结构
commit
5774321bea
|
|
@ -1,15 +1,12 @@
|
|||
|
||||
# 引入子配置文件
|
||||
spring.config.import=\
|
||||
classpath:config/test/mybatis.properties,\
|
||||
classpath:config/test/redis.properties,\
|
||||
classpath:config/test/forest.properties,\
|
||||
classpath:config/test/xxljob.properties,\
|
||||
classpath:config/test/datasource.properties
|
||||
classpath:config/test/mongo.properties
|
||||
|
||||
|
||||
# 项目相关配置
|
||||
ff.name=FF
|
||||
ff.name=FF-Fetcher
|
||||
ff.version=0.0.1
|
||||
ff.copyrightYear=2024
|
||||
ff.profile=D:/ff/uploadPath
|
||||
|
|
@ -17,7 +14,7 @@ ff.addressEnabled=false
|
|||
ff.captchaType=math
|
||||
|
||||
# 开发环境配置
|
||||
server.port=9080
|
||||
server.port=9082
|
||||
server.servlet.context-path=/
|
||||
server.tomcat.uri-encoding=UTF-8
|
||||
server.tomcat.accept-count=1000
|
||||
|
|
@ -32,38 +29,13 @@ logging.level.org.springframework=warn
|
|||
user.password.maxRetryCount=5
|
||||
user.password.lockTime=10
|
||||
|
||||
# 跑批处理配置
|
||||
batchProcessing.commissionBatchSize=20
|
||||
batchProcessing.agentLevelBatchSize=50
|
||||
batchProcessing.bettingDataBatchSize=1000
|
||||
|
||||
# Spring配置
|
||||
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
||||
spring.messages.basename=i18n/messages
|
||||
spring.servlet.multipart.max-file-size=20MB
|
||||
spring.servlet.multipart.max-request-size=20MB
|
||||
spring.devtools.restart.enabled=false
|
||||
|
||||
# token配置
|
||||
# Token配置
|
||||
token.header=Authorization
|
||||
token.secret=abcdefghijklmnopqrstuvwxyz
|
||||
token.expireTime=10080
|
||||
|
||||
# MyBatis配置
|
||||
mybatis.typeAliasesPackage=com.ff.**.domain
|
||||
mybatis.mapperLocations=classpath*:mapper/**/*Mapper.xml
|
||||
mybatis.configLocation=classpath:mybatis/mybatis-config.xml
|
||||
|
||||
# PageHelper分页插件
|
||||
pagehelper.helperDialect=mysql
|
||||
pagehelper.supportMethodsArguments=true
|
||||
pagehelper.params=count=countSql
|
||||
|
||||
# Swagger配置
|
||||
swagger.enabled=true
|
||||
swagger.pathMapping=/
|
||||
|
||||
# 防止XSS攻击
|
||||
xss.enabled=true
|
||||
xss.excludes=/system/notice
|
||||
xss.urlPatterns=/system/*,/monitor/*,/tool/*
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
package com.ff;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootVersion;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.FilterType;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
* @author ff
|
||||
*/
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = DaoAuthenticationProvider.class)})
|
||||
@EnableAsync
|
||||
public class FFApplication {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(FFApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ FF启动成功 ლ(´ڡ`ლ)゙" + SpringBootVersion.getVersion());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
|
||||
import com.ff.agent.dto.AgentCreateTenantDTO;
|
||||
import com.ff.agent.dto.AgentTenantSecretKeyDTO;
|
||||
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.QuotaType;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.dto.CreateTenantDTO;
|
||||
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||
import com.ff.base.system.service.ITenantPlatformService;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.base.utils.ip.IpUtils;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import com.ff.common.service.ITenantAgentPlatformService;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* api控制器
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/tenant")
|
||||
@Slf4j
|
||||
public class AgentController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private ITenantGameQuotaService tenantGameQuotaService;
|
||||
@Resource
|
||||
private ITenantPlatformService tenantPlatformService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentPlatformService tenantAgentPlatformService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param tenantSecretKeyDTO 租户密钥
|
||||
* @return {@link TableDataInfo }
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@Transactional
|
||||
@PreAuthorize("@ss.hasPermi('agent:tenant:list')")
|
||||
public TableDataInfo list(TenantSecretKeyDTO tenantSecretKeyDTO) {
|
||||
startPage();
|
||||
tenantSecretKeyDTO.setAgentId(getUserId());
|
||||
List<TenantSecretKey> tenantSecretKeys = tenantSecretKeyService.selectTenantSecretKeyDTOList(tenantSecretKeyDTO);
|
||||
TableDataInfo dataTable = getDataTable(tenantSecretKeys);
|
||||
List<AgentTenantSecretKeyDTO> list = new ArrayList<>();
|
||||
for (TenantSecretKey row : (List<TenantSecretKey>) dataTable.getRows()) {
|
||||
AgentTenantSecretKeyDTO agentTenantSecretKeyDTO = new AgentTenantSecretKeyDTO();
|
||||
BeanUtils.copyProperties(row, agentTenantSecretKeyDTO);
|
||||
agentTenantSecretKeyDTO.setTenantPlatforms(tenantPlatformService.selectTenantPlatformList(TenantPlatform.builder()
|
||||
.tenantId(row.getId())
|
||||
.build()));
|
||||
list.add(agentTenantSecretKeyDTO);
|
||||
}
|
||||
dataTable.setRows(list);
|
||||
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建租户
|
||||
*
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
@Transactional
|
||||
@PreAuthorize("@ss.hasPermi('agent:tenant:create')")
|
||||
public AjaxResult createTenant(@Validated @RequestBody AgentCreateTenantDTO agentCreateTenantDTO) {
|
||||
|
||||
//构造租户的充值信息
|
||||
List<TenantPlatform> tenantPlatforms = new ArrayList<>();
|
||||
for (TenantAgentPlatform tenantAgentPlatform : agentCreateTenantDTO.getTenantAgentPlatforms()) {
|
||||
TenantAgentPlatform agentPlatform = tenantAgentPlatformService.selectTenantAgentPlatformById(tenantAgentPlatform.getId());
|
||||
// 成本比平台成本大
|
||||
if (agentPlatform.getCost().compareTo(tenantAgentPlatform.getCost()) > 0) {
|
||||
throw new BaseException("成本比例不允许比最低比例小");
|
||||
}
|
||||
TenantPlatform tenantPlatform = new TenantPlatform();
|
||||
BeanUtils.copyProperties(tenantAgentPlatform, tenantPlatform);
|
||||
tenantPlatforms.add(tenantPlatform);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//创建租户
|
||||
Integer tenant = tenantSecretKeyService.createTenant(CreateTenantDTO.builder()
|
||||
.registerTime(DateUtils.getNowDate())
|
||||
.registerIp(IpUtils.getIpAddr())
|
||||
.agentId(getUserId())
|
||||
.account(agentCreateTenantDTO.getAccount())
|
||||
.password(agentCreateTenantDTO.getPassword())
|
||||
.scoreRatio(agentCreateTenantDTO.getScoreRatio())
|
||||
.tenantType(agentCreateTenantDTO.getTenantType())
|
||||
.depositRatio(agentCreateTenantDTO.getDepositRatio())
|
||||
.tenantPlatforms(tenantPlatforms)
|
||||
.build());
|
||||
|
||||
if (tenant > 0) {
|
||||
//信誉额度
|
||||
if (!ObjectUtils.isEmpty(agentCreateTenantDTO.getRealBalance())) {
|
||||
tenantGameQuotaService.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.TRUE)
|
||||
.currencyCode(Constants.USDT)
|
||||
.tenantKey(agentCreateTenantDTO.getAccount())
|
||||
.balance(agentCreateTenantDTO.getRealBalance())
|
||||
.operationType(OperationType.TENANT_RECHARGE.getCode())
|
||||
.quotaType(QuotaType.REPUTATION.getCode())
|
||||
.remark(OperationType.TENANT_RECHARGE.getDescription())
|
||||
.build());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(tenant);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,150 +0,0 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
import com.ff.agent.service.ITenantAgentInviteService;
|
||||
import com.ff.agent.service.ITenantAgentWithdrawalService;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.enums.CommissionApprovalStatus;
|
||||
import com.ff.base.enums.CommissionSourceType;
|
||||
import com.ff.base.enums.CommissionType;
|
||||
import com.ff.base.system.domain.TenantAgent;
|
||||
import com.ff.base.system.service.ITenantAgentService;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
import com.ff.agent.service.ITenantAgentCommissionService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理佣金管理 Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/commission")
|
||||
public class TenantAgentCommissionController extends BaseController {
|
||||
@Autowired
|
||||
private ITenantAgentCommissionService tenantAgentCommissionService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentWithdrawalService tenantAgentWithdrawalService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentService tenantAgentService;
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理 列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:commission:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(TenantAgentCommission tenantAgentCommission) {
|
||||
startPage();
|
||||
tenantAgentCommission.setAgentId(getUserId());
|
||||
List<TenantAgentCommission> list = tenantAgentCommissionService.selectTenantAgentCommissionList(tenantAgentCommission);
|
||||
|
||||
//未提现佣金
|
||||
tenantAgentCommission.setApprovalStatus(CommissionApprovalStatus.UNWITHDRAWN.getValue());
|
||||
BigDecimal unwithdrawn = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
//已提现佣金
|
||||
tenantAgentCommission.setApprovalStatus(CommissionApprovalStatus.WITHDRAWN.getValue());
|
||||
BigDecimal withdrawn = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
//总佣金
|
||||
tenantAgentCommission.setApprovalStatus(null);
|
||||
BigDecimal total = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
|
||||
// 邀请佣金
|
||||
tenantAgentCommission.setCommissionType(CommissionType.INVITE.getValue());
|
||||
BigDecimal invite = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
//抽成佣金
|
||||
tenantAgentCommission.setCommissionType(CommissionType.TAKE.getValue());
|
||||
BigDecimal take = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
TableDataInfo dataTable = getDataTable(list);
|
||||
|
||||
AjaxResult ajaxResult = success(dataTable);
|
||||
ajaxResult.put("unwithdrawn", unwithdrawn);
|
||||
ajaxResult.put("withdrawn", withdrawn);
|
||||
ajaxResult.put("total", total);
|
||||
ajaxResult.put("invite", invite);
|
||||
ajaxResult.put("take", take);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取代理佣金管理 详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:commission:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(tenantAgentCommissionService.selectTenantAgentCommissionById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改代理佣金管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:commission:edit')")
|
||||
@Log(title = "代理佣金管理 ", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@Transactional
|
||||
public synchronized AjaxResult edit() {
|
||||
|
||||
//查询钱包
|
||||
TenantAgent tenantAgent = tenantAgentService.selectTenantAgentById(getUserId());
|
||||
Assert.isTrue(tenantAgent.getTenantStatus(), "当前租户已被停用");
|
||||
Assert.isTrue(!StringUtil.isEmpty(tenantAgent.getWalletAddress()) &&
|
||||
!StringUtil.isEmpty(tenantAgent.getCurrencyAgreement()), "钱包地址为空");
|
||||
|
||||
|
||||
//查询代理佣金信息
|
||||
TenantAgentCommission agentCommission = new TenantAgentCommission();
|
||||
agentCommission.setAgentId(getUserId());
|
||||
agentCommission.setApprovalStatus(CommissionApprovalStatus.UNWITHDRAWN.getValue());
|
||||
List<TenantAgentCommission> list = tenantAgentCommissionService.selectTenantAgentCommissionList(agentCommission);
|
||||
|
||||
BigDecimal usdtBalance = list.stream().map(TenantAgentCommission::getUsdtBalance).reduce(NumberUtil::add).get();
|
||||
Assert.isTrue(usdtBalance.compareTo(BigDecimal.ZERO) > 0, "佣金待提现余额为0");
|
||||
|
||||
TenantAgentWithdrawal tenantAgentWithdrawal = TenantAgentWithdrawal.builder()
|
||||
.agentId(getUserId())
|
||||
.commissionBalance(usdtBalance)
|
||||
.currencyAgreement(tenantAgent.getWalletAddress())
|
||||
.walletAddress(tenantAgent.getWalletAddress())
|
||||
.build();
|
||||
tenantAgentWithdrawalService.insertTenantAgentWithdrawal(tenantAgentWithdrawal);
|
||||
for (TenantAgentCommission commission : list) {
|
||||
commission.setAgentWithdrawalId(tenantAgentWithdrawal.getId());
|
||||
commission.setUpdateBy(getUsername());
|
||||
commission.setApprovalStatus(CommissionApprovalStatus.WITHDRAWING.getValue());
|
||||
tenantAgentCommissionService.updateTenantAgentCommission(commission);
|
||||
}
|
||||
return toAjax(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.dto.TenantAgentInviteDTO;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
import com.ff.base.annotation.Anonymous;
|
||||
import com.ff.base.constant.ConfigConstants;
|
||||
import com.ff.base.enums.InviteType;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.service.ISysConfigService;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
import com.ff.agent.service.ITenantAgentInviteService;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理邀请链接Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/invite")
|
||||
public class TenantAgentInviteController extends BaseController {
|
||||
@Autowired
|
||||
private ITenantAgentInviteService tenantAgentInviteService;
|
||||
|
||||
@Resource
|
||||
private ISysConfigService sysConfigService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ITenantAgentInvitePlatformService tenantAgentInvitePlatformService;
|
||||
|
||||
/**
|
||||
* 获取代理邀请链接详细信息
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping(value = "/code/{inviteCode}")
|
||||
public AjaxResult getInfo(@PathVariable("inviteCode") String inviteCode) {
|
||||
return success(tenantAgentInviteService.selectTenantAgentInviteByInviteCode(inviteCode));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:invite:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantAgentInvite tenantAgentInvite) {
|
||||
startPage();
|
||||
tenantAgentInvite.setAgentId(getUserId());
|
||||
List<TenantAgentInvite> list = tenantAgentInviteService.selectTenantAgentInviteList(tenantAgentInvite);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取代理邀请链接详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:invite:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(tenantAgentInviteService.selectTenantAgentInviteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理邀请链接
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:invite:add')")
|
||||
@Log(title = "代理邀请链接", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@Transactional
|
||||
public AjaxResult add(@Validated @RequestBody TenantAgentInviteDTO tenantAgentInvite) {
|
||||
tenantAgentInvite.setAgentId(getUserId());
|
||||
String inviteUrl = sysConfigService.selectConfigByKey(ConfigConstants.INVITE_URL);
|
||||
tenantAgentInvite.setInviteCode(tenantAgentInviteService.getInviteCode());
|
||||
tenantAgentInvite.setInviteUrl(inviteUrl + "?code=" + tenantAgentInvite.getInviteCode());
|
||||
tenantAgentInvite.setCreateBy(getUsername());
|
||||
int result = tenantAgentInviteService.insertTenantAgentInvite(tenantAgentInvite);
|
||||
if (result > 0 && InviteType.TENANT.getValue().equals(tenantAgentInvite.getInviteType())) {
|
||||
// 保存平台注册利润信息
|
||||
List<TenantAgentInvitePlatform> tenantAgentInvitePlatforms = tenantAgentInvite.getTenantAgentInvitePlatforms();
|
||||
for (TenantAgentInvitePlatform tenantAgentInvitePlatform : tenantAgentInvitePlatforms) {
|
||||
tenantAgentInvitePlatform.setInviteId(tenantAgentInvite.getId());
|
||||
tenantAgentInvitePlatform.setCreateBy(getUsername());
|
||||
tenantAgentInvitePlatformService.insertTenantAgentInvitePlatform(tenantAgentInvitePlatform);
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/invite/platform")
|
||||
public class TenantAgentInvitePlatformController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantAgentInvitePlatformService tenantAgentInvitePlatformService;
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*/
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(TenantAgentInvitePlatform tenantAgentInvitePlatform)
|
||||
{
|
||||
|
||||
List<TenantAgentInvitePlatform> list = tenantAgentInvitePlatformService.selectTenantAgentInvitePlatformList(tenantAgentInvitePlatform);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,236 +0,0 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterAddDTO;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
||||
import com.ff.agent.service.ITenantAgentCommissionService;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
import com.ff.agent.service.ITenantAgentInviteRegisterService;
|
||||
import com.ff.agent.service.ITenantAgentInviteService;
|
||||
import com.ff.base.annotation.Anonymous;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.enums.*;
|
||||
import com.ff.base.system.domain.TenantAgent;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.dto.CreateTenantDTO;
|
||||
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||
import com.ff.base.system.service.ITenantAgentService;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.SecurityUtils;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.base.utils.ip.IpUtils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理邀请注册Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/invite/register")
|
||||
public class TenantAgentInviteRegisterController extends BaseController {
|
||||
@Autowired
|
||||
private ITenantAgentInviteRegisterService tenantAgentInviteRegisterService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentInviteService tenantAgentInviteService;
|
||||
|
||||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private ITenantGameQuotaService tenantGameQuotaService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentCommissionService tenantAgentCommissionService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentService tenantAgentService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentInvitePlatformService tenantAgentInvitePlatformService;
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operation:register:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantAgentInviteRegisterDTO tenantAgentInviteRegisterDTO) {
|
||||
startPage();
|
||||
tenantAgentInviteRegisterDTO.setAgentId(getUserId());
|
||||
List<TenantAgentInviteRegisterDTO> list = tenantAgentInviteRegisterService.selectTenantAgentInviteRegisterListDTO(tenantAgentInviteRegisterDTO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取代理邀请注册详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operation:register:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(tenantAgentInviteRegisterService.selectTenantAgentInviteRegisterById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理邀请注册
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TenantAgentInviteRegisterAddDTO tenantAgentInviteRegisterAddDTO) {
|
||||
Assert.isTrue(tenantAgentInviteRegisterAddDTO.getPassword().equals(tenantAgentInviteRegisterAddDTO.getConfirmPassword()), "两次密码不一致");
|
||||
|
||||
List<TenantAgentInvite> tenantAgentInvites = tenantAgentInviteService.selectTenantAgentInviteList(TenantAgentInvite.builder()
|
||||
.inviteCode(tenantAgentInviteRegisterAddDTO.getInviteCode())
|
||||
.build());
|
||||
Assert.isTrue(!CollectionUtils.isEmpty(tenantAgentInvites), "邀请码错误");
|
||||
|
||||
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(tenantAgentInviteRegisterAddDTO.getAccount());
|
||||
Assert.isTrue(ObjectUtils.isEmpty(tenantSecretKey), MessageUtils.message("operation.tenant.account.already.used"));
|
||||
|
||||
List<TenantAgentInviteRegister> tenantAgentInviteRegisters = tenantAgentInviteRegisterService.selectTenantAgentInviteRegisterList(TenantAgentInviteRegister.builder()
|
||||
.account(tenantAgentInviteRegisterAddDTO.getAccount())
|
||||
.build());
|
||||
Assert.isTrue(CollectionUtils.isEmpty(tenantAgentInviteRegisters), MessageUtils.message("operation.tenant.account.already.used"));
|
||||
|
||||
|
||||
TenantAgentInviteRegister tenantAgentInviteRegister = new TenantAgentInviteRegister();
|
||||
tenantAgentInviteRegister.setAgentId(tenantAgentInvites.get(0).getAgentId());
|
||||
tenantAgentInviteRegister.setRegisterTime(DateUtils.getNowDate());
|
||||
tenantAgentInviteRegister.setRegisterIp(IpUtils.getIpAddr());
|
||||
tenantAgentInviteRegister.setAccount(tenantAgentInviteRegisterAddDTO.getAccount());
|
||||
tenantAgentInviteRegister.setPassword(tenantAgentInviteRegisterAddDTO.getPassword());
|
||||
tenantAgentInviteRegister.setBalance(tenantAgentInvites.get(0).getBalance());
|
||||
tenantAgentInviteRegister.setInviteCode(tenantAgentInviteRegisterAddDTO.getInviteCode());
|
||||
tenantAgentInviteRegister.setOrderId(IdUtil.getSnowflakeNextIdStr());
|
||||
return toAjax(tenantAgentInviteRegisterService.insertTenantAgentInviteRegister(tenantAgentInviteRegister));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto 向
|
||||
*/
|
||||
@Anonymous
|
||||
@PutMapping
|
||||
@Transactional
|
||||
public void edit(@RequestBody TenantAgentInviteRegisterAddDTO dto) {
|
||||
TenantAgentInviteRegister tenantAgentInviteRegister = tenantAgentInviteRegisterService.selectTenantAgentInviteRegisterById(dto.getId());
|
||||
|
||||
Assert.isTrue(tenantAgentInviteRegister.getStatus().equals(InviterRegisterStatus.PENDING.getValue()), "该账号已激活");
|
||||
|
||||
//查询注册配置信息
|
||||
TenantAgentInvite tenantAgentInvite = tenantAgentInviteService.selectTenantAgentInviteByInviteCode(tenantAgentInviteRegister.getInviteCode());
|
||||
|
||||
List<TenantAgentInvitePlatform> tenantAgentInvitePlatforms = tenantAgentInvitePlatformService.selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform.builder()
|
||||
.inviteId(tenantAgentInvite.getId())
|
||||
.build());
|
||||
Integer result = 0;
|
||||
if (tenantAgentInvite.getInviteType().equals(InviteType.TENANT.getValue())) {
|
||||
|
||||
List<TenantPlatform> tenantPlatforms = new ArrayList<>();
|
||||
for (TenantAgentInvitePlatform tenantAgentInvitePlatform : tenantAgentInvitePlatforms) {
|
||||
TenantPlatform tenantPlatform = new TenantPlatform();
|
||||
BeanUtils.copyProperties(tenantAgentInvitePlatform, tenantPlatform);
|
||||
tenantPlatforms.add(tenantPlatform);
|
||||
}
|
||||
|
||||
//创建租户
|
||||
result = tenantSecretKeyService.createTenant(CreateTenantDTO.builder()
|
||||
.registerTime(tenantAgentInviteRegister.getRegisterTime())
|
||||
.registerIp(tenantAgentInviteRegister.getRegisterIp())
|
||||
.agentId(tenantAgentInvite.getAgentId())
|
||||
.account(tenantAgentInviteRegister.getAccount())
|
||||
.password(tenantAgentInviteRegister.getPassword())
|
||||
.scoreRatio(tenantAgentInvite.getScoreRatio())
|
||||
.tenantType(tenantAgentInvite.getTenantType())
|
||||
.depositRatio(tenantAgentInvite.getDepositRatio())
|
||||
.tenantPlatforms(tenantPlatforms)
|
||||
.build());
|
||||
//信誉额度
|
||||
if (result > 0 & !ObjectUtils.isEmpty(tenantAgentInvite.getRealBalance())) {
|
||||
tenantGameQuotaService.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.TRUE)
|
||||
.currencyCode(Constants.USDT)
|
||||
.tenantKey(tenantAgentInviteRegister.getAccount())
|
||||
.balance(tenantAgentInvite.getRealBalance())
|
||||
.operationType(OperationType.TENANT_RECHARGE.getCode())
|
||||
.quotaType(QuotaType.REPUTATION.getCode())
|
||||
.remark(OperationType.TENANT_RECHARGE.getDescription())
|
||||
.build());
|
||||
|
||||
}
|
||||
} else {
|
||||
result = tenantAgentService.createTenantAgent(TenantAgent.builder()
|
||||
.account(tenantAgentInviteRegister.getAccount())
|
||||
.password(tenantAgentInviteRegister.getPassword())
|
||||
.registerTime(tenantAgentInviteRegister.getRegisterTime())
|
||||
.registerIp(tenantAgentInviteRegister.getRegisterIp())
|
||||
.registerIpCity(tenantAgentInviteRegister.getRegisterIpCity())
|
||||
.tenantStatus(Boolean.TRUE)
|
||||
.build());
|
||||
}
|
||||
if (result > 0) {
|
||||
//添加佣金信息
|
||||
TenantAgentCommission tenantAgentCommission = TenantAgentCommission.builder()
|
||||
.agentId(tenantAgentInvite.getAgentId())
|
||||
.sourceId(tenantAgentInviteRegister.getId())
|
||||
.sourceType(CommissionSourceType.AGENT_TENANT_REGISTER.getValue())
|
||||
.commissionType(CommissionType.INVITE.getValue())
|
||||
.currencyCode(Constants.USDT)
|
||||
.balance(tenantAgentInviteRegister.getBalance())
|
||||
.costBalance(BigDecimal.ZERO)
|
||||
.merchantBalance(BigDecimal.ZERO)
|
||||
.commissionBalance(tenantAgentInviteRegister.getBalance())
|
||||
.usdtBalance(tenantAgentInviteRegister.getBalance())
|
||||
.build();
|
||||
tenantAgentCommission.setCreateBy(tenantAgentInviteRegister.getAccount());
|
||||
tenantAgentCommissionService.insertTenantAgentCommission(tenantAgentCommission);
|
||||
|
||||
//更新激活状态
|
||||
tenantAgentInviteRegister.setStatus(InviterRegisterStatus.ACTIVATED.getValue());
|
||||
tenantAgentInviteRegisterService.updateTenantAgentInviteRegister(tenantAgentInviteRegister);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.base.core.page.PageDomain;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import com.ff.common.service.ITenantAgentPlatformService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/platform")
|
||||
public class TenantAgentPlatformController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantAgentPlatformService tenantAgentPlatformService;
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*/
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select( )
|
||||
{
|
||||
PageHelper.orderBy("platform_code desc,currency_code desc");
|
||||
List<TenantAgentPlatform> list = tenantAgentPlatformService.selectTenantAgentPlatformList(TenantAgentPlatform.builder().build());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
import com.ff.agent.service.ITenantAgentWithdrawalService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理申请提现审批管理Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/withdrawal")
|
||||
public class TenantAgentWithdrawalController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantAgentWithdrawalService tenantAgentWithdrawalService;
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:withdrawal:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
startPage();
|
||||
tenantAgentWithdrawal.setAgentId(getUserId());
|
||||
List<TenantAgentWithdrawal> list = tenantAgentWithdrawalService.selectTenantAgentWithdrawalList(tenantAgentWithdrawal);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取代理申请提现审批管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:withdrawal:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(tenantAgentWithdrawalService.selectTenantAgentWithdrawalById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改代理申请提现审批管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:withdrawal:edit')")
|
||||
@Log(title = "代理申请提现审批管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
return toAjax(tenantAgentWithdrawalService.updateTenantAgentWithdrawal(tenantAgentWithdrawal));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
package com.ff.agent.dto;
|
||||
|
||||
|
||||
import com.ff.base.xss.Xss;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理创建租户
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/20
|
||||
*/
|
||||
@Data
|
||||
public class AgentCreateTenantDTO implements Serializable {
|
||||
private static final long serialVersionUID = -5561068216486978354L;
|
||||
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
@Xss(message = "用户账号不能包含脚本字符")
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Size(min = 2, max = 30, message = "用户账号长度不能超过30个字符")
|
||||
private String account;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@Size(min = 5, max = 20, message = "密码长度不能超过25个字符")
|
||||
private String password;
|
||||
|
||||
|
||||
/** 买分比例 */
|
||||
@NotNull(message = "买分比例不能为空")
|
||||
private BigDecimal scoreRatio;
|
||||
|
||||
|
||||
|
||||
/** 租户类型 TenantType 枚举 */
|
||||
@NotNull(message = "租户类型不能为空")
|
||||
private Integer tenantType;
|
||||
|
||||
/** 信誉额度*/
|
||||
private BigDecimal realBalance;
|
||||
|
||||
/** 透支比例 */
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/**
|
||||
* 租户代理平台利润
|
||||
*/
|
||||
@NotNull(message = "租户代理平台列表不能为空")
|
||||
@Size(min = 1, message = "租户代理平台列表必须包含至少一个元素")
|
||||
private List<TenantAgentPlatform> tenantAgentPlatforms;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
package com.ff.agent.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户租户密钥对象 ff_tenant_secret_key
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class AgentTenantSecretKeyDTO extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
|
||||
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
@JsonIgnore
|
||||
private String password;
|
||||
|
||||
/** 最后登录ip */
|
||||
@Excel(name = "最后登录ip")
|
||||
private String loginIp;
|
||||
|
||||
/** 最后登录时间 */
|
||||
@Excel(name = "最后登录时间")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long loginData;
|
||||
|
||||
|
||||
|
||||
/** 租户key */
|
||||
@Excel(name = "租户key")
|
||||
private String tenantKey;
|
||||
|
||||
/** 代理id */
|
||||
@Excel(name = "代理id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long agentId;
|
||||
|
||||
|
||||
|
||||
/** 商户后缀 */
|
||||
@Excel(name = "商户后缀")
|
||||
private String tenantSn;
|
||||
|
||||
/** 租户密钥 */
|
||||
@Excel(name = "租户密钥")
|
||||
@JsonIgnore
|
||||
private String tenantSecret;
|
||||
|
||||
/** 租户状态 1正常 0停用 */
|
||||
@Excel(name = "租户状态 1正常 0停用")
|
||||
private Boolean tenantStatus;
|
||||
|
||||
/** 额度类型 TenantQuotaType 枚举 */
|
||||
@Excel(name = "额度类型 TenantQuotaType 枚举")
|
||||
private Integer quotaType;
|
||||
|
||||
/** 买分比例 */
|
||||
@Excel(name = "买分比例")
|
||||
private BigDecimal scoreRatio;
|
||||
|
||||
/** 租户类型 TenantType 枚举 */
|
||||
@Excel(name = "租户类型 TenantType 枚举")
|
||||
private Integer tenantType;
|
||||
|
||||
/** 透支比例 */
|
||||
@Excel(name = "透支比例")
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
|
||||
/**
|
||||
* 租户代理平台利润
|
||||
*/
|
||||
private List<TenantPlatform> tenantPlatforms;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
package com.ff.agent.dto;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 租户代理邀请dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/27
|
||||
*/
|
||||
@Data
|
||||
public class TenantAgentInviteDTO extends TenantAgentInvite {
|
||||
|
||||
/**
|
||||
* 租户代理平台利润
|
||||
*/
|
||||
@NotNull(message = "租户代理平台列表不能为空")
|
||||
@Size(min = 1, message = "租户代理平台列表必须包含至少一个元素")
|
||||
private List<TenantAgentInvitePlatform> tenantAgentInvitePlatforms;
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package com.ff.agent.dto;
|
||||
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 租户代理邀请注册添加数据
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/25
|
||||
*/
|
||||
@Data
|
||||
public class TenantAgentInviteRegisterAddDTO extends BaseEntity {
|
||||
|
||||
|
||||
/** 邀请码 */
|
||||
private String inviteCode;
|
||||
|
||||
/** 账号 */
|
||||
private String account;
|
||||
|
||||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 确认密码
|
||||
*/
|
||||
private String confirmPassword;
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.ff.agent.dto;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 租户代理邀请注册dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/26
|
||||
*/
|
||||
@Data
|
||||
public class TenantAgentInviteRegisterDTO extends TenantAgentInviteRegister {
|
||||
/**
|
||||
* 邀请类型
|
||||
*/
|
||||
private Integer inviteType;
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
|
||||
/**
|
||||
* 代理佣金管理 Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface TenantAgentCommissionMapper
|
||||
{
|
||||
/**
|
||||
* 查询代理佣金管理
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 代理佣金管理
|
||||
*/
|
||||
TenantAgentCommission selectTenantAgentCommissionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理 列表
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 代理佣金管理 集合
|
||||
*/
|
||||
List<TenantAgentCommission> selectTenantAgentCommissionList(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 新增代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 修改代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 删除代理佣金管理
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentCommissionById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除代理佣金管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentCommissionByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 获得代理佣金
|
||||
*
|
||||
* @param tenantAgentCommission 租户代理佣金
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
BigDecimal getAgentCommissionSum(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
|
||||
/**
|
||||
* 代理邀请链接Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface TenantAgentInviteMapper
|
||||
{
|
||||
/**
|
||||
* 查询代理邀请链接
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 代理邀请链接
|
||||
*/
|
||||
TenantAgentInvite selectTenantAgentInviteById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 按邀请代码选择租户代理邀请
|
||||
*
|
||||
* @param inviteCode 邀请码
|
||||
* @return {@link TenantAgentInvite }
|
||||
*/
|
||||
TenantAgentInvite selectTenantAgentInviteByInviteCode(String inviteCode);
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接列表
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 代理邀请链接集合
|
||||
*/
|
||||
List<TenantAgentInvite> selectTenantAgentInviteList(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 新增代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 修改代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 删除代理邀请链接
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请链接
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface TenantAgentInvitePlatformMapper
|
||||
{
|
||||
/**
|
||||
* 查询平台邀请注册成本管理
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 平台邀请注册成本管理
|
||||
*/
|
||||
TenantAgentInvitePlatform selectTenantAgentInvitePlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 平台邀请注册成本管理集合
|
||||
*/
|
||||
List<TenantAgentInvitePlatform> selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 新增平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 修改平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 删除平台邀请注册成本管理
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInvitePlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除平台邀请注册成本管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInvitePlatformByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理邀请注册Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface TenantAgentInviteRegisterMapper
|
||||
{
|
||||
/**
|
||||
* 查询代理邀请注册
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 代理邀请注册
|
||||
*/
|
||||
TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 选择租户代理邀请注册列表dto
|
||||
*
|
||||
* @param tenantAgentInviteRegisterDTO 租户代理邀请注册dto
|
||||
* @return {@link List }<{@link TenantAgentInviteRegisterDTO }>
|
||||
*/
|
||||
List<TenantAgentInviteRegisterDTO> selectTenantAgentInviteRegisterListDTO(TenantAgentInviteRegisterDTO tenantAgentInviteRegisterDTO);
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册列表
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 代理邀请注册集合
|
||||
*/
|
||||
List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 新增代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 修改代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 删除代理邀请注册
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteRegisterById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请注册
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteRegisterByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
|
||||
/**
|
||||
* 代理申请提现审批管理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface TenantAgentWithdrawalMapper
|
||||
{
|
||||
/**
|
||||
* 查询代理申请提现审批管理
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 代理申请提现审批管理
|
||||
*/
|
||||
TenantAgentWithdrawal selectTenantAgentWithdrawalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理列表
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 代理申请提现审批管理集合
|
||||
*/
|
||||
List<TenantAgentWithdrawal> selectTenantAgentWithdrawalList(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 新增代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 修改代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 删除代理申请提现审批管理
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentWithdrawalById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除代理申请提现审批管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentWithdrawalByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
|
||||
/**
|
||||
* 代理佣金管理 Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface ITenantAgentCommissionService
|
||||
{
|
||||
/**
|
||||
* 查询代理佣金管理
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 代理佣金管理
|
||||
*/
|
||||
TenantAgentCommission selectTenantAgentCommissionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理 列表
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 代理佣金管理 集合
|
||||
*/
|
||||
List<TenantAgentCommission> selectTenantAgentCommissionList(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
|
||||
/**
|
||||
* 获得代理佣金
|
||||
*
|
||||
* @param tenantAgentCommission 租户代理佣金
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
BigDecimal getAgentCommissionSum(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 新增代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 修改代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 批量删除代理佣金管理
|
||||
*
|
||||
* @param ids 需要删除的代理佣金管理 主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentCommissionByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除代理佣金管理 信息
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentCommissionById(Long id);
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface ITenantAgentInvitePlatformService
|
||||
{
|
||||
/**
|
||||
* 查询平台邀请注册成本管理
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 平台邀请注册成本管理
|
||||
*/
|
||||
TenantAgentInvitePlatform selectTenantAgentInvitePlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 平台邀请注册成本管理集合
|
||||
*/
|
||||
List<TenantAgentInvitePlatform> selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 新增平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 修改平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 批量删除平台邀请注册成本管理
|
||||
*
|
||||
* @param ids 需要删除的平台邀请注册成本管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInvitePlatformByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除平台邀请注册成本管理信息
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInvitePlatformById(Long id);
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理邀请注册Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface ITenantAgentInviteRegisterService
|
||||
{
|
||||
/**
|
||||
* 查询代理邀请注册
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 代理邀请注册
|
||||
*/
|
||||
TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册列表
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 代理邀请注册集合
|
||||
*/
|
||||
List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
|
||||
/**
|
||||
* 选择租户代理邀请注册列表dto
|
||||
*
|
||||
* @param tenantAgentInviteRegisterDTO 租户代理邀请注册dto
|
||||
* @return {@link List }<{@link TenantAgentInviteRegisterDTO }>
|
||||
*/
|
||||
List<TenantAgentInviteRegisterDTO> selectTenantAgentInviteRegisterListDTO(TenantAgentInviteRegisterDTO tenantAgentInviteRegisterDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 新增代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 修改代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请注册
|
||||
*
|
||||
* @param ids 需要删除的代理邀请注册主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteRegisterByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除代理邀请注册信息
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteRegisterById(Long id);
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
|
||||
/**
|
||||
* 代理邀请链接Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface ITenantAgentInviteService
|
||||
{
|
||||
/**
|
||||
* 查询代理邀请链接
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 代理邀请链接
|
||||
*/
|
||||
TenantAgentInvite selectTenantAgentInviteById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 按邀请代码选择租户代理邀请
|
||||
*
|
||||
* @param inviteCode 邀请码
|
||||
* @return {@link TenantAgentInvite }
|
||||
*/
|
||||
TenantAgentInvite selectTenantAgentInviteByInviteCode(String inviteCode);
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接列表
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 代理邀请链接集合
|
||||
*/
|
||||
List<TenantAgentInvite> selectTenantAgentInviteList(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 新增代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 获取邀请码
|
||||
*
|
||||
* @return {@link String }
|
||||
*/
|
||||
String getInviteCode();
|
||||
|
||||
/**
|
||||
* 修改代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请链接
|
||||
*
|
||||
* @param ids 需要删除的代理邀请链接主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除代理邀请链接信息
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteById(Long id);
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
|
||||
/**
|
||||
* 代理申请提现审批管理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface ITenantAgentWithdrawalService
|
||||
{
|
||||
/**
|
||||
* 查询代理申请提现审批管理
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 代理申请提现审批管理
|
||||
*/
|
||||
TenantAgentWithdrawal selectTenantAgentWithdrawalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理列表
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 代理申请提现审批管理集合
|
||||
*/
|
||||
List<TenantAgentWithdrawal> selectTenantAgentWithdrawalList(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 新增代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 修改代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 批量删除代理申请提现审批管理
|
||||
*
|
||||
* @param ids 需要删除的代理申请提现审批管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentWithdrawalByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除代理申请提现审批管理信息
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentWithdrawalById(Long id);
|
||||
}
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.agent.mapper.TenantAgentCommissionMapper;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
import com.ff.agent.service.ITenantAgentCommissionService;
|
||||
|
||||
/**
|
||||
* 代理佣金管理 Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentCommissionServiceImpl implements ITenantAgentCommissionService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentCommissionMapper tenantAgentCommissionMapper;
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 代理佣金管理
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentCommission selectTenantAgentCommissionById(Long id)
|
||||
{
|
||||
return tenantAgentCommissionMapper.selectTenantAgentCommissionById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理 列表
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 代理佣金管理
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentCommission> selectTenantAgentCommissionList(TenantAgentCommission tenantAgentCommission)
|
||||
{
|
||||
return tenantAgentCommissionMapper.selectTenantAgentCommissionList(tenantAgentCommission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得代理佣金
|
||||
*
|
||||
* @param tenantAgentCommission 租户代理佣金
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
@Override
|
||||
public BigDecimal getAgentCommissionSum(TenantAgentCommission tenantAgentCommission) {
|
||||
return tenantAgentCommissionMapper.getAgentCommissionSum(tenantAgentCommission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentCommission(TenantAgentCommission tenantAgentCommission)
|
||||
{
|
||||
tenantAgentCommission.setCreateTime(DateUtils.getNowDate());
|
||||
tenantAgentCommission.setId(IdUtil.getSnowflakeNextId());
|
||||
return tenantAgentCommissionMapper.insertTenantAgentCommission(tenantAgentCommission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentCommission(TenantAgentCommission tenantAgentCommission)
|
||||
{
|
||||
tenantAgentCommission.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentCommissionMapper.updateTenantAgentCommission(tenantAgentCommission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理佣金管理
|
||||
*
|
||||
* @param ids 需要删除的代理佣金管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentCommissionByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentCommissionMapper.deleteTenantAgentCommissionByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理佣金管理 信息
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentCommissionById(Long id)
|
||||
{
|
||||
return tenantAgentCommissionMapper.deleteTenantAgentCommissionById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.agent.mapper.TenantAgentInvitePlatformMapper;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentInvitePlatformServiceImpl implements ITenantAgentInvitePlatformService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentInvitePlatformMapper tenantAgentInvitePlatformMapper;
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 平台邀请注册成本管理
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentInvitePlatform selectTenantAgentInvitePlatformById(Long id)
|
||||
{
|
||||
return tenantAgentInvitePlatformMapper.selectTenantAgentInvitePlatformById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 平台邀请注册成本管理
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentInvitePlatform> selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform tenantAgentInvitePlatform)
|
||||
{
|
||||
return tenantAgentInvitePlatformMapper.selectTenantAgentInvitePlatformList(tenantAgentInvitePlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform)
|
||||
{
|
||||
tenantAgentInvitePlatform.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantAgentInvitePlatform.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInvitePlatformMapper.insertTenantAgentInvitePlatform(tenantAgentInvitePlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform)
|
||||
{
|
||||
tenantAgentInvitePlatform.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInvitePlatformMapper.updateTenantAgentInvitePlatform(tenantAgentInvitePlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除平台邀请注册成本管理
|
||||
*
|
||||
* @param ids 需要删除的平台邀请注册成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInvitePlatformByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentInvitePlatformMapper.deleteTenantAgentInvitePlatformByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除平台邀请注册成本管理信息
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInvitePlatformById(Long id)
|
||||
{
|
||||
return tenantAgentInvitePlatformMapper.deleteTenantAgentInvitePlatformById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
||||
import com.ff.agent.mapper.TenantAgentInviteRegisterMapper;
|
||||
import com.ff.agent.service.ITenantAgentInviteRegisterService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 代理邀请注册Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentInviteRegisterServiceImpl implements ITenantAgentInviteRegisterService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentInviteRegisterMapper tenantAgentInviteRegisterMapper;
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 代理邀请注册
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id)
|
||||
{
|
||||
return tenantAgentInviteRegisterMapper.selectTenantAgentInviteRegisterById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册列表
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 代理邀请注册
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister)
|
||||
{
|
||||
return tenantAgentInviteRegisterMapper.selectTenantAgentInviteRegisterList(tenantAgentInviteRegister);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择租户代理邀请注册列表dto
|
||||
*
|
||||
* @param tenantAgentInviteRegisterDTO 租户代理邀请注册dto
|
||||
* @return {@link List }<{@link TenantAgentInviteRegisterDTO }>
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentInviteRegisterDTO> selectTenantAgentInviteRegisterListDTO(TenantAgentInviteRegisterDTO tenantAgentInviteRegisterDTO) {
|
||||
return tenantAgentInviteRegisterMapper.selectTenantAgentInviteRegisterListDTO(tenantAgentInviteRegisterDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister)
|
||||
{
|
||||
tenantAgentInviteRegister.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantAgentInviteRegister.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInviteRegisterMapper.insertTenantAgentInviteRegister(tenantAgentInviteRegister);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister)
|
||||
{
|
||||
tenantAgentInviteRegister.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInviteRegisterMapper.updateTenantAgentInviteRegister(tenantAgentInviteRegister);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请注册
|
||||
*
|
||||
* @param ids 需要删除的代理邀请注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInviteRegisterByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentInviteRegisterMapper.deleteTenantAgentInviteRegisterByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理邀请注册信息
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInviteRegisterById(Long id)
|
||||
{
|
||||
return tenantAgentInviteRegisterMapper.deleteTenantAgentInviteRegisterById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.NumberUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.agent.mapper.TenantAgentInviteMapper;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
import com.ff.agent.service.ITenantAgentInviteService;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* 代理邀请链接Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentInviteServiceImpl implements ITenantAgentInviteService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentInviteMapper tenantAgentInviteMapper;
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 代理邀请链接
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentInvite selectTenantAgentInviteById(Long id)
|
||||
{
|
||||
return tenantAgentInviteMapper.selectTenantAgentInviteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按邀请代码选择租户代理邀请
|
||||
*
|
||||
* @param inviteCode 邀请码
|
||||
* @return {@link TenantAgentInvite }
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentInvite selectTenantAgentInviteByInviteCode(String inviteCode) {
|
||||
return tenantAgentInviteMapper.selectTenantAgentInviteByInviteCode( inviteCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接列表
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 代理邀请链接
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentInvite> selectTenantAgentInviteList(TenantAgentInvite tenantAgentInvite)
|
||||
{
|
||||
return tenantAgentInviteMapper.selectTenantAgentInviteList(tenantAgentInvite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentInvite(TenantAgentInvite tenantAgentInvite)
|
||||
{
|
||||
tenantAgentInvite.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantAgentInvite.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInviteMapper.insertTenantAgentInvite(tenantAgentInvite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取邀请码
|
||||
*
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Override
|
||||
public synchronized String getInviteCode() {
|
||||
String inviteCode = NumberUtils.generateRandomCode(12);
|
||||
while (!CollectionUtils.isEmpty(tenantAgentInviteMapper.selectTenantAgentInviteList(TenantAgentInvite.builder()
|
||||
.inviteCode(inviteCode)
|
||||
.build()))) {
|
||||
inviteCode = NumberUtils.generateRandomCode(12);
|
||||
}
|
||||
return inviteCode;
|
||||
}
|
||||
|
||||
/**3
|
||||
* 修改代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentInvite(TenantAgentInvite tenantAgentInvite)
|
||||
{
|
||||
tenantAgentInvite.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInviteMapper.updateTenantAgentInvite(tenantAgentInvite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请链接
|
||||
*
|
||||
* @param ids 需要删除的代理邀请链接主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInviteByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentInviteMapper.deleteTenantAgentInviteByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理邀请链接信息
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInviteById(Long id)
|
||||
{
|
||||
return tenantAgentInviteMapper.deleteTenantAgentInviteById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.agent.mapper.TenantAgentWithdrawalMapper;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
import com.ff.agent.service.ITenantAgentWithdrawalService;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 代理申请提现审批管理Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentWithdrawalServiceImpl implements ITenantAgentWithdrawalService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentWithdrawalMapper tenantAgentWithdrawalMapper;
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 代理申请提现审批管理
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentWithdrawal selectTenantAgentWithdrawalById(Long id)
|
||||
{
|
||||
return tenantAgentWithdrawalMapper.selectTenantAgentWithdrawalById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理列表
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 代理申请提现审批管理
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentWithdrawal> selectTenantAgentWithdrawalList(TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
return tenantAgentWithdrawalMapper.selectTenantAgentWithdrawalList(tenantAgentWithdrawal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
tenantAgentWithdrawal.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantAgentWithdrawal.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentWithdrawalMapper.insertTenantAgentWithdrawal(tenantAgentWithdrawal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
tenantAgentWithdrawal.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentWithdrawalMapper.updateTenantAgentWithdrawal(tenantAgentWithdrawal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理申请提现审批管理
|
||||
*
|
||||
* @param ids 需要删除的代理申请提现审批管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentWithdrawalByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentWithdrawalMapper.deleteTenantAgentWithdrawalByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理申请提现审批管理信息
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentWithdrawalById(Long id)
|
||||
{
|
||||
return tenantAgentWithdrawalMapper.deleteTenantAgentWithdrawalById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.ff.annotation;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 检查标题
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface CheckHeader {
|
||||
// 该注解没有参数,直接标识类需要进行头部验证
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package com.ff.annotation;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.system.domain.TenantWhite;
|
||||
import com.ff.base.system.service.ITenantWhiteService;
|
||||
import com.ff.base.utils.ip.IpUtils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.ff.config.KeyConfig;
|
||||
import com.ff.base.utils.sign.Md5Utils;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标题检查方面
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class HeaderCheckAspect {
|
||||
|
||||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private ITenantWhiteService tenantWhiteService;
|
||||
|
||||
@Resource
|
||||
private KeyConfig keyUtils;
|
||||
|
||||
|
||||
// 定义切点: 所有带 @CheckHeader 注解的类中的所有方法
|
||||
@Pointcut("@within(CheckHeader)")
|
||||
public void checkHeaderPointcut() {
|
||||
}
|
||||
|
||||
|
||||
// 在方法执行前进行处理
|
||||
@Before("checkHeaderPointcut()")
|
||||
public void beforeMethod() throws Exception {
|
||||
// 获取当前请求的 HTTP 请求对象
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
|
||||
// 32 位小写 md5(random+key+tenantSecret)
|
||||
String sign = request.getHeader(Constants.SIGN);
|
||||
Assert.notNull(sign, "签名不能为空");
|
||||
// 随机数
|
||||
String random = request.getHeader(Constants.RANDOM);
|
||||
Assert.notNull(random, "随机数不能为空");
|
||||
Assert.isTrue( random.length() == 32, "随机数长度错误");
|
||||
|
||||
//key值
|
||||
String key = request.getHeader(Constants.KEY);
|
||||
Assert.notNull(key, "key不能为空");
|
||||
|
||||
|
||||
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(key);
|
||||
Assert.notNull(tenantSecretKey, key+"key不存在");
|
||||
|
||||
Assert.isTrue(tenantSecretKey.getTenantStatus(), "当前租户已停用");
|
||||
|
||||
List<TenantWhite> tenantWhites = tenantWhiteService.selectTenantWhiteList(TenantWhite.builder()
|
||||
.tenantId(tenantSecretKey.getId())
|
||||
.whiteIp(IpUtils.getIpAddr())
|
||||
.build());
|
||||
Assert.isTrue(!tenantWhites.isEmpty(), "当前"+IpUtils.getIpAddr()+"不在白名单内");
|
||||
|
||||
String keyG = Md5Utils.md5New(random + key + tenantSecretKey.getTenantSecret());
|
||||
Assert.isTrue(keyG.equals(sign), "签名错误");
|
||||
//保存
|
||||
keyUtils.set(tenantSecretKey);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,814 +0,0 @@
|
|||
package com.ff.api.controller;
|
||||
|
||||
|
||||
import com.ff.annotation.CheckHeader;
|
||||
import com.ff.api.request.*;
|
||||
import com.ff.api.response.*;
|
||||
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.ErrorCode;
|
||||
import com.ff.base.enums.TransferType;
|
||||
import com.ff.base.exception.base.ApiException;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.common.dto.GameBalanceExchange;
|
||||
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.dto.GameBettingDetailsDTO;
|
||||
import com.ff.game.service.*;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import lombok.Data;
|
||||
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.CollectionUtils;
|
||||
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.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* api控制器
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@RestController
|
||||
@CheckHeader
|
||||
@RequestMapping("/api/game")
|
||||
@Slf4j
|
||||
public class ApiGameController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private Map<String, IGamesService> gamesService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IGameService gameService;
|
||||
|
||||
|
||||
@Resource
|
||||
private KeyConfig keyConfig;
|
||||
|
||||
@Resource
|
||||
private IMemberService memberService;
|
||||
|
||||
@Resource
|
||||
private ITenantGameQuotaService tenantGameQuotaService;
|
||||
|
||||
@Resource
|
||||
private IGameBettingDetailsService gameBettingDetailsService;
|
||||
|
||||
@Resource
|
||||
private IGameFreeRecordService gameFreeRecordService;
|
||||
@Resource
|
||||
private IGameExchangeMoneyService gameExchangeMoneyService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("threadPoolTaskExecutor")
|
||||
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
||||
|
||||
@Resource
|
||||
private IPlatformService platformService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public AjaxResult list() {
|
||||
List<GameResponse> gameResponses = gameService.selectGameResponseList();
|
||||
for (GameResponse gameResponse : gameResponses) {
|
||||
Platform platform = platformService.get(gameResponse.getPlatformCode());
|
||||
if (null == platform) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> currencyCode = new ArrayList<>(platform.getCurrencyInfo().keySet());
|
||||
gameResponse.setCurrencyCode(currencyCode);
|
||||
|
||||
}
|
||||
return AjaxResult.success(gameResponses);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
* @param loginRequest 登入游戏
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@Validated @RequestBody GameLoginRequest loginRequest) {
|
||||
|
||||
Game game = gameService.selectGameByGameId(loginRequest.getGameId());
|
||||
ApiException.notNull(game, ErrorCode.GAME_NOT_EXIST.getCode());
|
||||
|
||||
Platform platform = platformService.get(game.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
IGamesService iGamesService = gamesService.get(platform.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
String targetCurrency = platform.getCurrencyInfo().get(loginRequest.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(loginRequest.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(loginRequest.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
String targetLang = platform.getLangInfo().get(loginRequest.getLangCode());
|
||||
ApiException.notNull(targetLang, ErrorCode.LANG_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
Member member = memberService.selectMemberByAccount(loginRequest.getAccount(), loginRequest.getCurrencyCode(), platform.getPlatformCode());
|
||||
ApiException.notNull(member, ErrorCode.ACCOUNT_NOT_EXIST.getCode());
|
||||
|
||||
GamesLogin gamesLogin = GamesLogin.builder()
|
||||
.agentId(keyInfo.getCode())
|
||||
.agentKey(keyInfo.getKey())
|
||||
.account(member.getGameAccount())
|
||||
.gameType(game.getGameSourceType())
|
||||
.currency(/*secretKeyCurrencyDTO.getCurrency()*/targetCurrency)
|
||||
.gameId(game.getGameCode())
|
||||
.homeUrl(loginRequest.getHomeUrl())
|
||||
.betLimit(loginRequest.getBetLimit())
|
||||
.platform(loginRequest.getPlatform())
|
||||
.disableFullScreen(loginRequest.getDisableFullScreen())
|
||||
.lang(/*gameSecretKeyLangDTO.getLang()*/ targetLang)
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(loginRequest.getCurrencyCode())
|
||||
|
||||
.build();
|
||||
|
||||
String login = iGamesService.loginWithoutRedirect(gamesLogin);
|
||||
|
||||
return AjaxResult.success("操作成功", login);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 汇兑差额
|
||||
*
|
||||
* @param gameExchangeBalanceRequest 游戏兑换余额请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/exchange/balance")
|
||||
@Transactional
|
||||
public AjaxResult exchangeBalance(@Validated @RequestBody GameExchangeBalanceRequest gameExchangeBalanceRequest) {
|
||||
|
||||
IGamesService iGamesService = gamesService.get(gameExchangeBalanceRequest.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
|
||||
|
||||
Platform platform = platformService.get(gameExchangeBalanceRequest.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
String targetCurrency = platform.getCurrencyInfo().get(gameExchangeBalanceRequest.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(gameExchangeBalanceRequest.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(gameExchangeBalanceRequest.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
BigDecimal quota = BigDecimal.ZERO;
|
||||
//如果是扣钱提前扣
|
||||
if (TransferType.GAMES.getCode().equals(gameExchangeBalanceRequest.getTransferType())) {
|
||||
quota = tenantGameQuotaService.gameBalanceExchange(GameBalanceExchange.builder()
|
||||
.platformCode(gameExchangeBalanceRequest.getPlatformCode())
|
||||
.sourceId(gameExchangeBalanceRequest.getOrderId())
|
||||
.currencyCode(gameExchangeBalanceRequest.getCurrencyCode())
|
||||
.currency(targetCurrency)
|
||||
.transferType(gameExchangeBalanceRequest.getTransferType())
|
||||
.amount(gameExchangeBalanceRequest.getAmount())
|
||||
.account(gameExchangeBalanceRequest.getAccount())
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.systemCurrency(gameExchangeBalanceRequest.getCurrencyCode())
|
||||
.agentId(keyInfo.getCode())
|
||||
.agentKey(keyInfo.getKey())
|
||||
.build());
|
||||
}
|
||||
|
||||
|
||||
// 获取用户信息
|
||||
Member member = memberService.selectMemberByAccount(gameExchangeBalanceRequest.getAccount(), gameExchangeBalanceRequest.getCurrencyCode(), gameExchangeBalanceRequest.getPlatformCode());
|
||||
ApiException.notNull(member, ErrorCode.ACCOUNT_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
//操作第三方额度接口
|
||||
ExchangeTransferMoneyRequestDTO exchangeTransferMoneyRequestDTO = ExchangeTransferMoneyRequestDTO.builder()
|
||||
.agentId(keyInfo.getCode())
|
||||
.agentKey(keyInfo.getKey())
|
||||
.orderId(gameExchangeBalanceRequest.getOrderId())
|
||||
.account(member.getGameAccount())
|
||||
.currency(targetCurrency)
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.quota(quota)
|
||||
.amount(gameExchangeBalanceRequest.getAmount())
|
||||
.transferType(gameExchangeBalanceRequest.getTransferType())
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(gameExchangeBalanceRequest.getCurrencyCode())
|
||||
|
||||
.build();
|
||||
Long exchangeTransferId = iGamesService.exchangeTransferByAgentId(exchangeTransferMoneyRequestDTO);
|
||||
GameExchangeMoney gameExchangeMoney = gameExchangeMoneyService.selectGameExchangeMoneyById(exchangeTransferId);
|
||||
GameExchangeBalanceResponse gameExchangeBalanceResponse = new GameExchangeBalanceResponse();
|
||||
BeanUtils.copyProperties(gameExchangeMoney, gameExchangeBalanceResponse);
|
||||
return AjaxResult.success(gameExchangeBalanceResponse);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 交换状态
|
||||
*
|
||||
* @param gameExchangeStateRequest 游戏兑换余额状态请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/exchange/state")
|
||||
@Transactional
|
||||
public AjaxResult exchangeState(@Validated @RequestBody GameExchangeStateRequest gameExchangeStateRequest) {
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
GameExchangeMoney gameExchangeMoney = GameExchangeMoney.builder()
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.orderId(gameExchangeStateRequest.getOrderId())
|
||||
.build();
|
||||
List<GameExchangeMoney> gameExchangeMonies = gameExchangeMoneyService.selectGameExchangeMoneyList(gameExchangeMoney);
|
||||
ApiException.isTrue(!CollectionUtils.isEmpty(gameExchangeMonies), ErrorCode.ORDER_NOT_EXIST.getCode());
|
||||
GameExchangeBalanceResponse gameExchangeBalanceResponse = new GameExchangeBalanceResponse();
|
||||
BeanUtils.copyProperties(gameExchangeMonies.get(0), gameExchangeBalanceResponse);
|
||||
return AjaxResult.success(gameExchangeBalanceResponse);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 赠送免费局数
|
||||
*
|
||||
* @param gameCreateFreeSpinRequest 游戏创建免费旋转请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/create/free/spin")
|
||||
public AjaxResult createFreeSpin(@Validated @RequestBody GameCreateFreeSpinRequest gameCreateFreeSpinRequest) {
|
||||
|
||||
|
||||
IGamesService iGamesService = gamesService.get(gameCreateFreeSpinRequest.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
// TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
// GameSecretKeyCurrencyDTO gameSecretKey = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTO(GameSecretKeyCurrencyDTO.builder()
|
||||
// .platformCode(gameCreateFreeSpinRequest.getPlatformCode())
|
||||
// .systemCurrency(gameCreateFreeSpinRequest.getCurrencyCode()).build());
|
||||
// ApiException.notNull(gameSecretKey, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
Platform platform = platformService.get(gameCreateFreeSpinRequest.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
String targetCurrency = platform.getCurrencyInfo().get(gameCreateFreeSpinRequest.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(gameCreateFreeSpinRequest.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(gameCreateFreeSpinRequest.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
Member member = memberService.selectMemberByAccount(gameCreateFreeSpinRequest.getAccount(), gameCreateFreeSpinRequest.getCurrencyCode(), gameCreateFreeSpinRequest.getPlatformCode());
|
||||
ApiException.notNull(member, ErrorCode.ACCOUNT_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
CreateFreeSpinRequestDTO createFreeSpinRequestDTO = CreateFreeSpinRequestDTO.builder()
|
||||
.account(member.getGameAccount())
|
||||
.currency(/*gameCreateFreeSpinRequest.getCurrencyCode()*/targetCurrency)
|
||||
.agentId(keyInfo.getCode())
|
||||
.agentKey(keyInfo.getKey())
|
||||
.referenceId(gameCreateFreeSpinRequest.getReferenceId())
|
||||
.freeSpinValidity(gameCreateFreeSpinRequest.getFreeSpinValidity())
|
||||
.numberOfRounds(gameCreateFreeSpinRequest.getNumberOfRounds())
|
||||
.gameIds(gameCreateFreeSpinRequest.getGameIds())
|
||||
.betValue(gameCreateFreeSpinRequest.getBetValue())
|
||||
.startTime(gameCreateFreeSpinRequest.getStartTime())
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(gameCreateFreeSpinRequest.getCurrencyCode())
|
||||
.build();
|
||||
|
||||
|
||||
return AjaxResult.success(iGamesService.createFreeSpin(createFreeSpinRequestDTO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取投注记录
|
||||
*
|
||||
* @param gameCreateFreeSpinRequest 游戏创建免费旋转请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/get/bet/record")
|
||||
public TableDataInfo getBetRecord(@Validated @RequestBody GameGetBetRecordRequest gameCreateFreeSpinRequest) {
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
|
||||
startPage();
|
||||
PageHelper.startPage(gameCreateFreeSpinRequest.getPageNo(), gameCreateFreeSpinRequest.getPageSize(), "wagers_time desc");
|
||||
GameBettingDetailsDTO gameBettingDetails = GameBettingDetailsDTO.builder()
|
||||
.platformCode(gameCreateFreeSpinRequest.getPlatformCode())
|
||||
.currencyCode(gameCreateFreeSpinRequest.getCurrencyCode())
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.timeType(gameCreateFreeSpinRequest.getTimeType())
|
||||
.build();
|
||||
Map<String, Object> params = gameBettingDetails.getParams();
|
||||
params.put("beginTime", gameCreateFreeSpinRequest.getBeginTime());
|
||||
params.put("endTime", gameCreateFreeSpinRequest.getEndTime());
|
||||
List<GameBettingDetails> bettingDetails = gameBettingDetailsService.selectGameBettingDetailsList(gameBettingDetails);
|
||||
TableDataInfo dataTable = getDataTable(bettingDetails);
|
||||
List<GameBettingDetailsResponse> result = new ArrayList<>();
|
||||
for (GameBettingDetails row : (List<GameBettingDetails>) dataTable.getRows()) {
|
||||
GameBettingDetailsResponse gameBettingDetailsResponse = new GameBettingDetailsResponse();
|
||||
BeanUtils.copyProperties(row, gameBettingDetailsResponse);
|
||||
Member member = memberService.selectMemberById(row.getMemberId());
|
||||
gameBettingDetailsResponse.setAccount(member.getMemberAccount());
|
||||
result.add(gameBettingDetailsResponse);
|
||||
}
|
||||
dataTable.setRows(result);
|
||||
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*
|
||||
* @param gameGetDetailRequest 游戏获取详细信息请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/get/detail")
|
||||
public AjaxResult getDetail(@Validated @RequestBody GameGetDetailRequest gameGetDetailRequest) {
|
||||
Platform platform = platformService.get(gameGetDetailRequest.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
String targetCurrency = platform.getCurrencyInfo().get(gameGetDetailRequest.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(gameGetDetailRequest.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(gameGetDetailRequest.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
String targetLang = platform.getLangInfo().get(gameGetDetailRequest.getLangCode());
|
||||
ApiException.notNull(targetLang, ErrorCode.LANG_NOT_EXIST.getCode());
|
||||
|
||||
// GameSecretKeyCurrencyDTO gameSecretKey = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTO(GameSecretKeyCurrencyDTO.builder()
|
||||
// .platformCode(gameGetDetailRequest.getPlatformCode())
|
||||
// .systemCurrency(gameGetDetailRequest.getCurrencyCode()).build());
|
||||
|
||||
|
||||
// ApiException.notNull(gameSecretKey, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
IGamesService iGamesService = gamesService.get(gameGetDetailRequest.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
// GameSecretKeyLangDTO gameSecretKeyLang = gameSecretKeyLangService.findGameSecretKeyLangDTO(GameSecretKeyLangDTO.builder()
|
||||
// .platformCode(gameGetDetailRequest.getPlatformCode())
|
||||
// .systemLangCode(gameGetDetailRequest.getLangCode())
|
||||
// .build());
|
||||
// ApiException.notNull(gameSecretKeyLang, ErrorCode.LANG_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
GetGameDetailResponseDTO gameDetail = iGamesService.getGameDetail(GetGameDetailRequestDTO.builder()
|
||||
.wagersId(gameGetDetailRequest.getWagersId())
|
||||
.lang(/*gameSecretKeyLang.getLang()*/targetLang)
|
||||
.agentId(keyInfo.getCode())
|
||||
.agentKey(keyInfo.getKey())
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(gameGetDetailRequest.getCurrencyCode())
|
||||
.build());
|
||||
return AjaxResult.success(gameDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 踢腿队员
|
||||
*
|
||||
* @param gameKickMemeberRequest 游戏踢迷请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/kick/member")
|
||||
public AjaxResult kickMember(@Validated @RequestBody GameKickMemeberRequest gameKickMemeberRequest) {
|
||||
// GameSecretKeyCurrencyDTO gameSecretKey = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTO(GameSecretKeyCurrencyDTO.builder()
|
||||
// .platformCode(gameKickMemeberRequest.getPlatformCode())
|
||||
// .systemCurrency(gameKickMemeberRequest.getCurrencyCode()).build());
|
||||
// ApiException.notNull(gameSecretKey, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
Platform platform = platformService.get(gameKickMemeberRequest.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
String targetCurrency = platform.getCurrencyInfo().get(gameKickMemeberRequest.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(gameKickMemeberRequest.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(gameKickMemeberRequest.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
IGamesService iGamesService = gamesService.get(gameKickMemeberRequest.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
Member member = memberService.selectMemberByAccount(gameKickMemeberRequest.getAccount(), gameKickMemeberRequest.getCurrencyCode(), gameKickMemeberRequest.getPlatformCode());
|
||||
ApiException.notNull(member, ErrorCode.ACCOUNT_NOT_EXIST.getCode());
|
||||
|
||||
return AjaxResult.success(iGamesService.kickMember(KickMemberRequestDTO.builder()
|
||||
.account(member.getGameAccount())
|
||||
.agentId(keyInfo.getCode())
|
||||
.currency(targetCurrency)
|
||||
.agentKey(keyInfo.getKey())
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(gameKickMemeberRequest.getCurrencyCode())
|
||||
.build()));
|
||||
}
|
||||
|
||||
@PostMapping("/kick/member/all")
|
||||
public AjaxResult kickMemberAll(@Validated @RequestBody GameKickMemeberAllRequest gameKickMemeberAllRequest) {
|
||||
// GameSecretKeyCurrencyDTO gameSecretKey = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTO(GameSecretKeyCurrencyDTO.builder()
|
||||
// .platformCode(gameKickMemeberAllRequest.getPlatformCode())
|
||||
// .systemCurrency(gameKickMemeberAllRequest.getCurrencyCode()).build());
|
||||
//
|
||||
// ApiException.notNull(gameSecretKey, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
Platform platform = platformService.get(gameKickMemeberAllRequest.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
String targetCurrency = platform.getCurrencyInfo().get(gameKickMemeberAllRequest.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(gameKickMemeberAllRequest.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(gameKickMemeberAllRequest.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
IGamesService iGamesService = gamesService.get(gameKickMemeberAllRequest.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
KickMemberAllDTO kickMemberAllDTO = KickMemberAllDTO.builder()
|
||||
.agentId(keyInfo.getCode())
|
||||
.agentKey(keyInfo.getKey())
|
||||
.currency(/*gameSecretKey.getCurrency()*/targetCurrency)
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(gameKickMemeberAllRequest.getCurrencyCode())
|
||||
.build();
|
||||
if (!ObjectUtils.isEmpty(gameKickMemeberAllRequest.getGameId())) {
|
||||
Game game = gameService.selectGameById(gameKickMemeberAllRequest.getGameId());
|
||||
ApiException.notNull(game, ErrorCode.GAME_NOT_EXIST.getCode());
|
||||
kickMemberAllDTO.setGameId(game.getGameCode());
|
||||
}
|
||||
|
||||
|
||||
return AjaxResult.success(iGamesService.kickMemberAll(kickMemberAllDTO));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得自由旋转气流
|
||||
*
|
||||
* @param gameGetFreeSpinDashflowRequest 游戏获得免费旋转dashflow请求
|
||||
* @return {@link TableDataInfo }
|
||||
*/
|
||||
@PostMapping("/get/free/spin/dashflow")
|
||||
public TableDataInfo getFreeSpinDashflow(@Validated @RequestBody GameGetFreeSpinDashflowRequest gameGetFreeSpinDashflowRequest) {
|
||||
PageHelper.startPage(gameGetFreeSpinDashflowRequest.getPageNo(), gameGetFreeSpinDashflowRequest.getPageSize(), "free_update_time desc");
|
||||
GameFreeRecord gameFreeRecord = GameFreeRecord.builder()
|
||||
.gameId(gameGetFreeSpinDashflowRequest.getGameId())
|
||||
.platformCode(gameGetFreeSpinDashflowRequest.getPlatformCode())
|
||||
.currencyCode(gameGetFreeSpinDashflowRequest.getCurrencyCode())
|
||||
.build();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消自由旋转
|
||||
*
|
||||
* @param request 游戏获得免费旋转dashflow请求
|
||||
* @return {@link TableDataInfo }
|
||||
*/
|
||||
@PostMapping("/cancel/free/spin")
|
||||
public AjaxResult cancelFreeSpin(@Validated @RequestBody GameCancelFreeSpinRequest request) {
|
||||
// GameSecretKeyCurrencyDTO gameSecretKey = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTO(GameSecretKeyCurrencyDTO.builder()
|
||||
// .platformCode(gameGetFreeSpinDashflowRequest.getPlatformCode())
|
||||
// .systemCurrency(gameGetFreeSpinDashflowRequest.getCurrencyCode()).build());
|
||||
// ApiException.notNull(gameSecretKey, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
Platform platform = platformService.get(request.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
String targetCurrency = platform.getCurrencyInfo().get(request.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(request.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(request.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
IGamesService iGamesService = gamesService.get(request.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
Boolean cancelFreeSpin = iGamesService.cancelFreeSpin(CancelFreeSpinRequestDTO.builder()
|
||||
.agentId(keyInfo.getCode())
|
||||
.agentKey(keyInfo.getKey())
|
||||
.referenceId(request.getReferenceId())
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(request.getCurrencyCode())
|
||||
.build());
|
||||
return AjaxResult.success(cancelFreeSpin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息全部
|
||||
*
|
||||
* @param request 成员信息所有api请求
|
||||
* @return {@link AjaxResult }
|
||||
*//*
|
||||
@PostMapping("/exchange/balance/all")
|
||||
public AjaxResult exchangeBalanceAll(@Validated @RequestBody GameExchangeBalanceAllRequest request) {
|
||||
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
|
||||
// List<GameSecretKeyCurrencyDTO> gameSecretKeys = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTOList(GameSecretKeyCurrencyDTO.builder()
|
||||
// .systemCurrency(gameExchangeBalanceAllRequest.getCurrencyCode()).build());
|
||||
|
||||
|
||||
List<Key> keys = new ArrayList<>();
|
||||
for (GamePlatforms platformEnum : GamePlatforms.values()) {
|
||||
|
||||
Platform platform = platformService.get(platformEnum.getCode());
|
||||
String targetCurrency = platform.getCurrencyInfo().get(request.getCurrencyCode());
|
||||
if (StringUtils.isEmpty(targetCurrency)) {
|
||||
continue;
|
||||
}
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(request.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(request.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (null == keyInfo) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Key key = new Key();
|
||||
key.setPlatformCode(platform.getPlatformCode());
|
||||
key.setCode(keyInfo.getCode());
|
||||
key.setKey(keyInfo.getKey());
|
||||
key.setCurrency(targetCurrency);
|
||||
key.setPlatform(platform);
|
||||
key.setKeyInfo(keyInfo);
|
||||
key.setSystemCurrency(request.getCurrencyCode());
|
||||
keys.add(key);
|
||||
}
|
||||
|
||||
// 创建线程池
|
||||
Map<String, BigDecimal> balanceMap = new LinkedHashMap<>();
|
||||
CountDownLatch latch = new CountDownLatch(keys.size());
|
||||
|
||||
// 使用List存储Future对象,用于获取异步执行的结果
|
||||
List<Future<Long>> futures = new ArrayList<>();
|
||||
|
||||
// 提交异步任务到线程池
|
||||
// for (GameSecretKeyCurrencyDTO gameSecretKeyCurrencyDTO : gameSecretKeys) {
|
||||
for (Key key : keys) {
|
||||
futures.add(threadPoolTaskExecutor.submit(() -> {
|
||||
try {
|
||||
|
||||
IGamesService iGamesService = gamesService.get(key.getPlatformCode() + Constants.SERVICE);
|
||||
|
||||
Member member = memberService.selectMemberByAccount(request.getAccount(), request.getCurrencyCode(), key.getPlatformCode());
|
||||
ApiException.notNull(member, ErrorCode.ACCOUNT_NOT_EXIST.getCode());
|
||||
|
||||
//操作第三方钱包
|
||||
ExchangeTransferMoneyRequestDTO exchangeTransferMoneyRequestDTO = ExchangeTransferMoneyRequestDTO.builder()
|
||||
.agentId(key.getCode())
|
||||
.agentKey(key.getKey())
|
||||
.orderId(request.getOrderId())
|
||||
.amount(BigDecimal.ONE)
|
||||
.currency(*//*gameSecretKeyCurrencyDTO.getCurrency()*//*key.currency)
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.account(member.getGameAccount())
|
||||
.vendor(key.getPlatform())
|
||||
.keyInfo(key.getKeyInfo())
|
||||
.systemCurrency(key.systemCurrency)
|
||||
.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;
|
||||
}
|
||||
Member member = memberService.selectMemberById(gameExchangeMoney.getMemberId());
|
||||
balanceMap.put(gameExchangeMoney.getPlatformCode(), gameExchangeMoney.getBalance());
|
||||
BigDecimal balance = gameExchangeMoney.getBalance();
|
||||
balanceAll = NumberUtil.add(balanceAll, balance);
|
||||
|
||||
//操作租户额度
|
||||
tenantGameQuotaService.gameBalanceExchange(GameBalanceExchange.builder()
|
||||
.platformCode(gameExchangeMoney.getPlatformCode())
|
||||
.currencyCode(gameExchangeMoney.getCurrencyCode())
|
||||
.sourceId(request.getOrderId())
|
||||
.transferType(TransferType.ALL.getCode())
|
||||
.amount(gameExchangeMoney.getBalance())
|
||||
.account(member.getMemberAccount())
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.currency()
|
||||
.systemCurrency(gameExchangeMoney.getCurrencyCode())
|
||||
.agentId()
|
||||
.agentKey()
|
||||
.build());
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("拉回用户余额失败", e);
|
||||
throw new BaseException("拉回用户余额失败");
|
||||
}
|
||||
balanceMap.put("balanceAll", balanceAll);
|
||||
|
||||
|
||||
return AjaxResult.success(balanceMap);
|
||||
}*/
|
||||
|
||||
|
||||
/**
|
||||
* 演示登录
|
||||
*
|
||||
* @param request 游戏演示登录请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/demo/login")
|
||||
public AjaxResult demoLogin(@Validated @RequestBody GameDemoLoginRequest request) {
|
||||
|
||||
Game game = gameService.selectGameById(request.getGameId());
|
||||
ApiException.notNull(game, ErrorCode.GAME_NOT_EXIST.getCode());
|
||||
|
||||
//GamePlatform gamePlatform = gamePlatformService.selectGamePlatformById(game.getPlatformId());
|
||||
//ApiException.notNull(gamePlatform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
Platform platform = platformService.get(game.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
IGamesService iGamesService = gamesService.get(platform.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
String targetCurrency = platform.getCurrencyInfo().get(request.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(request.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(request.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
String targetLang = platform.getLangInfo().get(request.getLangCode());
|
||||
ApiException.notNull(targetLang, ErrorCode.LANG_NOT_EXIST.getCode());
|
||||
|
||||
// GameSecretKeyLangDTO gameSecretKeyLangDTO = gameSecretKeyLangService.findGameSecretKeyLangDTO(GameSecretKeyLangDTO.builder()
|
||||
// .platformCode(gamePlatform.getPlatformCode())
|
||||
// .systemLangCode(gameDemoLoginRequest.getLangCode())
|
||||
// .build());
|
||||
// ApiException.notNull(gameSecretKeyLangDTO, ErrorCode.LANG_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
GameDemoLoginRequestDTO gamesLogin = GameDemoLoginRequestDTO.builder()
|
||||
.gameId(game.getGameCode())
|
||||
.gameType(game.getGameSourceType())
|
||||
.lang(/*gameSecretKeyLangDTO.getLang()*/targetLang)
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(request.getCurrencyCode())
|
||||
.build();
|
||||
|
||||
GameDemoLoginResponseDTO gameDemoLoginResponseDTO = iGamesService.gameDemoLogin(gamesLogin);
|
||||
GameDemoLoginResponse gameDemoLoginResponse = new GameDemoLoginResponse();
|
||||
BeanUtils.copyProperties(gameDemoLoginResponseDTO, gameDemoLoginResponse);
|
||||
return AjaxResult.success(gameDemoLoginResponse);
|
||||
}
|
||||
|
||||
@Data
|
||||
class Key {
|
||||
private String platformCode;
|
||||
private String code;
|
||||
private String currency;
|
||||
private String key;
|
||||
private Platform platform;
|
||||
private KeyInfo keyInfo;
|
||||
private String systemCurrency;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,318 +0,0 @@
|
|||
package com.ff.api.controller;
|
||||
|
||||
|
||||
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.enums.ErrorCode;
|
||||
import com.ff.base.enums.GamePlatforms;
|
||||
import com.ff.base.exception.base.ApiException;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import com.ff.config.KeyConfig;
|
||||
import com.ff.game.api.IGamesService;
|
||||
import com.ff.game.api.request.CreateMemberRequestDTO;
|
||||
import com.ff.game.api.request.MemberInfoRequestDTO;
|
||||
import com.ff.game.api.request.MemberInfoResponseDTO;
|
||||
import com.ff.game.domain.KeyInfo;
|
||||
import com.ff.game.domain.Platform;
|
||||
import com.ff.game.service.IPlatformService;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import lombok.Data;
|
||||
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.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/member")
|
||||
@Slf4j
|
||||
public class ApiMemberController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private Map<String, IGamesService> gamesService;
|
||||
|
||||
@Resource
|
||||
private KeyConfig keyConfig;
|
||||
|
||||
@Resource
|
||||
private IMemberService memberService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("threadPoolTaskExecutor")
|
||||
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
||||
|
||||
@Resource
|
||||
private IPlatformService platformService;
|
||||
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @param memberCreateApiRequest 创建成员api请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
@Transactional
|
||||
public synchronized AjaxResult createMember(@Validated @RequestBody MemberCreateApiRequest memberCreateApiRequest) {
|
||||
|
||||
IGamesService iGamesService = gamesService.get(memberCreateApiRequest.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
|
||||
Platform platform = platformService.get(memberCreateApiRequest.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
String targetCurrency = platform.getCurrencyInfo().get(memberCreateApiRequest.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(memberCreateApiRequest.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(memberCreateApiRequest.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
String gameAccount =memberService.getMemberGameAccount(memberCreateApiRequest.getPlatformCode(), tenantSecretKey.getTenantSn());
|
||||
|
||||
|
||||
// 获取用户信息
|
||||
Member gameMember = memberService.selectMemberByAccount(memberCreateApiRequest.getAccount(), memberCreateApiRequest.getCurrencyCode(), memberCreateApiRequest.getPlatformCode());
|
||||
if (!ObjectUtils.isEmpty(gameMember)) {
|
||||
throw new ApiException(ErrorCode.GAME_ACCOUNT_CREATION_FAILED.getCode());
|
||||
}
|
||||
|
||||
|
||||
//注册本地账号
|
||||
Member member = Member.builder()
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.memberAccount(memberCreateApiRequest.getAccount())
|
||||
.gameAccount(gameAccount)
|
||||
.platformCode(memberCreateApiRequest.getPlatformCode())
|
||||
.currencyCode(memberCreateApiRequest.getCurrencyCode())
|
||||
.build();
|
||||
int insertMember = memberService.insertMember(member);
|
||||
Assert.isTrue(insertMember > 0, "建立游戏账号失败");
|
||||
|
||||
//向第三方注册账号
|
||||
CreateMemberRequestDTO gamesBaseRequestDTO = CreateMemberRequestDTO.builder()
|
||||
.account(gameAccount)
|
||||
.agentId(keyInfo.getCode())
|
||||
.agentKey(keyInfo.getKey())
|
||||
.betLimit(memberCreateApiRequest.getBetLimit())
|
||||
.platformType(memberCreateApiRequest.getPlatformType())
|
||||
.currency(targetCurrency)
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(memberCreateApiRequest.getCurrencyCode())
|
||||
.build();
|
||||
Boolean result = iGamesService.createMember(gamesBaseRequestDTO);
|
||||
Assert.isTrue(result, "建立游戏账号失败");
|
||||
|
||||
|
||||
|
||||
|
||||
return toAjax(Boolean.TRUE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param request 成员信息api请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/info")
|
||||
public AjaxResult getMemberInfo(@Validated @RequestBody MemberInfoApiRequest request) {
|
||||
IGamesService iGamesService = gamesService.get(request.getPlatformCode() + Constants.SERVICE);
|
||||
ApiException.notNull(iGamesService, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
Platform platform = platformService.get(request.getPlatformCode());
|
||||
ApiException.notNull(platform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
String targetCurrency = platform.getCurrencyInfo().get(request.getCurrencyCode());
|
||||
ApiException.notNull(targetCurrency, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(request.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(request.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ApiException.notNull(keyInfo, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||
|
||||
// 获取用户信息
|
||||
Member member = memberService.selectMemberByAccount(request.getAccount(), request.getCurrencyCode(), request.getPlatformCode());
|
||||
ApiException.notNull(member, ErrorCode.ACCOUNT_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
//向第三方查询账号
|
||||
MemberInfoRequestDTO gamesBaseRequestDTO = MemberInfoRequestDTO.builder()
|
||||
.accounts(member.getGameAccount())
|
||||
.agentId(keyInfo.getCode())
|
||||
.currency(targetCurrency)
|
||||
.agentKey(keyInfo.getKey())
|
||||
.vendor(platform)
|
||||
.keyInfo(keyInfo)
|
||||
.systemCurrency(request.getCurrencyCode())
|
||||
.build();
|
||||
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) {
|
||||
|
||||
|
||||
// List<GameSecretKeyCurrencyDTO> gameSecretKeys = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTOList(
|
||||
// GameSecretKeyCurrencyDTO.builder()
|
||||
// .systemCurrency(memberInfoAllApiRequest.getCurrencyCode()).build());
|
||||
List<Key> keys = new ArrayList<>();
|
||||
for (GamePlatforms platformEnum : GamePlatforms.values()) {
|
||||
|
||||
Platform platform = platformService.get(platformEnum.getCode());
|
||||
String targetCurrency = platform.getCurrencyInfo().get(memberInfoAllApiRequest.getCurrencyCode());
|
||||
if (StringUtils.isEmpty(targetCurrency)) {
|
||||
continue;
|
||||
}
|
||||
KeyInfo keyInfo = null;
|
||||
for (KeyInfo keyData : platform.getKeyInfo()) {
|
||||
if (StringUtils.isNotEmpty(memberInfoAllApiRequest.getCurrencyCode())) {
|
||||
if (keyData.getCurrency().equalsIgnoreCase(memberInfoAllApiRequest.getCurrencyCode())) {
|
||||
keyInfo = keyData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (null == keyInfo) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Key key = new Key();
|
||||
key.setPlatformCode(platform.getPlatformCode());
|
||||
key.setCode(keyInfo.getCode());
|
||||
key.setKey(keyInfo.getKey());
|
||||
key.setCurrency(targetCurrency);
|
||||
key.setSystemCurrency(memberInfoAllApiRequest.getCurrencyCode());
|
||||
keys.add(key);
|
||||
}
|
||||
// 创建线程池
|
||||
Map<String, BigDecimal> balanceMap = new LinkedHashMap<>();
|
||||
CountDownLatch latch = new CountDownLatch(keys.size());
|
||||
|
||||
// 使用List存储Future对象,用于获取异步执行的结果
|
||||
List<Future<MemberInfoAllResponse>> futures = new ArrayList<>();
|
||||
|
||||
// 提交异步任务到线程池
|
||||
for (Key gameSecretKey : keys) {
|
||||
|
||||
futures.add(threadPoolTaskExecutor.submit(() -> {
|
||||
|
||||
try {
|
||||
IGamesService iGamesService = gamesService.get(gameSecretKey.getPlatformCode() + Constants.SERVICE);
|
||||
|
||||
// 获取用户信息
|
||||
Member member = memberService.selectMemberByAccount(memberInfoAllApiRequest.getAccount(), memberInfoAllApiRequest.getCurrencyCode(), gameSecretKey.getPlatformCode());
|
||||
ApiException.notNull(member, ErrorCode.ACCOUNT_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
MemberInfoRequestDTO gamesBaseRequestDTO = MemberInfoRequestDTO.builder()
|
||||
.accounts(member.getGameAccount())
|
||||
.agentId(gameSecretKey.getCode())
|
||||
.currency(gameSecretKey.getCurrency())
|
||||
.systemCurrency(gameSecretKey.getSystemCurrency())
|
||||
.agentKey(gameSecretKey.getKey())
|
||||
.build();
|
||||
//查询余额
|
||||
MemberInfoResponseDTO memberInfo = iGamesService.getMemberInfo(gamesBaseRequestDTO);
|
||||
return MemberInfoAllResponse.builder()
|
||||
.account(member.getGameAccount())
|
||||
.balance(memberInfo.getBalance())
|
||||
.status(memberInfo.getStatus())
|
||||
.platformCode(gameSecretKey.getPlatformCode())
|
||||
.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);
|
||||
}
|
||||
|
||||
@Data
|
||||
class Key {
|
||||
private String platformCode;
|
||||
private String code;
|
||||
private String currency;
|
||||
private String key;
|
||||
private String systemCurrency;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
package com.ff.api.controller;
|
||||
|
||||
|
||||
import com.ff.annotation.CheckHeader;
|
||||
import com.ff.api.response.TenantInfoResponse;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.QuotaType;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.common.domain.TenantGameQuota;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import com.ff.config.KeyConfig;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 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(), QuotaType.BALANCE.getCode());
|
||||
TenantInfoResponse tenantInfoResponse= new TenantInfoResponse();
|
||||
BeanUtils.copyProperties(tenantGameQuota,tenantInfoResponse);
|
||||
return AjaxResult.success(tenantInfoResponse);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
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 java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 游戏获得免费游戏游玩记录
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/13
|
||||
*/
|
||||
@Data
|
||||
public class GameCancelFreeSpinRequest implements Serializable {
|
||||
private static final long serialVersionUID = 1871368632132480179L;
|
||||
|
||||
/**
|
||||
* 货币代码
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 平台代码
|
||||
*/
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
/**
|
||||
* 取消免费赠送游戏id
|
||||
*/
|
||||
@NotBlank(message = "referenceId不能为空")
|
||||
@Length(max = 40, message = "referenceId长度不能超过40个字符")
|
||||
private String referenceId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import com.ff.validation.ListSizeCheck;
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏赠送免费的局数
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/12
|
||||
*/
|
||||
@Data
|
||||
public class GameCreateFreeSpinRequest implements Serializable {
|
||||
private final static long serialVersionUID = -8079805496329012394L;
|
||||
|
||||
/**
|
||||
* 玩家账号 (JILI 新玩家则会自动创立账号)
|
||||
*/
|
||||
@NotBlank(message = "account不能为空")
|
||||
@Length(max = 64, message = "account长度不能超过64个字符")
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 玩家游戏平台
|
||||
*/
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
/**
|
||||
* 玩家使用货币
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 免费局数序号, 长度上限 40
|
||||
*/
|
||||
@NotBlank(message = "referenceId不能为空")
|
||||
@Length(min = 1, max = 40, message = "referenceId长度不能超过40")
|
||||
private String referenceId;
|
||||
|
||||
/**
|
||||
* 有效期限
|
||||
*
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "freeSpinValidity不能为空")
|
||||
@Min(value = 1, message = "freeSpinValidity最小值为1")
|
||||
private Long freeSpinValidity;
|
||||
|
||||
/**
|
||||
* 局数
|
||||
*/
|
||||
@NotNull(message = "numberOfRounds不能为空")
|
||||
private Integer numberOfRounds;
|
||||
|
||||
/**
|
||||
* 可使用游戏 ID,
|
||||
* 长度 上限 200
|
||||
*/
|
||||
@NotNull(message = "gameIds不能为空")
|
||||
@ListSizeCheck(message = "gameIds不得超过200", maxSize = 200)
|
||||
private List<Long> gameIds;
|
||||
|
||||
/**
|
||||
* 指定投注额;
|
||||
* 未指定时, 一律使用游戏中的最小投注额
|
||||
*/
|
||||
private BigDecimal betValue;
|
||||
|
||||
/**
|
||||
* 免费游戏局数可使用的开始时间
|
||||
* 未带此参数时, 赠送后玩家可以立即使用
|
||||
*/
|
||||
private Long startTime;
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 游戏登录请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/11
|
||||
*/
|
||||
@Data
|
||||
public class GameDemoLoginRequest implements Serializable {
|
||||
private final static long serialVersionUID = 7699430372422335056L;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 语种id
|
||||
*/
|
||||
@NotBlank(message = "langCode不能为空")
|
||||
@Length(max = 32, message = "langCode长度不能超过32个字符")
|
||||
private String langCode;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
@NotNull(message = "gameId不能为空")
|
||||
private Long gameId;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏回主页功能导向位置
|
||||
*/
|
||||
private String homeUrl;
|
||||
/**
|
||||
* 带入 web 或是 app
|
||||
*/
|
||||
private String platform;
|
||||
/**
|
||||
* 带入 1 即关闭全屏幕模式
|
||||
*/
|
||||
private Integer disableFullScreen;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
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;
|
||||
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@NotBlank(message = "orderId不能为空")
|
||||
private String orderId;
|
||||
|
||||
|
||||
/** 币种编码 */
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
private String currencyCode;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏兑换余额请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/11
|
||||
*/
|
||||
@Data
|
||||
public class GameExchangeBalanceRequest implements Serializable {
|
||||
private final static long serialVersionUID = -881298930995538038L;
|
||||
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
@NotBlank(message = "account不能为空")
|
||||
@Length(max = 64, message = "account长度不能超过64个字符")
|
||||
private String account;
|
||||
|
||||
|
||||
/** 平台编码 */
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@NotBlank(message = "orderId不能为空")
|
||||
@Length(max = 124, message = "orderId长度不能超过124个字符")
|
||||
private String orderId;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
@NotNull(message = "amount不能为空")
|
||||
@Min(value = 1, message = "amount最小值为1")
|
||||
@Max(value = 999999999, message = "amount最大值为999999999")
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
/** 币种编码 */
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 转账类型
|
||||
* 1: 从 游戏商 转移额度到 平台商 (不看 amount 值,全
|
||||
* 部转出)
|
||||
* 2: 从 平台商 转移额度到 游戏商
|
||||
*/
|
||||
@NotNull(message = "transferType不能为空")
|
||||
@Min(value = 1, message = "transferType最小值为1")
|
||||
@Max(value = 2, message = "transferType最大值为2")
|
||||
private Integer transferType;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 游戏交换状态请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/03/14
|
||||
*/
|
||||
@Data
|
||||
public class GameExchangeStateRequest implements Serializable {
|
||||
private final static long serialVersionUID = 5862750025968209889L;
|
||||
/**
|
||||
* 交易编号
|
||||
*/
|
||||
private String orderId;
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
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;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏获取投注记录请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/12
|
||||
*/
|
||||
@Data
|
||||
public class GameGetBetRecordRequest implements Serializable {
|
||||
private final static long serialVersionUID = -8079805496329012394L;
|
||||
|
||||
|
||||
/**
|
||||
* 货币代码
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 平台代码
|
||||
*/
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
/**
|
||||
* 开始时间 毫秒时间戳
|
||||
*/
|
||||
@NotNull(message = "beginTime不能为空")
|
||||
private Long beginTime;
|
||||
|
||||
/**
|
||||
* 结束时间 毫秒时间戳
|
||||
*/
|
||||
@NotNull(message = "endTime不能为空")
|
||||
private Long endTime;
|
||||
|
||||
|
||||
/**
|
||||
* 时间类型 1 按投注时间 2 按入库时间
|
||||
*/
|
||||
private Integer timeType=1;
|
||||
|
||||
|
||||
/**
|
||||
* 页码,默认第1页,按订单更新时间正序返回数据
|
||||
*/
|
||||
@Min(value = 1, message = "pageNo最小值为1")
|
||||
private Integer pageNo=1;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 页容量,默认200,最大2000
|
||||
*/
|
||||
@Min(value = 1, message = "pageSize最小值为1")
|
||||
@Max(value = 2000, message = "pageSize最大值为2000")
|
||||
private Integer pageSize=200;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import com.ff.validation.ListSizeCheck;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏赠送免费的局数
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/12
|
||||
*/
|
||||
@Data
|
||||
public class GameGetDetailRequest implements Serializable {
|
||||
private final static long serialVersionUID = -8079805496329012394L;
|
||||
|
||||
/**
|
||||
* 平台代码
|
||||
*/
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
/**
|
||||
* 货币代码
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 投注id
|
||||
*/
|
||||
@NotBlank(message = "wagersId不能为空")
|
||||
private String wagersId;
|
||||
|
||||
/**
|
||||
* 语言代码
|
||||
*/
|
||||
@NotBlank(message = "langCode不能为空")
|
||||
private String langCode;
|
||||
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
import com.dtflys.forest.annotation.BaseRequest;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 游戏获得免费游戏游玩记录
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/13
|
||||
*/
|
||||
@Data
|
||||
public class GameGetFreeSpinDashflowRequest implements Serializable {
|
||||
private static final long serialVersionUID = 1871368632132480179L;
|
||||
|
||||
/**
|
||||
* 货币代码
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 平台代码
|
||||
*/
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
private Long gameId;
|
||||
|
||||
/**
|
||||
* 开始时间 毫秒时间戳
|
||||
*/
|
||||
@NotNull(message = "beginTime不能为空")
|
||||
private Long beginTime;
|
||||
|
||||
/**
|
||||
* 结束时间 毫秒时间戳
|
||||
*/
|
||||
@NotNull(message = "endTime不能为空")
|
||||
private Long endTime;
|
||||
|
||||
/**
|
||||
* 页码,默认第1页,按订单更新时间正序返回数据
|
||||
*/
|
||||
@Min(value = 1, message = "pageNo最小值为1")
|
||||
private Integer pageNo=1;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 页容量,默认200,最大2000
|
||||
*/
|
||||
@Min(value = 1, message = "pageSize最小值为1")
|
||||
@Max(value = 2000, message = "pageSize最大值为2000")
|
||||
private Integer pageSize=200;
|
||||
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 游戏踢迷所有请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/12
|
||||
*/
|
||||
@Data
|
||||
public class GameKickMemeberAllRequest implements Serializable {
|
||||
private static final long serialVersionUID = -5550133375734112801L;
|
||||
|
||||
/**
|
||||
* 玩家游戏平台
|
||||
*/
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
/**
|
||||
* 玩家使用货币
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
private Long gameId;
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import com.ff.validation.ListSizeCheck;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏赠送免费的局数
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/12
|
||||
*/
|
||||
@Data
|
||||
public class GameKickMemeberRequest implements Serializable {
|
||||
private final static long serialVersionUID = 7977843394391031014L;
|
||||
|
||||
/**
|
||||
* 玩家账号
|
||||
*/
|
||||
@NotBlank(message = "account不能为空")
|
||||
@Length(max = 64, message = "account长度不能超过64个字符")
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 玩家游戏平台
|
||||
*/
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
/**
|
||||
* 玩家使用货币
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 游戏登录请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/11
|
||||
*/
|
||||
@Data
|
||||
public class GameLoginRequest implements Serializable {
|
||||
private final static long serialVersionUID = 7699430372422335056L;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 货币代码
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 语种id
|
||||
*/
|
||||
@NotBlank(message = "langCode不能为空")
|
||||
@Length(max = 32, message = "langCode长度不能超过32个字符")
|
||||
private String langCode;
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
@NotBlank(message = "account不能为空")
|
||||
@Length(max = 64, message = "account长度不能超过64个字符")
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
@NotBlank(message = "gameId不能为空")
|
||||
private String gameId;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏回主页功能导向位置
|
||||
*/
|
||||
private String homeUrl;
|
||||
/**
|
||||
* 带入 web 或是 app
|
||||
*/
|
||||
private String platform;
|
||||
/**
|
||||
* 带入 1 即关闭全屏幕模式
|
||||
*/
|
||||
private Integer disableFullScreen;
|
||||
|
||||
/**
|
||||
* ae 平台 投注限额
|
||||
*/
|
||||
private Map<String, Map<String, Map<String, Object>>> betLimit;
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 创建成员请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Data
|
||||
public class MemberCreateApiRequest implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 8071608271351542925L;
|
||||
|
||||
@NotBlank(message = "account不能为空")
|
||||
@Length(max = 64, message = "account长度不能超过64个字符")
|
||||
private String account;
|
||||
|
||||
/** 平台编码 */
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
/** 币种编码 */
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 投注限额
|
||||
*/
|
||||
private Map<String, Map<String, Map<String, Object>>> betLimit;
|
||||
|
||||
/**
|
||||
* 平台类型 0 桌面 1 移动
|
||||
*/
|
||||
private Integer platformType;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
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不能为空")
|
||||
@Length(max = 64, message = "account长度不能超过64个字符")
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 货币代码
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
private String currencyCode;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 创建成员请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Data
|
||||
public class MemberInfoApiRequest implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 8071608271351542925L;
|
||||
|
||||
@NotBlank(message = "account不能为空")
|
||||
@Length(max = 64, message = "account长度不能超过64个字符")
|
||||
private String account;
|
||||
|
||||
/** 平台编码 */
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
@Length(max = 64, message = "platformCode长度不能超过64个字符")
|
||||
private String platformCode;
|
||||
|
||||
/** 币种编码 */
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
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 lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员投注细目对象 ff_game_betting_details
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class GameBettingDetailsResponse implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -988976119749917266L;
|
||||
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
|
||||
/** 币种编码 */
|
||||
private String currencyCode;
|
||||
|
||||
|
||||
|
||||
/** 游戏id */
|
||||
private Long gameId;
|
||||
|
||||
/** 游戏类型 ff_game_type 字典 */
|
||||
private Integer gameType;
|
||||
|
||||
/** 游戏平台 */
|
||||
private String platformCode;
|
||||
|
||||
/** 游戏名称 */
|
||||
private String gameName;
|
||||
|
||||
/** 注单状态 1: 赢 2: 输 3: 平局 */
|
||||
private Integer gameStatus;
|
||||
|
||||
/** 注单类型 */
|
||||
private Integer gameStatusType;
|
||||
|
||||
/** 游戏币种类型 */
|
||||
private String gameCurrencyCode;
|
||||
|
||||
/** 系统账号 */
|
||||
private String account;
|
||||
|
||||
/** 游戏注单唯一值 */
|
||||
private String wagersId;
|
||||
|
||||
/** 投注时间 (Unix 时间戳) */
|
||||
private Long wagersTime;
|
||||
|
||||
/** 投注金额 */
|
||||
private BigDecimal betAmount;
|
||||
|
||||
/** 派彩时间 (Unix 时间戳) */
|
||||
private Long payoffTime;
|
||||
|
||||
/** 派彩金额 */
|
||||
private BigDecimal payoffAmount;
|
||||
|
||||
/** 对帐时间 (Unix 时间戳) */
|
||||
private Long settlementTime;
|
||||
|
||||
/** 有效投注金额 ※注 1 */
|
||||
private BigDecimal turnover;
|
||||
|
||||
/** 订单id */
|
||||
private String orderNo;
|
||||
|
||||
/** 结算状态 1 未结算 2已结算 3 已撤单 */
|
||||
private Integer settlementStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
package com.ff.api.response;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏演示登录响应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/04/03
|
||||
*/
|
||||
@Data
|
||||
public class GameDemoLoginResponse implements Serializable {
|
||||
private final static long serialVersionUID = 7699430372422335056L;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 网址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
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 lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录对象 ff_game_exchange_money
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class GameExchangeBalanceResponse implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
/** 租户key */
|
||||
private String tenantKey;
|
||||
|
||||
/** 币种编码 */
|
||||
private String currencyCode;
|
||||
|
||||
/** 第三方交易id */
|
||||
private String transactionId;
|
||||
|
||||
|
||||
/** 游戏平台 */
|
||||
private String platformCode;
|
||||
|
||||
/** 操作金额 */
|
||||
private BigDecimal balance;
|
||||
|
||||
|
||||
/** 转账前金额(游戏币) */
|
||||
private BigDecimal coinBefore;
|
||||
|
||||
/** 转账后金额(游戏币) */
|
||||
private BigDecimal coinAfter;
|
||||
|
||||
/** 转账前金额(指定货币) */
|
||||
private BigDecimal currencyBefore;
|
||||
|
||||
/** 转账后金额(指定货币) */
|
||||
private BigDecimal currencyAfter;
|
||||
|
||||
/** 系统订单id */
|
||||
private String orderId;
|
||||
|
||||
/** 转出类型 1游戏商转入到用户全部转出 2 用户转移到游戏商 */
|
||||
private Integer exchangeType;
|
||||
|
||||
/** 状态,0:进行中、1:成功、2:失败 */
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
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 lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 免费赠送游戏记录对象 ff_game_free_record
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-13
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@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;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
package com.ff.api.response;
|
||||
|
||||
import com.ff.game.domain.NameInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录对象 ff_game_exchange_money
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class GameResponse implements Serializable {
|
||||
private static final long serialVersionUID = 7932597077733961820L;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 游戏名称
|
||||
*/
|
||||
private String gameName;
|
||||
/**
|
||||
* 是否支持免费
|
||||
*/
|
||||
private Boolean freeSpin;
|
||||
/**
|
||||
* 是否支持试玩
|
||||
*/
|
||||
private Boolean demoStatus;
|
||||
/**
|
||||
* 平台代码
|
||||
*/
|
||||
private String platformCode;
|
||||
/**
|
||||
* 平台类型
|
||||
*/
|
||||
private Integer platformType;
|
||||
|
||||
/**
|
||||
* 支持的终端类型 1:电脑网页、2:手机网页、3:电脑/手机网页
|
||||
*/
|
||||
private Integer ingress;
|
||||
|
||||
|
||||
/**
|
||||
* 支持货币代码
|
||||
*/
|
||||
private List<String> currencyCode;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private List<NameInfo> nameInfo;
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package com.ff.api.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录对象 ff_game_exchange_money
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
package com.ff.api.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录对象 ff_game_exchange_money
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class MemberInfoResponse implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 状态:
|
||||
* 1: 在线
|
||||
* 2: 脱机
|
||||
* 3: 账号不存在
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
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;
|
||||
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
package com.ff.common.controller;
|
||||
|
||||
import com.ff.base.config.FFConfig;
|
||||
import com.ff.base.constant.CacheConstants;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.core.redis.RedisCache;
|
||||
import com.ff.base.system.service.ISysConfigService;
|
||||
import com.ff.base.utils.sign.Base64;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 验证码操作处理
|
||||
*
|
||||
* @author ff
|
||||
*/
|
||||
@RestController
|
||||
public class CaptchaController
|
||||
{
|
||||
@Resource(name = "captchaProducer")
|
||||
private Producer captchaProducer;
|
||||
|
||||
@Resource(name = "captchaProducerMath")
|
||||
private Producer captchaProducerMath;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
/**
|
||||
* 生成验证码
|
||||
*/
|
||||
@GetMapping("/captchaImage")
|
||||
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||
ajax.put("captchaEnabled", captchaEnabled);
|
||||
if (!captchaEnabled)
|
||||
{
|
||||
return ajax;
|
||||
}
|
||||
|
||||
// 保存验证码信息
|
||||
String uuid = IdUtils.simpleUUID();
|
||||
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
|
||||
|
||||
String capStr = null, code = null;
|
||||
BufferedImage image = null;
|
||||
|
||||
// 生成验证码
|
||||
String captchaType = FFConfig.getCaptchaType();
|
||||
if ("math".equals(captchaType))
|
||||
{
|
||||
String capText = captchaProducerMath.createText();
|
||||
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
||||
code = capText.substring(capText.lastIndexOf("@") + 1);
|
||||
image = captchaProducerMath.createImage(capStr);
|
||||
}
|
||||
else if ("char".equals(captchaType))
|
||||
{
|
||||
capStr = code = captchaProducer.createText();
|
||||
image = captchaProducer.createImage(capStr);
|
||||
}
|
||||
|
||||
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||
// 转换流信息写出
|
||||
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ImageIO.write(image, "jpg", os);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
ajax.put("uuid", uuid);
|
||||
ajax.put("img", Base64.encode(os.toByteArray()));
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
package com.ff.common.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.common.domain.Currency;
|
||||
import com.ff.common.service.ICurrencyService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 币种Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/currency")
|
||||
public class CurrencyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICurrencyService currencyService;
|
||||
|
||||
/**
|
||||
* 查询币种列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:currency:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Currency currency)
|
||||
{
|
||||
startPage();
|
||||
List<Currency> list = currencyService.selectCurrencyList(currency);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择
|
||||
*
|
||||
* @param currency 货币
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(Currency currency)
|
||||
{
|
||||
List<Currency> list = currencyService.selectCurrencyList(currency);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 导出币种列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:currency:export')")
|
||||
@Log(title = "币种", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Currency currency)
|
||||
{
|
||||
List<Currency> list = currencyService.selectCurrencyList(currency);
|
||||
ExcelUtil<Currency> util = new ExcelUtil<Currency>(Currency.class);
|
||||
util.exportExcel(response, list, "币种数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取币种详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:currency:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(currencyService.selectCurrencyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增币种
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:currency:add')")
|
||||
@Log(title = "币种", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Currency currency)
|
||||
{
|
||||
return toAjax(currencyService.insertCurrency(currency));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改币种
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:currency:edit')")
|
||||
@Log(title = "币种", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Currency currency)
|
||||
{
|
||||
return toAjax(currencyService.updateCurrency(currency));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除币种
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:currency:remove')")
|
||||
@Log(title = "币种", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(currencyService.deleteCurrencyByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
package com.ff.common.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.common.domain.Lang;
|
||||
import com.ff.common.service.ILangService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 系统语种管理 Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/lang")
|
||||
public class LangController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ILangService langService;
|
||||
|
||||
/**
|
||||
* 查询系统语种管理 列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:lang:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Lang lang)
|
||||
{
|
||||
startPage();
|
||||
List<Lang> list = langService.selectLangList(lang);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出系统语种管理 列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:lang:export')")
|
||||
@Log(title = "系统语种管理 ", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Lang lang)
|
||||
{
|
||||
List<Lang> list = langService.selectLangList(lang);
|
||||
ExcelUtil<Lang> util = new ExcelUtil<Lang>(Lang.class);
|
||||
util.exportExcel(response, list, "系统语种管理 数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统语种管理 详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:lang:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(langService.selectLangById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统语种管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:lang:add')")
|
||||
@Log(title = "系统语种管理 ", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Lang lang)
|
||||
{
|
||||
return toAjax(langService.insertLang(lang));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统语种管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:lang:edit')")
|
||||
@Log(title = "系统语种管理 ", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Lang lang)
|
||||
{
|
||||
return toAjax(langService.updateLang(lang));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统语种管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:lang:remove')")
|
||||
@Log(title = "系统语种管理 ", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(langService.deleteLangByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
package com.ff.common.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.common.domain.TenantGameQuota;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 租户游戏配额Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/quota")
|
||||
public class TenantGameQuotaController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantGameQuotaService tenantGameQuotaService;
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:quota:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantGameQuota tenantGameQuota)
|
||||
{
|
||||
startPage();
|
||||
List<TenantGameQuota> list = tenantGameQuotaService.selectTenantGameQuotaList(tenantGameQuota);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出租户游戏配额列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:quota:export')")
|
||||
@Log(title = "租户游戏配额", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TenantGameQuota tenantGameQuota)
|
||||
{
|
||||
List<TenantGameQuota> list = tenantGameQuotaService.selectTenantGameQuotaList(tenantGameQuota);
|
||||
ExcelUtil<TenantGameQuota> util = new ExcelUtil<TenantGameQuota>(TenantGameQuota.class);
|
||||
util.exportExcel(response, list, "租户游戏配额数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户游戏配额详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:quota:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(tenantGameQuotaService.selectTenantGameQuotaById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户游戏配额
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:quota:add')")
|
||||
@Log(title = "租户游戏配额", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TenantGameQuota tenantGameQuota)
|
||||
{
|
||||
return toAjax(tenantGameQuotaService.insertTenantGameQuota(tenantGameQuota));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户游戏配额
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:quota:edit')")
|
||||
@Log(title = "租户游戏配额", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TenantGameQuota tenantGameQuota)
|
||||
{
|
||||
return toAjax(tenantGameQuotaService.updateTenantGameQuota(tenantGameQuota));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户游戏配额
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:quota:remove')")
|
||||
@Log(title = "租户游戏配额", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(tenantGameQuotaService.deleteTenantGameQuotaByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
package com.ff.common.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 租户游戏额度流水Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/flow")
|
||||
public class TenantGameQuotaFlowController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantGameQuotaFlowService tenantGameQuotaFlowService;
|
||||
|
||||
/**
|
||||
* 查询租户游戏额度流水列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:flow:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantGameQuotaFlow tenantGameQuotaFlow)
|
||||
{
|
||||
startPage();
|
||||
List<TenantGameQuotaFlow> list = tenantGameQuotaFlowService.selectTenantGameQuotaFlowList(tenantGameQuotaFlow);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出租户游戏额度流水列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:flow:export')")
|
||||
@Log(title = "租户游戏额度流水", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TenantGameQuotaFlow tenantGameQuotaFlow)
|
||||
{
|
||||
List<TenantGameQuotaFlow> list = tenantGameQuotaFlowService.selectTenantGameQuotaFlowList(tenantGameQuotaFlow);
|
||||
ExcelUtil<TenantGameQuotaFlow> util = new ExcelUtil<TenantGameQuotaFlow>(TenantGameQuotaFlow.class);
|
||||
util.exportExcel(response, list, "租户游戏额度流水数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户游戏额度流水详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:flow:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(tenantGameQuotaFlowService.selectTenantGameQuotaFlowById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户游戏额度流水
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:flow:add')")
|
||||
@Log(title = "租户游戏额度流水", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TenantGameQuotaFlow tenantGameQuotaFlow)
|
||||
{
|
||||
return toAjax(tenantGameQuotaFlowService.insertTenantGameQuotaFlow(tenantGameQuotaFlow));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户游戏额度流水
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:flow:edit')")
|
||||
@Log(title = "租户游戏额度流水", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TenantGameQuotaFlow tenantGameQuotaFlow)
|
||||
{
|
||||
return toAjax(tenantGameQuotaFlowService.updateTenantGameQuotaFlow(tenantGameQuotaFlow));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户游戏额度流水
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:flow:remove')")
|
||||
@Log(title = "租户游戏额度流水", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(tenantGameQuotaFlowService.deleteTenantGameQuotaFlowByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
package com.ff.common.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.common.domain.TenantQuotaExchange;
|
||||
import com.ff.common.service.ITenantQuotaExchangeService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 币种汇率Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/exchange")
|
||||
public class TenantQuotaExchangeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantQuotaExchangeService tenantQuotaExchangeService;
|
||||
|
||||
/**
|
||||
* 查询币种汇率列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:exchange:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantQuotaExchange tenantQuotaExchange)
|
||||
{
|
||||
startPage();
|
||||
List<TenantQuotaExchange> list = tenantQuotaExchangeService.selectTenantQuotaExchangeList(tenantQuotaExchange);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出币种汇率列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:exchange:export')")
|
||||
@Log(title = "币种汇率", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TenantQuotaExchange tenantQuotaExchange)
|
||||
{
|
||||
List<TenantQuotaExchange> list = tenantQuotaExchangeService.selectTenantQuotaExchangeList(tenantQuotaExchange);
|
||||
ExcelUtil<TenantQuotaExchange> util = new ExcelUtil<TenantQuotaExchange>(TenantQuotaExchange.class);
|
||||
util.exportExcel(response, list, "币种汇率数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取币种汇率详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:exchange:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(tenantQuotaExchangeService.selectTenantQuotaExchangeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增币种汇率
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:exchange:add')")
|
||||
@Log(title = "币种汇率", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TenantQuotaExchange tenantQuotaExchange)
|
||||
{
|
||||
return toAjax(tenantQuotaExchangeService.insertTenantQuotaExchange(tenantQuotaExchange));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改币种汇率
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:exchange:edit')")
|
||||
@Log(title = "币种汇率", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TenantQuotaExchange tenantQuotaExchange)
|
||||
{
|
||||
return toAjax(tenantQuotaExchangeService.updateTenantQuotaExchange(tenantQuotaExchange));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除币种汇率
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:exchange:remove')")
|
||||
@Log(title = "币种汇率", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(tenantQuotaExchangeService.deleteTenantQuotaExchangeByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
package com.ff.common.dto;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 余额更改为
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class BalanceChangesDTO implements Serializable {
|
||||
private static final long serialVersionUID = -7479292236485670076L;
|
||||
|
||||
/** 充值类型 false 扣除 true 充值 */
|
||||
private Boolean isOut;
|
||||
|
||||
/**
|
||||
* 配额类型
|
||||
*/
|
||||
private String quotaType;
|
||||
|
||||
/** 租户key */
|
||||
private String tenantKey;
|
||||
|
||||
/** 游戏额度 */
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 成员id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long memberId;
|
||||
|
||||
|
||||
/** 操作类型 OperationType枚举 */
|
||||
private Integer operationType;
|
||||
|
||||
/**
|
||||
* 汇率 传值计算
|
||||
*/
|
||||
private BigDecimal actualBalance;
|
||||
|
||||
/** 平台 */
|
||||
private String platformCode;
|
||||
|
||||
/** 币种代码 */
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 源ID
|
||||
*/
|
||||
private String sourceId;
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
package com.ff.common.dto;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 余额更改为
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class BalanceRealChangesDTO implements Serializable {
|
||||
private static final long serialVersionUID = -4864053711644163092L;
|
||||
|
||||
/** 充值类型 false 扣除 true 充值 */
|
||||
private Boolean isOut;
|
||||
|
||||
|
||||
/** 租户key */
|
||||
private String tenantKey;
|
||||
|
||||
/** 游戏额度 */
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
|
||||
/** 操作类型 OperationType枚举 */
|
||||
private Integer operationType;
|
||||
|
||||
/**
|
||||
* 汇率 传值计算
|
||||
*/
|
||||
private BigDecimal actualBalance;
|
||||
|
||||
/** 币种代码 */
|
||||
private String currencyCode;
|
||||
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
package com.ff.common.dto;
|
||||
|
||||
import com.ff.game.api.request.GamesBaseRequestDTO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 游戏余额兑换
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/21
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class GameBalanceExchange extends GamesBaseRequestDTO implements Serializable {
|
||||
private final static long serialVersionUID = 3452954102791311247L;
|
||||
|
||||
|
||||
/**
|
||||
* 平台代码
|
||||
*/
|
||||
private String platformCode;
|
||||
|
||||
/**
|
||||
* 货币代码
|
||||
*/
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 交易类型 TransferType
|
||||
*/
|
||||
private Integer transferType;
|
||||
|
||||
/**
|
||||
* 游戏币数量
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private BigDecimal amountActual;
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 来源ID
|
||||
*/
|
||||
private String sourceId;
|
||||
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.common.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.Currency;
|
||||
|
||||
/**
|
||||
* 币种Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface CurrencyMapper
|
||||
{
|
||||
/**
|
||||
* 查询币种
|
||||
*
|
||||
* @param id 币种主键
|
||||
* @return 币种
|
||||
*/
|
||||
Currency selectCurrencyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询币种列表
|
||||
*
|
||||
* @param currency 币种
|
||||
* @return 币种集合
|
||||
*/
|
||||
List<Currency> selectCurrencyList(Currency currency);
|
||||
|
||||
/**
|
||||
* 新增币种
|
||||
*
|
||||
* @param currency 币种
|
||||
* @return 结果
|
||||
*/
|
||||
int insertCurrency(Currency currency);
|
||||
|
||||
/**
|
||||
* 修改币种
|
||||
*
|
||||
* @param currency 币种
|
||||
* @return 结果
|
||||
*/
|
||||
int updateCurrency(Currency currency);
|
||||
|
||||
/**
|
||||
* 删除币种
|
||||
*
|
||||
* @param id 币种主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCurrencyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除币种
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCurrencyByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.common.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.Lang;
|
||||
|
||||
/**
|
||||
* 系统语种管理 Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface LangMapper
|
||||
{
|
||||
/**
|
||||
* 查询系统语种管理
|
||||
*
|
||||
* @param id 系统语种管理 主键
|
||||
* @return 系统语种管理
|
||||
*/
|
||||
Lang selectLangById(Long id);
|
||||
|
||||
/**
|
||||
* 查询系统语种管理 列表
|
||||
*
|
||||
* @param lang 系统语种管理
|
||||
* @return 系统语种管理 集合
|
||||
*/
|
||||
List<Lang> selectLangList(Lang lang);
|
||||
|
||||
/**
|
||||
* 新增系统语种管理
|
||||
*
|
||||
* @param lang 系统语种管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertLang(Lang lang);
|
||||
|
||||
/**
|
||||
* 修改系统语种管理
|
||||
*
|
||||
* @param lang 系统语种管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateLang(Lang lang);
|
||||
|
||||
/**
|
||||
* 删除系统语种管理
|
||||
*
|
||||
* @param id 系统语种管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteLangById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除系统语种管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteLangByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.common.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
|
||||
/**
|
||||
* 平台利润成本管理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface TenantAgentPlatformMapper
|
||||
{
|
||||
/**
|
||||
* 查询平台利润成本管理
|
||||
*
|
||||
* @param id 平台利润成本管理主键
|
||||
* @return 平台利润成本管理
|
||||
*/
|
||||
TenantAgentPlatform selectTenantAgentPlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台利润成本管理列表
|
||||
*
|
||||
* @param tenantAgentPlatform 平台利润成本管理
|
||||
* @return 平台利润成本管理集合
|
||||
*/
|
||||
List<TenantAgentPlatform> selectTenantAgentPlatformList(TenantAgentPlatform tenantAgentPlatform);
|
||||
|
||||
/**
|
||||
* 新增平台利润成本管理
|
||||
*
|
||||
* @param tenantAgentPlatform 平台利润成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
|
||||
|
||||
/**
|
||||
* 修改平台利润成本管理
|
||||
*
|
||||
* @param tenantAgentPlatform 平台利润成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
|
||||
|
||||
/**
|
||||
* 删除平台利润成本管理
|
||||
*
|
||||
* @param id 平台利润成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentPlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除平台利润成本管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentPlatformByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
package com.ff.common.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 租户游戏额度流水Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
public interface TenantGameQuotaFlowMapper
|
||||
{
|
||||
/**
|
||||
* 查询租户游戏额度流水
|
||||
*
|
||||
* @param id 租户游戏额度流水主键
|
||||
* @return 租户游戏额度流水
|
||||
*/
|
||||
TenantGameQuotaFlow selectTenantGameQuotaFlowById(Long id);
|
||||
|
||||
/**
|
||||
* 查询租户游戏额度流水列表
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||
* @return 租户游戏额度流水集合
|
||||
*/
|
||||
List<TenantGameQuotaFlow> selectTenantGameQuotaFlowList(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
|
||||
/**
|
||||
* 新增租户游戏额度流水
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
|
||||
/**
|
||||
* 修改租户游戏额度流水
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
|
||||
/**
|
||||
* 删除租户游戏额度流水
|
||||
*
|
||||
* @param id 租户游戏额度流水主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaFlowById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除租户游戏额度流水
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaFlowByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 通过会员id获取余额
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
BigDecimal getExchangeMoneyByMemberId(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
|
||||
|
||||
/**
|
||||
* 通过租户密钥获取余额
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||
* @return {@link List }<{@link TenantGameQuotaFlow }>
|
||||
*/
|
||||
List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
package com.ff.common.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.common.domain.TenantGameQuota;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 租户游戏配额Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
public interface TenantGameQuotaMapper {
|
||||
/**
|
||||
* 查询租户游戏配额
|
||||
*
|
||||
* @param id 租户游戏配额主键
|
||||
* @return 租户游戏配额
|
||||
*/
|
||||
TenantGameQuota selectTenantGameQuotaById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额
|
||||
*
|
||||
* @param tenantKey 租户游戏配额主键
|
||||
* @return 租户游戏配额
|
||||
*/
|
||||
TenantGameQuota selectTenantGameQuotaByTenantKey(@Param("tenantKey") String tenantKey,@Param("quotaType") String quotaType);
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额列表
|
||||
*
|
||||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 租户游戏配额集合
|
||||
*/
|
||||
List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota);
|
||||
|
||||
/**
|
||||
* 新增租户游戏配额
|
||||
*
|
||||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||
|
||||
/**
|
||||
* 修改租户游戏配额
|
||||
*
|
||||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||
|
||||
|
||||
/**
|
||||
* 改变余额
|
||||
*
|
||||
* @param tenantGameQuota sys游戏配额
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean changeBalance(TenantGameQuota tenantGameQuota);
|
||||
|
||||
/**
|
||||
* 删除租户游戏配额
|
||||
*
|
||||
* @param id 租户游戏配额主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除租户游戏配额
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
package com.ff.common.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.TenantQuotaExchange;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 币种汇率Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
public interface TenantQuotaExchangeMapper
|
||||
{
|
||||
/**
|
||||
* 查询币种汇率
|
||||
*
|
||||
* @param id 币种汇率主键
|
||||
* @return 币种汇率
|
||||
*/
|
||||
TenantQuotaExchange selectTenantQuotaExchangeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询币种汇率列表
|
||||
*
|
||||
* @param tenantQuotaExchange 币种汇率
|
||||
* @return 币种汇率集合
|
||||
*/
|
||||
List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange);
|
||||
|
||||
/**
|
||||
* 新增币种汇率
|
||||
*
|
||||
* @param tenantQuotaExchange 币种汇率
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
|
||||
|
||||
/**
|
||||
* 修改币种汇率
|
||||
*
|
||||
* @param tenantQuotaExchange 币种汇率
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
|
||||
|
||||
/**
|
||||
* 删除币种汇率
|
||||
*
|
||||
* @param id 币种汇率主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantQuotaExchangeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除币种汇率
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantQuotaExchangeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取租户配额交换
|
||||
*
|
||||
* @param currencyCode 货币代码
|
||||
* @param exchangeCurrencyCode 兑换货币代码
|
||||
* @return {@link TenantQuotaExchange }
|
||||
*/
|
||||
TenantQuotaExchange getTenantQuotaExchange(@Param("currencyCode") String currencyCode, @Param("exchangeCurrencyCode") String exchangeCurrencyCode);
|
||||
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.common.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.Currency;
|
||||
|
||||
/**
|
||||
* 币种Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface ICurrencyService
|
||||
{
|
||||
/**
|
||||
* 查询币种
|
||||
*
|
||||
* @param id 币种主键
|
||||
* @return 币种
|
||||
*/
|
||||
Currency selectCurrencyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询币种列表
|
||||
*
|
||||
* @param currency 币种
|
||||
* @return 币种集合
|
||||
*/
|
||||
List<Currency> selectCurrencyList(Currency currency);
|
||||
|
||||
/**
|
||||
* 新增币种
|
||||
*
|
||||
* @param currency 币种
|
||||
* @return 结果
|
||||
*/
|
||||
int insertCurrency(Currency currency);
|
||||
|
||||
/**
|
||||
* 修改币种
|
||||
*
|
||||
* @param currency 币种
|
||||
* @return 结果
|
||||
*/
|
||||
int updateCurrency(Currency currency);
|
||||
|
||||
/**
|
||||
* 批量删除币种
|
||||
*
|
||||
* @param ids 需要删除的币种主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCurrencyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除币种信息
|
||||
*
|
||||
* @param id 币种主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteCurrencyById(Long id);
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.common.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.Lang;
|
||||
|
||||
/**
|
||||
* 系统语种管理 Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface ILangService
|
||||
{
|
||||
/**
|
||||
* 查询系统语种管理
|
||||
*
|
||||
* @param id 系统语种管理 主键
|
||||
* @return 系统语种管理
|
||||
*/
|
||||
Lang selectLangById(Long id);
|
||||
|
||||
/**
|
||||
* 查询系统语种管理 列表
|
||||
*
|
||||
* @param lang 系统语种管理
|
||||
* @return 系统语种管理 集合
|
||||
*/
|
||||
List<Lang> selectLangList(Lang lang);
|
||||
|
||||
/**
|
||||
* 新增系统语种管理
|
||||
*
|
||||
* @param lang 系统语种管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertLang(Lang lang);
|
||||
|
||||
/**
|
||||
* 修改系统语种管理
|
||||
*
|
||||
* @param lang 系统语种管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateLang(Lang lang);
|
||||
|
||||
/**
|
||||
* 批量删除系统语种管理
|
||||
*
|
||||
* @param ids 需要删除的系统语种管理 主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteLangByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除系统语种管理 信息
|
||||
*
|
||||
* @param id 系统语种管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteLangById(Long id);
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ff.common.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
|
||||
/**
|
||||
* 平台利润成本管理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface ITenantAgentPlatformService
|
||||
{
|
||||
/**
|
||||
* 查询平台利润成本管理
|
||||
*
|
||||
* @param id 平台利润成本管理主键
|
||||
* @return 平台利润成本管理
|
||||
*/
|
||||
TenantAgentPlatform selectTenantAgentPlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台利润成本管理列表
|
||||
*
|
||||
* @param tenantAgentPlatform 平台利润成本管理
|
||||
* @return 平台利润成本管理集合
|
||||
*/
|
||||
List<TenantAgentPlatform> selectTenantAgentPlatformList(TenantAgentPlatform tenantAgentPlatform);
|
||||
|
||||
/**
|
||||
* 新增平台利润成本管理
|
||||
*
|
||||
* @param tenantAgentPlatform 平台利润成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
|
||||
|
||||
/**
|
||||
* 修改平台利润成本管理
|
||||
*
|
||||
* @param tenantAgentPlatform 平台利润成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
|
||||
|
||||
/**
|
||||
* 批量删除平台利润成本管理
|
||||
*
|
||||
* @param ids 需要删除的平台利润成本管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentPlatformByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除平台利润成本管理信息
|
||||
*
|
||||
* @param id 平台利润成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentPlatformById(Long id);
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
package com.ff.common.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||
|
||||
/**
|
||||
* 租户游戏额度流水Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
public interface ITenantGameQuotaFlowService
|
||||
{
|
||||
/**
|
||||
* 查询租户游戏额度流水
|
||||
*
|
||||
* @param id 租户游戏额度流水主键
|
||||
* @return 租户游戏额度流水
|
||||
*/
|
||||
TenantGameQuotaFlow selectTenantGameQuotaFlowById(Long id);
|
||||
|
||||
/**
|
||||
* 查询租户游戏额度流水列表
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||
* @return 租户游戏额度流水集合
|
||||
*/
|
||||
List<TenantGameQuotaFlow> selectTenantGameQuotaFlowList(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
|
||||
/**
|
||||
* 新增租户游戏额度流水
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
|
||||
/**
|
||||
* 修改租户游戏额度流水
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
|
||||
/**
|
||||
* 批量删除租户游戏额度流水
|
||||
*
|
||||
* @param ids 需要删除的租户游戏额度流水主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaFlowByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除租户游戏额度流水信息
|
||||
*
|
||||
* @param id 租户游戏额度流水主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaFlowById(Long id);
|
||||
|
||||
/**
|
||||
* 通过会员id获取余额
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
BigDecimal getExchangeMoneyByMemberId(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
|
||||
|
||||
/**
|
||||
* 通过租户密钥获取余额
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||
* @return {@link List }<{@link TenantGameQuotaFlow }>
|
||||
*/
|
||||
List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
package com.ff.common.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.agent.dto.AgentCreateTenantDTO;
|
||||
import com.ff.common.domain.TenantGameQuota;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import com.ff.common.dto.BalanceRealChangesDTO;
|
||||
import com.ff.common.dto.GameBalanceExchange;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 租户游戏配额Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
public interface ITenantGameQuotaService
|
||||
{
|
||||
/**
|
||||
* 查询租户游戏配额
|
||||
*
|
||||
* @param id 租户游戏配额主键
|
||||
* @return 租户游戏配额
|
||||
*/
|
||||
TenantGameQuota selectTenantGameQuotaById(Long id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额列表
|
||||
*
|
||||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 租户游戏配额集合
|
||||
*/
|
||||
List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota);
|
||||
|
||||
/**
|
||||
* 新增租户游戏配额
|
||||
*
|
||||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||
|
||||
/**
|
||||
* 修改租户游戏配额
|
||||
*
|
||||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||
|
||||
/**
|
||||
* 批量删除租户游戏配额
|
||||
*
|
||||
* @param ids 需要删除的租户游戏配额主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除租户游戏配额信息
|
||||
*
|
||||
* @param id 租户游戏配额主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantGameQuotaById(Long id);
|
||||
|
||||
/**
|
||||
* 余额变化
|
||||
*
|
||||
* @param balanceChangesDTO 余额更改为
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean balanceChanges(BalanceChangesDTO balanceChangesDTO);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 真实余额变化
|
||||
*
|
||||
* @param balanceRealChangesDTO 余额更改为
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean balanceRealChanges(BalanceRealChangesDTO balanceRealChangesDTO);
|
||||
|
||||
/**
|
||||
* 游戏余额兑换
|
||||
*
|
||||
* @param gameBalanceExchange 游戏余额兑换
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
BigDecimal gameBalanceExchange(GameBalanceExchange gameBalanceExchange);
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额
|
||||
*
|
||||
* @param tenantKey 租户游戏配额主键
|
||||
* @return 租户游戏配额
|
||||
*/
|
||||
TenantGameQuota selectTenantGameQuotaByTenantKey(String tenantKey, String quotaType);
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
package com.ff.common.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.TenantQuotaExchange;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* 币种汇率Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
public interface ITenantQuotaExchangeService
|
||||
{
|
||||
/**
|
||||
* 查询币种汇率
|
||||
*
|
||||
* @param id 币种汇率主键
|
||||
* @return 币种汇率
|
||||
*/
|
||||
TenantQuotaExchange selectTenantQuotaExchangeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询币种汇率列表
|
||||
*
|
||||
* @param tenantQuotaExchange 币种汇率
|
||||
* @return 币种汇率集合
|
||||
*/
|
||||
List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange);
|
||||
|
||||
|
||||
/**
|
||||
* 获取租户配额交换
|
||||
*
|
||||
* @param currencyCode 货币代码
|
||||
* @param exchangeCurrencyCode 兑换货币代码
|
||||
* @return {@link TenantQuotaExchange }
|
||||
*/
|
||||
TenantQuotaExchange getTenantQuotaExchange(String currencyCode,String exchangeCurrencyCode);
|
||||
|
||||
/**
|
||||
* 新增币种汇率
|
||||
*
|
||||
* @param tenantQuotaExchange 币种汇率
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
|
||||
|
||||
/**
|
||||
* 修改币种汇率
|
||||
*
|
||||
* @param tenantQuotaExchange 币种汇率
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
|
||||
|
||||
/**
|
||||
* 批量删除币种汇率
|
||||
*
|
||||
* @param ids 需要删除的币种汇率主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantQuotaExchangeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除币种汇率信息
|
||||
*
|
||||
* @param id 币种汇率主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantQuotaExchangeById(Long id);
|
||||
}
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
package com.ff.common.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.common.mapper.CurrencyMapper;
|
||||
import com.ff.common.domain.Currency;
|
||||
import com.ff.common.service.ICurrencyService;
|
||||
|
||||
/**
|
||||
* 币种Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Service
|
||||
public class CurrencyServiceImpl implements ICurrencyService
|
||||
{
|
||||
@Autowired
|
||||
private CurrencyMapper currencyMapper;
|
||||
|
||||
/**
|
||||
* 查询币种
|
||||
*
|
||||
* @param id 币种主键
|
||||
* @return 币种
|
||||
*/
|
||||
@Override
|
||||
public Currency selectCurrencyById(Long id)
|
||||
{
|
||||
return currencyMapper.selectCurrencyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询币种列表
|
||||
*
|
||||
* @param currency 币种
|
||||
* @return 币种
|
||||
*/
|
||||
@Override
|
||||
public List<Currency> selectCurrencyList(Currency currency)
|
||||
{
|
||||
return currencyMapper.selectCurrencyList(currency);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增币种
|
||||
*
|
||||
* @param currency 币种
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCurrency(Currency currency)
|
||||
{
|
||||
currency.setId(IdUtil.getSnowflakeNextId());
|
||||
currency.setCreateTime(DateUtils.getNowDate());
|
||||
return currencyMapper.insertCurrency(currency);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改币种
|
||||
*
|
||||
* @param currency 币种
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCurrency(Currency currency)
|
||||
{
|
||||
currency.setUpdateTime(DateUtils.getNowDate());
|
||||
return currencyMapper.updateCurrency(currency);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除币种
|
||||
*
|
||||
* @param ids 需要删除的币种主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCurrencyByIds(Long[] ids)
|
||||
{
|
||||
return currencyMapper.deleteCurrencyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除币种信息
|
||||
*
|
||||
* @param id 币种主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCurrencyById(Long id)
|
||||
{
|
||||
return currencyMapper.deleteCurrencyById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
package com.ff.common.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.common.mapper.LangMapper;
|
||||
import com.ff.common.domain.Lang;
|
||||
import com.ff.common.service.ILangService;
|
||||
|
||||
/**
|
||||
* 系统语种管理 Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Service
|
||||
public class LangServiceImpl implements ILangService
|
||||
{
|
||||
@Autowired
|
||||
private LangMapper langMapper;
|
||||
|
||||
/**
|
||||
* 查询系统语种管理
|
||||
*
|
||||
* @param id 系统语种管理 主键
|
||||
* @return 系统语种管理
|
||||
*/
|
||||
@Override
|
||||
public Lang selectLangById(Long id)
|
||||
{
|
||||
return langMapper.selectLangById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统语种管理 列表
|
||||
*
|
||||
* @param lang 系统语种管理
|
||||
* @return 系统语种管理
|
||||
*/
|
||||
@Override
|
||||
public List<Lang> selectLangList(Lang lang)
|
||||
{
|
||||
return langMapper.selectLangList(lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统语种管理
|
||||
*
|
||||
* @param lang 系统语种管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertLang(Lang lang)
|
||||
{
|
||||
lang.setId(IdUtil.getSnowflakeNextId());
|
||||
lang.setCreateTime(DateUtils.getNowDate());
|
||||
return langMapper.insertLang(lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统语种管理
|
||||
*
|
||||
* @param lang 系统语种管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateLang(Lang lang)
|
||||
{
|
||||
lang.setUpdateTime(DateUtils.getNowDate());
|
||||
return langMapper.updateLang(lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除系统语种管理
|
||||
*
|
||||
* @param ids 需要删除的系统语种管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteLangByIds(Long[] ids)
|
||||
{
|
||||
return langMapper.deleteLangByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统语种管理 信息
|
||||
*
|
||||
* @param id 系统语种管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteLangById(Long id)
|
||||
{
|
||||
return langMapper.deleteLangById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
package com.ff.common.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.common.mapper.TenantAgentPlatformMapper;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import com.ff.common.service.ITenantAgentPlatformService;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 平台利润成本管理Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentPlatformServiceImpl implements ITenantAgentPlatformService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentPlatformMapper tenantAgentPlatformMapper;
|
||||
|
||||
/**
|
||||
* 查询平台利润成本管理
|
||||
*
|
||||
* @param id 平台利润成本管理主键
|
||||
* @return 平台利润成本管理
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentPlatform selectTenantAgentPlatformById(Long id)
|
||||
{
|
||||
return tenantAgentPlatformMapper.selectTenantAgentPlatformById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询平台利润成本管理列表
|
||||
*
|
||||
* @param tenantAgentPlatform 平台利润成本管理
|
||||
* @return 平台利润成本管理
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentPlatform> selectTenantAgentPlatformList(TenantAgentPlatform tenantAgentPlatform)
|
||||
{
|
||||
return tenantAgentPlatformMapper.selectTenantAgentPlatformList(tenantAgentPlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增平台利润成本管理
|
||||
*
|
||||
* @param tenantAgentPlatform 平台利润成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform)
|
||||
{
|
||||
tenantAgentPlatform.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantAgentPlatform.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentPlatformMapper.insertTenantAgentPlatform(tenantAgentPlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改平台利润成本管理
|
||||
*
|
||||
* @param tenantAgentPlatform 平台利润成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform)
|
||||
{
|
||||
tenantAgentPlatform.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentPlatformMapper.updateTenantAgentPlatform(tenantAgentPlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除平台利润成本管理
|
||||
*
|
||||
* @param ids 需要删除的平台利润成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentPlatformByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentPlatformMapper.deleteTenantAgentPlatformByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除平台利润成本管理信息
|
||||
*
|
||||
* @param id 平台利润成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentPlatformById(Long id)
|
||||
{
|
||||
return tenantAgentPlatformMapper.deleteTenantAgentPlatformById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
package com.ff.common.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.common.mapper.TenantGameQuotaFlowMapper;
|
||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||
|
||||
/**
|
||||
* 租户游戏额度流水Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@Service
|
||||
public class TenantGameQuotaFlowServiceImpl implements ITenantGameQuotaFlowService {
|
||||
@Autowired
|
||||
private TenantGameQuotaFlowMapper tenantGameQuotaFlowMapper;
|
||||
|
||||
/**
|
||||
* 查询租户游戏额度流水
|
||||
*
|
||||
* @param id 租户游戏额度流水主键
|
||||
* @return 租户游戏额度流水
|
||||
*/
|
||||
@Override
|
||||
public TenantGameQuotaFlow selectTenantGameQuotaFlowById(Long id) {
|
||||
return tenantGameQuotaFlowMapper.selectTenantGameQuotaFlowById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户游戏额度流水列表
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||
* @return 租户游戏额度流水
|
||||
*/
|
||||
@Override
|
||||
public List<TenantGameQuotaFlow> selectTenantGameQuotaFlowList(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||
return tenantGameQuotaFlowMapper.selectTenantGameQuotaFlowList(tenantGameQuotaFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户游戏额度流水
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||
tenantGameQuotaFlow.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantGameQuotaFlow.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantGameQuotaFlowMapper.insertTenantGameQuotaFlow(tenantGameQuotaFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户游戏额度流水
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||
tenantGameQuotaFlow.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantGameQuotaFlowMapper.updateTenantGameQuotaFlow(tenantGameQuotaFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租户游戏额度流水
|
||||
*
|
||||
* @param ids 需要删除的租户游戏额度流水主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantGameQuotaFlowByIds(Long[] ids) {
|
||||
return tenantGameQuotaFlowMapper.deleteTenantGameQuotaFlowByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户游戏额度流水信息
|
||||
*
|
||||
* @param id 租户游戏额度流水主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantGameQuotaFlowById(Long id) {
|
||||
return tenantGameQuotaFlowMapper.deleteTenantGameQuotaFlowById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过会员id获取余额
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
@Override
|
||||
public BigDecimal getExchangeMoneyByMemberId(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||
return tenantGameQuotaFlowMapper.getExchangeMoneyByMemberId(tenantGameQuotaFlow);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过租户密钥获取余额
|
||||
*
|
||||
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||
* @return {@link List }<{@link TenantGameQuotaFlow }>
|
||||
*/
|
||||
@Override
|
||||
public List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||
return tenantGameQuotaFlowMapper.getBalanceByTenantKey(tenantGameQuotaFlow);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,473 +0,0 @@
|
|||
package com.ff.common.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.enums.*;
|
||||
import com.ff.base.exception.base.ApiException;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.service.ITenantPlatformService;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.QuotaUtils;
|
||||
import com.ff.common.domain.TenantGameQuota;
|
||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||
import com.ff.common.domain.TenantQuotaExchange;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import com.ff.common.dto.BalanceRealChangesDTO;
|
||||
import com.ff.common.dto.GameBalanceExchange;
|
||||
import com.ff.common.mapper.TenantGameQuotaMapper;
|
||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import com.ff.common.service.ITenantQuotaExchangeService;
|
||||
import com.ff.game.api.IGamesService;
|
||||
import com.ff.game.api.request.MemberInfoRequestDTO;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 租户游戏配额Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-12
|
||||
*/
|
||||
@Service
|
||||
public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService {
|
||||
@Autowired
|
||||
private TenantGameQuotaMapper tenantGameQuotaMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private ITenantGameQuotaFlowService tenantGameQuotaFlowService;
|
||||
|
||||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private IMemberService memberService;
|
||||
|
||||
@Autowired
|
||||
private Map<String, IGamesService> gamesService;
|
||||
|
||||
@Resource
|
||||
private ITenantQuotaExchangeService tenantQuotaExchangeService;
|
||||
|
||||
@Resource
|
||||
private ITenantPlatformService tenantPlatformService;
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额
|
||||
*
|
||||
* @param id 租户游戏配额主键
|
||||
* @return 租户游戏配额
|
||||
*/
|
||||
@Override
|
||||
public TenantGameQuota selectTenantGameQuotaById(Long id) {
|
||||
return tenantGameQuotaMapper.selectTenantGameQuotaById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询租户游戏配额列表
|
||||
*
|
||||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 租户游戏配额
|
||||
*/
|
||||
@Override
|
||||
public List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota) {
|
||||
return tenantGameQuotaMapper.selectTenantGameQuotaList(tenantGameQuota);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户游戏配额
|
||||
*
|
||||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantGameQuota(TenantGameQuota tenantGameQuota) {
|
||||
tenantGameQuota.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantGameQuota.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantGameQuotaMapper.insertTenantGameQuota(tenantGameQuota);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户游戏配额
|
||||
*
|
||||
* @param tenantGameQuota 租户游戏配额
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantGameQuota(TenantGameQuota tenantGameQuota) {
|
||||
tenantGameQuota.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantGameQuotaMapper.updateTenantGameQuota(tenantGameQuota);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租户游戏配额
|
||||
*
|
||||
* @param ids 需要删除的租户游戏配额主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantGameQuotaByIds(Long[] ids) {
|
||||
return tenantGameQuotaMapper.deleteTenantGameQuotaByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户游戏配额信息
|
||||
*
|
||||
* @param id 租户游戏配额主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantGameQuotaById(Long id) {
|
||||
return tenantGameQuotaMapper.deleteTenantGameQuotaById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 平衡变化
|
||||
*
|
||||
* @param balanceChangesDTO 余额更改为
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean balanceChanges(BalanceChangesDTO balanceChangesDTO) {
|
||||
|
||||
TenantGameQuota tenantGameQuota = this.selectTenantGameQuotaByTenantKey(balanceChangesDTO.getTenantKey(), balanceChangesDTO.getQuotaType());
|
||||
BigDecimal balanceBefore = tenantGameQuota.getBalance();
|
||||
BigDecimal balance = balanceChangesDTO.getBalance();
|
||||
//如果有汇率 则需要计算真实扣除额度
|
||||
if (!ObjectUtils.isEmpty(balanceChangesDTO.getActualBalance())) {
|
||||
balance = NumberUtil.div(balance, balanceChangesDTO.getActualBalance(), 2, RoundingMode.FLOOR);
|
||||
}
|
||||
|
||||
if (BigDecimal.ZERO.compareTo(balance) >= 0) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
BigDecimal balanceAfter;
|
||||
//判断是充值还是扣除
|
||||
if (balanceChangesDTO.getIsOut()) {
|
||||
balanceAfter = NumberUtil.add(balanceBefore, balance);
|
||||
} else {
|
||||
balanceAfter = NumberUtil.sub(balanceBefore, balance);
|
||||
}
|
||||
//判断剩余额度是否大于0
|
||||
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(balanceChangesDTO.getTenantKey());
|
||||
if (TenantType.DEPOSIT.getCode().equals(tenantSecretKey.getTenantType()) && balanceAfter.compareTo(BigDecimal.ZERO) < 0) {
|
||||
TenantGameQuota depositQuota = this.selectTenantGameQuotaByTenantKey(balanceChangesDTO.getTenantKey(), QuotaUtils.getReputationQuota(balanceChangesDTO.getQuotaType()));
|
||||
//判断剩余额度是否大于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(balanceChangesDTO.getQuotaType())
|
||||
.version(tenantGameQuota.getVersion())
|
||||
.build());
|
||||
Assert.isTrue(changedBalanceResult, "租户游戏额度操作失败");
|
||||
|
||||
//插入流水
|
||||
TenantGameQuotaFlow tenantGameQuotaFlow = TenantGameQuotaFlow.builder()
|
||||
.quotaType(balanceChangesDTO.getQuotaType())
|
||||
.tenantKey(balanceChangesDTO.getTenantKey())
|
||||
.sourceId(balanceChangesDTO.getSourceId())
|
||||
.isOut(balanceChangesDTO.getIsOut())
|
||||
.platformCode(balanceChangesDTO.getPlatformCode())
|
||||
.currencyCode(balanceChangesDTO.getCurrencyCode())
|
||||
.balanceAfter(balanceAfter)
|
||||
.exchangeRatio(balanceChangesDTO.getActualBalance())
|
||||
.exchangeMoney(balanceChangesDTO.getBalance())
|
||||
.memberId(balanceChangesDTO.getMemberId())
|
||||
.balance(balance)
|
||||
.balanceBefore(balanceBefore)
|
||||
.operationType(balanceChangesDTO.getOperationType())
|
||||
.build();
|
||||
tenantGameQuotaFlow.setRemark(balanceChangesDTO.getRemark());
|
||||
tenantGameQuotaFlow.setCreateTime(DateUtils.getNowDate());
|
||||
tenantGameQuotaFlow.setCreateBy(Constants.SYSTEM);
|
||||
tenantGameQuotaFlowService.insertTenantGameQuotaFlow(tenantGameQuotaFlow);
|
||||
return changedBalanceResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 真实余额变化
|
||||
*
|
||||
* @param balanceRealChangesDTO 余额更改为
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean balanceRealChanges(BalanceRealChangesDTO balanceRealChangesDTO) {
|
||||
TenantGameQuota tenantGameQuota = this.selectTenantGameQuotaByTenantKey(balanceRealChangesDTO.getTenantKey(), QuotaType.REAL_BALANCE.getCode());
|
||||
BigDecimal balanceBefore = tenantGameQuota.getBalance();
|
||||
BigDecimal balance = balanceRealChangesDTO.getBalance();
|
||||
//如果有汇率 则需要计算真实扣除额度
|
||||
if (!ObjectUtils.isEmpty(balanceRealChangesDTO.getActualBalance())) {
|
||||
balance = NumberUtil.div(balance, balanceRealChangesDTO.getActualBalance(), 2, RoundingMode.FLOOR);
|
||||
}
|
||||
|
||||
if (BigDecimal.ZERO.compareTo(balance) >= 0) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
BigDecimal balanceAfter;
|
||||
//判断是充值还是扣除
|
||||
if (balanceRealChangesDTO.getIsOut()) {
|
||||
balanceAfter = NumberUtil.add(balanceBefore, balance);
|
||||
} else {
|
||||
balanceAfter = NumberUtil.sub(balanceBefore, balance);
|
||||
}
|
||||
//修改余额
|
||||
Boolean changedBalanceResult = tenantGameQuotaMapper.changeBalance(TenantGameQuota.builder()
|
||||
.tenantKey(balanceRealChangesDTO.getTenantKey())
|
||||
.balance(balanceAfter)
|
||||
.quotaType(QuotaType.REAL_BALANCE.getCode())
|
||||
.version(tenantGameQuota.getVersion())
|
||||
.build());
|
||||
|
||||
//插入流水
|
||||
TenantGameQuotaFlow tenantGameQuotaFlow = TenantGameQuotaFlow.builder()
|
||||
.quotaType(QuotaType.REAL_BALANCE.getCode())
|
||||
.tenantKey(balanceRealChangesDTO.getTenantKey())
|
||||
.isOut(balanceRealChangesDTO.getIsOut())
|
||||
.currencyCode(balanceRealChangesDTO.getCurrencyCode())
|
||||
.balanceAfter(balanceAfter)
|
||||
.exchangeRatio(balanceRealChangesDTO.getActualBalance())
|
||||
.exchangeMoney(balanceRealChangesDTO.getBalance())
|
||||
.balance(balance)
|
||||
.balanceBefore(balanceBefore)
|
||||
.operationType(balanceRealChangesDTO.getOperationType())
|
||||
.build();
|
||||
tenantGameQuotaFlow.setRemark(balanceRealChangesDTO.getRemark());
|
||||
tenantGameQuotaFlow.setCreateTime(DateUtils.getNowDate());
|
||||
tenantGameQuotaFlow.setCreateBy(Constants.SYSTEM);
|
||||
tenantGameQuotaFlowService.insertTenantGameQuotaFlow(tenantGameQuotaFlow);
|
||||
return changedBalanceResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏余额兑换
|
||||
*
|
||||
* @param gameBalanceExchange 游戏余额兑换
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
@Override
|
||||
public BigDecimal gameBalanceExchange(GameBalanceExchange gameBalanceExchange) {
|
||||
|
||||
TenantQuotaExchange tenantQuotaExchange = tenantQuotaExchangeService.getTenantQuotaExchange(Constants.USDT, gameBalanceExchange.getCurrencyCode());
|
||||
ApiException.notNull(tenantQuotaExchange, ErrorCode.CURRENCY_EXCHANGE.getCode());
|
||||
|
||||
// 获取租户信息
|
||||
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(gameBalanceExchange.getTenantKey());
|
||||
|
||||
|
||||
// 获取平台币种格外成本
|
||||
TenantPlatform tenantPlatform = tenantPlatformService.findTenantPlatform(TenantPlatform.builder()
|
||||
.tenantId(tenantSecretKey.getId())
|
||||
.currencyCode(gameBalanceExchange.getCurrencyCode())
|
||||
.platformCode(gameBalanceExchange.getPlatformCode())
|
||||
.build());
|
||||
// 检查获取平台币种格外成本是否存在,否则抛出异常
|
||||
ApiException.notNull(tenantPlatform, ErrorCode.PLATFORM_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
// 获取用户信息
|
||||
Member member = memberService.selectMemberByAccount(gameBalanceExchange.getAccount(), gameBalanceExchange.getCurrencyCode(), gameBalanceExchange.getPlatformCode());
|
||||
ApiException.notNull(member, ErrorCode.ACCOUNT_NOT_EXIST.getCode());
|
||||
|
||||
|
||||
// 检查用户是否存在,否则抛出异常
|
||||
ApiException.notNull(member, ErrorCode.ACCOUNT_NOT_EXIST.getCode());
|
||||
|
||||
// 根据平台代码获取平台接口
|
||||
IGamesService iGamesService = gamesService.get(gameBalanceExchange.getPlatformCode() + Constants.SERVICE);
|
||||
|
||||
// 初始化额度类型为余额
|
||||
String quotaType = QuotaType.BALANCE.getCode();
|
||||
// 根据租户额度类型调整额度类型
|
||||
if (TenantQuotaType.SINGLE.getCode().equals(tenantSecretKey.getQuotaType())) {
|
||||
quotaType = QuotaUtils.getPlatformQuota(gameBalanceExchange.getPlatformCode(), gameBalanceExchange.getCurrencyCode());
|
||||
}
|
||||
|
||||
// 判断操作类型(出账/入账)
|
||||
boolean isOut = gameBalanceExchange.getTransferType().equals(TransferType.ALL.getCode());
|
||||
// 初始化操作金额
|
||||
BigDecimal balanceRequestAmount = gameBalanceExchange.getAmount();
|
||||
|
||||
// 如果是出账操作
|
||||
if (isOut) {
|
||||
// 获取第三方钱包余额
|
||||
MemberInfoRequestDTO gamesBaseRequestDTO = MemberInfoRequestDTO.builder()
|
||||
.accounts(member.getGameAccount())
|
||||
.agentId(gameBalanceExchange.getAgentId())
|
||||
.currency(gameBalanceExchange.getCurrency())
|
||||
.agentKey(gameBalanceExchange.getAgentKey())
|
||||
.build();
|
||||
balanceRequestAmount = iGamesService.getMemberInfo(gamesBaseRequestDTO).getBalance();
|
||||
|
||||
if (balanceRequestAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new ApiException(ErrorCode.INSUFFICIENT_PLAYER_BALANCE.getCode());
|
||||
}
|
||||
|
||||
balanceRequestAmount = NumberUtil.add(balanceRequestAmount, NumberUtil.mul(balanceRequestAmount, NumberUtil.div(tenantPlatform.getUseCost(), Constants.HUNDRED)));
|
||||
|
||||
// 计算累计转入和转出金额
|
||||
BigDecimal balanceInto = tenantGameQuotaFlowService.getExchangeMoneyByMemberId(TenantGameQuotaFlow.builder()
|
||||
.isOut(Boolean.TRUE)
|
||||
.quotaType(quotaType)
|
||||
.tenantKey(gameBalanceExchange.getTenantKey())
|
||||
.memberId(member.getId())
|
||||
.build());
|
||||
BigDecimal balanceOut = NumberUtil.add(tenantGameQuotaFlowService.getExchangeMoneyByMemberId(TenantGameQuotaFlow.builder()
|
||||
.isOut(Boolean.FALSE)
|
||||
.quotaType(quotaType)
|
||||
.tenantKey(gameBalanceExchange.getTenantKey())
|
||||
.memberId(member.getId())
|
||||
.build()), BigDecimal.ZERO);
|
||||
|
||||
// 初始化平台额度
|
||||
BigDecimal platformBalance = BigDecimal.ZERO;
|
||||
// 确保转入金额不超过转出额度
|
||||
if (NumberUtil.add(balanceInto, balanceRequestAmount).compareTo(balanceOut) > 0) {
|
||||
BigDecimal difference = NumberUtil.sub(balanceOut, balanceInto);
|
||||
platformBalance = NumberUtil.sub(balanceRequestAmount, difference);
|
||||
balanceRequestAmount = difference;
|
||||
}
|
||||
|
||||
// 如果有平台额度变化,进行余额调整
|
||||
if (platformBalance.compareTo(BigDecimal.ZERO) > 0) {
|
||||
this.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.TRUE)
|
||||
.platformCode(gameBalanceExchange.getPlatformCode())
|
||||
.currencyCode(gameBalanceExchange.getCurrencyCode())
|
||||
.tenantKey(gameBalanceExchange.getTenantKey())
|
||||
.balance(platformBalance)
|
||||
.sourceId(gameBalanceExchange.getSourceId())
|
||||
.memberId(member.getId())
|
||||
.operationType(OperationType.API_BALANCE.getCode())
|
||||
.remark(OperationType.API_BALANCE.getDescription())
|
||||
.quotaType(QuotaUtils.getFalseTenantQuota(gameBalanceExchange.getPlatformCode(), gameBalanceExchange.getCurrencyCode()))
|
||||
.build());
|
||||
}
|
||||
|
||||
// 进行租户余额调整
|
||||
this.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.TRUE)
|
||||
.sourceId(gameBalanceExchange.getSourceId())
|
||||
.platformCode(gameBalanceExchange.getPlatformCode())
|
||||
.currencyCode(gameBalanceExchange.getCurrencyCode())
|
||||
.actualBalance(tenantQuotaExchange.getActualBalance())
|
||||
.tenantKey(gameBalanceExchange.getTenantKey())
|
||||
.balance(balanceRequestAmount)
|
||||
.memberId(member.getId())
|
||||
.operationType(OperationType.API_BALANCE.getCode())
|
||||
.quotaType(quotaType)
|
||||
.remark(OperationType.API_BALANCE.getDescription())
|
||||
.build());
|
||||
|
||||
} else {
|
||||
|
||||
// 如果是扣账操作,首先处理假额度
|
||||
String falseTenantQuotaType = QuotaUtils.getFalseTenantQuota(gameBalanceExchange.getPlatformCode(), gameBalanceExchange.getCurrencyCode());
|
||||
TenantGameQuota falseTenantQuota = selectTenantGameQuotaByTenantKey(tenantSecretKey.getTenantKey(), falseTenantQuotaType);
|
||||
balanceRequestAmount = NumberUtil.add(gameBalanceExchange.getAmount(), NumberUtil.mul(gameBalanceExchange.getAmount(), NumberUtil.div(tenantPlatform.getUseCost(), Constants.HUNDRED)));
|
||||
if (falseTenantQuota.getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
||||
|
||||
|
||||
BigDecimal falseQuotaBalance = falseTenantQuota.getBalance();
|
||||
if (falseQuotaBalance.compareTo(balanceRequestAmount) >= 0) {
|
||||
// 假额度足够扣除本次所需金额
|
||||
this.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.FALSE)
|
||||
.sourceId(gameBalanceExchange.getSourceId())
|
||||
.platformCode(gameBalanceExchange.getPlatformCode())
|
||||
.currencyCode(gameBalanceExchange.getCurrencyCode())
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.balance(balanceRequestAmount)
|
||||
.memberId(member.getId())
|
||||
.operationType(OperationType.API_BALANCE.getCode())
|
||||
.quotaType(falseTenantQuotaType)
|
||||
.remark(OperationType.API_BALANCE.getDescription())
|
||||
.build());
|
||||
balanceRequestAmount = BigDecimal.ZERO;
|
||||
} else {
|
||||
// 假额度不足以扣除本次所需金额,扣除全部假额度
|
||||
balanceRequestAmount = balanceRequestAmount.subtract(falseQuotaBalance);
|
||||
this.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.FALSE)
|
||||
.sourceId(gameBalanceExchange.getSourceId())
|
||||
.platformCode(gameBalanceExchange.getPlatformCode())
|
||||
.currencyCode(gameBalanceExchange.getCurrencyCode())
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.balance(falseQuotaBalance)
|
||||
.memberId(member.getId())
|
||||
.operationType(OperationType.API_BALANCE.getCode())
|
||||
.quotaType(falseTenantQuotaType)
|
||||
.remark(OperationType.API_BALANCE.getDescription())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
// 处理剩余的入账金额
|
||||
if (balanceRequestAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
this.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.FALSE)
|
||||
.sourceId(gameBalanceExchange.getSourceId())
|
||||
.platformCode(gameBalanceExchange.getPlatformCode())
|
||||
.currencyCode(gameBalanceExchange.getCurrencyCode())
|
||||
.actualBalance(tenantQuotaExchange.getActualBalance())
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.balance(balanceRequestAmount)
|
||||
.memberId(member.getId())
|
||||
.operationType(OperationType.API_BALANCE.getCode())
|
||||
.quotaType(quotaType)
|
||||
.remark(OperationType.API_BALANCE.getDescription())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
||||
TenantGameQuota tenantGameQuota = this.selectTenantGameQuotaByTenantKey(gameBalanceExchange.getTenantKey(), QuotaType.BALANCE.getCode());
|
||||
return tenantGameQuota.getBalance();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 按租户密钥选择租户游戏配额
|
||||
*
|
||||
* @param tenantKey 租户密钥
|
||||
* @param quotaType 配额类型
|
||||
* @return {@link TenantGameQuota }
|
||||
*/
|
||||
@Override
|
||||
public TenantGameQuota selectTenantGameQuotaByTenantKey(String tenantKey, String quotaType) {
|
||||
TenantGameQuota tenantGameQuota = tenantGameQuotaMapper.selectTenantGameQuotaByTenantKey(tenantKey, quotaType);
|
||||
|
||||
//如果当前钱包不存在
|
||||
if (ObjectUtils.isEmpty(tenantGameQuota)) {
|
||||
tenantGameQuota = TenantGameQuota.builder()
|
||||
.tenantKey(tenantKey)
|
||||
.id(IdUtil.getSnowflakeNextId())
|
||||
.balance(BigDecimal.ZERO)
|
||||
.quotaType(quotaType)
|
||||
.version(0)
|
||||
.build();
|
||||
tenantGameQuotaMapper.insertTenantGameQuota(tenantGameQuota);
|
||||
}
|
||||
return tenantGameQuota;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
package com.ff.common.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.common.mapper.TenantQuotaExchangeMapper;
|
||||
import com.ff.common.domain.TenantQuotaExchange;
|
||||
import com.ff.common.service.ITenantQuotaExchangeService;
|
||||
|
||||
/**
|
||||
* 币种汇率Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Service
|
||||
public class TenantQuotaExchangeServiceImpl implements ITenantQuotaExchangeService
|
||||
{
|
||||
@Autowired
|
||||
private TenantQuotaExchangeMapper tenantQuotaExchangeMapper;
|
||||
|
||||
/**
|
||||
* 查询币种汇率
|
||||
*
|
||||
* @param id 币种汇率主键
|
||||
* @return 币种汇率
|
||||
*/
|
||||
@Override
|
||||
public TenantQuotaExchange selectTenantQuotaExchangeById(Long id)
|
||||
{
|
||||
return tenantQuotaExchangeMapper.selectTenantQuotaExchangeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询币种汇率列表
|
||||
*
|
||||
* @param tenantQuotaExchange 币种汇率
|
||||
* @return 币种汇率
|
||||
*/
|
||||
@Override
|
||||
public List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange)
|
||||
{
|
||||
return tenantQuotaExchangeMapper.selectTenantQuotaExchangeList(tenantQuotaExchange);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户配额交换
|
||||
*
|
||||
* @param currencyCode 货币代码
|
||||
* @param exchangeCurrencyCode 兑换货币代码
|
||||
* @return {@link TenantQuotaExchange }
|
||||
*/
|
||||
@Override
|
||||
public TenantQuotaExchange getTenantQuotaExchange(String currencyCode, String exchangeCurrencyCode) {
|
||||
return tenantQuotaExchangeMapper.getTenantQuotaExchange(currencyCode, exchangeCurrencyCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增币种汇率
|
||||
*
|
||||
* @param tenantQuotaExchange 币种汇率
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange)
|
||||
{
|
||||
tenantQuotaExchange.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantQuotaExchange.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantQuotaExchangeMapper.insertTenantQuotaExchange(tenantQuotaExchange);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改币种汇率
|
||||
*
|
||||
* @param tenantQuotaExchange 币种汇率
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange)
|
||||
{
|
||||
tenantQuotaExchange.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantQuotaExchangeMapper.updateTenantQuotaExchange(tenantQuotaExchange);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除币种汇率
|
||||
*
|
||||
* @param ids 需要删除的币种汇率主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantQuotaExchangeByIds(Long[] ids)
|
||||
{
|
||||
return tenantQuotaExchangeMapper.deleteTenantQuotaExchangeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除币种汇率信息
|
||||
*
|
||||
* @param id 币种汇率主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantQuotaExchangeById(Long id)
|
||||
{
|
||||
return tenantQuotaExchangeMapper.deleteTenantQuotaExchangeById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
package com.ff.config;
|
||||
|
||||
import com.ff.base.datasource.DynamicDataSource;
|
||||
import com.ff.base.system.domain.SysDatasource;
|
||||
import com.ff.base.system.mapper.SysDatasourceMapper;
|
||||
import com.ff.base.system.service.ISysConfigService;
|
||||
import com.ff.base.system.service.ISysDictTypeService;
|
||||
import com.ff.game.service.IPlatformService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 启动项目时加载多数据源
|
||||
*
|
||||
* @author liukang
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ContentRefreshedEventListener implements ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
@Resource
|
||||
private DynamicDataSource dynamicDataSource;
|
||||
|
||||
@Resource
|
||||
private SysDatasourceMapper dataSourceMapper;
|
||||
|
||||
@Resource
|
||||
private ISysConfigService sysConfigService;
|
||||
|
||||
@Resource
|
||||
private ISysDictTypeService sysDictTypeService;
|
||||
|
||||
@Resource
|
||||
private IPlatformService platformService;
|
||||
/**
|
||||
* 项目加载时运行
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
// 创建所有数据源
|
||||
SysDatasource sysDatasource = new SysDatasource();
|
||||
sysDatasource.setStatus("1");
|
||||
List<SysDatasource> dataourceList = dataSourceMapper.selectSysDatasourceList(sysDatasource);
|
||||
if (!CollectionUtils.isEmpty(dataourceList)) {
|
||||
dynamicDataSource.createDataSource(dataourceList);
|
||||
}
|
||||
sysConfigService.loadingConfigCache();
|
||||
sysDictTypeService.loadingDictCache();
|
||||
|
||||
platformService.loadToCache();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
package com.ff.config;
|
||||
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 关键 工具
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/11
|
||||
*/
|
||||
@Component
|
||||
public class KeyConfig {
|
||||
|
||||
// 定义一个 ThreadLocal 变量,持有当前线程的全局变量
|
||||
private ThreadLocal<TenantSecretKey> threadLocalVariable = new ThreadLocal<>();
|
||||
|
||||
/**
|
||||
* 设置
|
||||
*
|
||||
* @param value 价值
|
||||
*/
|
||||
public void set(TenantSecretKey value) {
|
||||
threadLocalVariable.set(value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 得到
|
||||
*
|
||||
* @return {@link String }
|
||||
*/
|
||||
public TenantSecretKey get() {
|
||||
return threadLocalVariable.get();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 清楚
|
||||
*/
|
||||
public void clear() {
|
||||
threadLocalVariable.remove();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
package com.ff.delay;
|
||||
|
||||
import com.ff.base.manager.AsyncManager;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.concurrent.DelayQueue;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author cengy
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DelayService {
|
||||
private DelayQueue<DelayTask> delayQueue = new DelayQueue<>();
|
||||
|
||||
private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
|
||||
|
||||
public void addTask(DelayTask delayTask) {
|
||||
delayQueue.put(delayTask);
|
||||
}
|
||||
|
||||
// 启动延迟队列任务处理
|
||||
@PostConstruct
|
||||
public void startProcessing() {
|
||||
// 每 1 秒钟执行一次任务检查
|
||||
scheduler.scheduleAtFixedRate(this::processTasks, 10, 1, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
// 处理过期任务
|
||||
private void processTasks() {
|
||||
DelayTask task = null; // 阻塞,直到队列中有任务到期
|
||||
try {
|
||||
task = delayQueue.take();
|
||||
} catch (InterruptedException e) {
|
||||
log.error("获取过期任务失败", e);
|
||||
}
|
||||
if (null == task) {
|
||||
return;
|
||||
}
|
||||
AsyncManager.me().execute(new DelayRunnable(task));
|
||||
}
|
||||
|
||||
public static class DelayRunnable implements Runnable {
|
||||
|
||||
DelayTask delayTask;
|
||||
|
||||
public DelayRunnable(DelayTask delayTask) {
|
||||
this.delayTask = delayTask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
delayTask.execute();
|
||||
} catch (Exception e) {
|
||||
log.error("处理过期任务出错", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
package com.ff.delay;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.concurrent.Delayed;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author cengy
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public abstract class DelayTask implements Delayed {
|
||||
private long delayTime;
|
||||
private long expireTime;
|
||||
|
||||
public DelayTask(long delayTime) {
|
||||
this.delayTime = delayTime;
|
||||
this.expireTime = System.currentTimeMillis() + delayTime; // 设置过期时间
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDelay(TimeUnit unit) {
|
||||
long diff = expireTime - System.currentTimeMillis();
|
||||
return unit.convert(diff, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Delayed o) {
|
||||
if (this.expireTime < ((DelayTask) o).expireTime) {
|
||||
return -1;
|
||||
}
|
||||
if (this.expireTime > ((DelayTask) o).expireTime) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
abstract public void execute();
|
||||
}
|
||||
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
package com.ff.file.controller;
|
||||
|
||||
import com.ff.base.annotation.Anonymous;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.file.service.ISysFileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 文件管理
|
||||
*
|
||||
* @author ff
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/file")
|
||||
public class FileController {
|
||||
|
||||
@Autowired
|
||||
private Map<String, ISysFileService> fileServiceMap;
|
||||
|
||||
/**
|
||||
* 通用上传请求(单个)
|
||||
*/
|
||||
@PostMapping("/upload/{service}")
|
||||
@Anonymous
|
||||
public AjaxResult uploadFile(MultipartFile file, @PathVariable String service) {
|
||||
|
||||
ISysFileService sysFileService = fileServiceMap.get(service + Constants.SERVICE);
|
||||
if (sysFileService == null) {
|
||||
throw new BaseException(MessageUtils.message("upload.file.server.not.exist"));
|
||||
}
|
||||
return sysFileService.uploadFile(file);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
package com.ff.file.service;
|
||||
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ISysFileService
|
||||
{
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
public AjaxResult uploadFile(MultipartFile file) ;
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
package com.ff.file.service.impl;
|
||||
|
||||
import com.ff.base.config.FFConfig;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.file.FileUploadUtils;
|
||||
import com.ff.base.utils.file.FileUtils;
|
||||
import com.ff.file.service.ISysFileService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 本地文件存储
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service("localSysFileService")
|
||||
@Slf4j
|
||||
public class LocalSysFileServiceImpl implements ISysFileService {
|
||||
/**
|
||||
* 本地文件上传接口
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult uploadFile(MultipartFile file) {
|
||||
try {
|
||||
// 上传文件路径
|
||||
String filePath = FFConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", fileName);
|
||||
ajax.put("fileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
} catch (IOException e) {
|
||||
log.error("本地文件上传异常,{}", e);
|
||||
throw new BaseException(MessageUtils.message("upload.file.exception"), e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
package com.ff.game.api;
|
||||
|
||||
|
||||
|
||||
import com.ff.game.api.request.*;
|
||||
import com.ff.game.domain.GameBettingDetails;
|
||||
import com.ff.game.domain.GameFreeRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 游戏数据解析服务
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/21
|
||||
*/
|
||||
public interface IGamesService {
|
||||
|
||||
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @param createMemberRequestDTO 创建成员请求dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean createMember(CreateMemberRequestDTO createMemberRequestDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param memberInfoRequestDTO 会员信息请求dto
|
||||
* @return {@link MemberInfoResponseDTO }
|
||||
*/
|
||||
MemberInfoResponseDTO getMemberInfo(MemberInfoRequestDTO memberInfoRequestDTO);
|
||||
|
||||
/**
|
||||
* 无重定向登录
|
||||
*
|
||||
* @param gamesLogin 游戏登录
|
||||
* @return {@link String }
|
||||
*/
|
||||
String loginWithoutRedirect(GamesLogin gamesLogin);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取游戏列表
|
||||
*
|
||||
* @param gamesBaseRequestDTO 游戏请求dto
|
||||
* @return {@link String }
|
||||
*/
|
||||
String getGameList(GamesBaseRequestDTO gamesBaseRequestDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 按代理id进行交换转账
|
||||
*
|
||||
* @param exchangeTransferMoneyRequestDTO 外汇转账moeny dto
|
||||
* @return {@link Long }
|
||||
*/
|
||||
Long exchangeTransferByAgentId(ExchangeTransferMoneyRequestDTO exchangeTransferMoneyRequestDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 汇兑转移状态确认
|
||||
*
|
||||
* @param exchangeTransferMoneyRequestDTO 兑换转账请求dto
|
||||
* @return {@link ExchangeTransferStatusResponseDTO }
|
||||
*/
|
||||
ExchangeTransferStatusResponseDTO exchangeTransferStatus(ExchangeTransferStatusRequestDTO exchangeTransferMoneyRequestDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 按时间获取投注记录
|
||||
*
|
||||
* @param betRecordByTimeDTO 按时间dto投注记录
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean getBetRecordByTime(BetRecordByTimeDTO betRecordByTimeDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 按历史时间获取投注记录 部分平台需要两个接口同时跑投注记录
|
||||
*
|
||||
* @param betRecordByTimeDTO 按时间dto投注记录
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean getBetRecordByHistoryTime(BetRecordByTimeDTO betRecordByTimeDTO);
|
||||
|
||||
/**
|
||||
* 赠送免费局数
|
||||
*
|
||||
* @param createFreeSpinRequest 创建自由旋转请求
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean createFreeSpin(CreateFreeSpinRequestDTO createFreeSpinRequest);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取游戏详细信息
|
||||
*
|
||||
* @param getGameDetailRequestDTO 获取游戏详细信息请求dto
|
||||
* @return {@link GetGameDetailResponseDTO }
|
||||
*/
|
||||
GetGameDetailResponseDTO getGameDetail(GetGameDetailRequestDTO getGameDetailRequestDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 强制会员从游戏注销
|
||||
*
|
||||
* @param kickMemberRequestDTO 踢会员请求dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean kickMember(KickMemberRequestDTO kickMemberRequestDTO);
|
||||
|
||||
/**
|
||||
* 踢成员全部
|
||||
*
|
||||
* @param kickMemberAllDTO 踢成员全部dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean kickMemberAll(KickMemberAllDTO kickMemberAllDTO);
|
||||
/**
|
||||
* 免费游戏玩家使用的纪录
|
||||
*
|
||||
* @param getFreeSpinDashflowRequestDTO 获取自由旋转dashflow请求dto
|
||||
* @return {@link List }<{@link GameFreeRecord }>
|
||||
*/
|
||||
List<GameFreeRecord> getFreeSpinDashflow(GetFreeSpinDashflowRequestDTO getFreeSpinDashflowRequestDTO);
|
||||
|
||||
/**
|
||||
* 取消赠送免费局数
|
||||
*
|
||||
* @param cancelFreeSpinRequestDTO 取消免费旋转请求
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
Boolean cancelFreeSpin(CancelFreeSpinRequestDTO cancelFreeSpinRequestDTO);
|
||||
|
||||
/**
|
||||
* 游戏演示登录
|
||||
*
|
||||
* @param gameDemoLoginRequestDTO 游戏演示登录请求dto
|
||||
* @return {@link GameDemoLoginResponseDTO }
|
||||
*/
|
||||
GameDemoLoginResponseDTO gameDemoLogin(GameDemoLoginRequestDTO gameDemoLoginRequestDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 数据构建
|
||||
*
|
||||
* @param gamesDataBuildDTO 数据
|
||||
* @return {@link GameBettingDetails }
|
||||
*/
|
||||
GameBettingDetails dataBuild(GamesDataBuildDTO gamesDataBuildDTO);
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.ff.game.api.ae.address;
|
||||
|
||||
import com.dtflys.forest.callback.AddressSource;
|
||||
import com.dtflys.forest.http.ForestAddress;
|
||||
import com.dtflys.forest.http.ForestRequest;
|
||||
import com.ff.base.enums.GamePlatforms;
|
||||
import com.ff.game.service.IPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* 我jili address来源
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Component
|
||||
public class MyAEAddressSource implements AddressSource {
|
||||
|
||||
@Resource
|
||||
private IPlatformService platformService;
|
||||
|
||||
@Override
|
||||
public ForestAddress getAddress(ForestRequest request) {
|
||||
String apiBaseUrl = platformService.get(GamePlatforms.AE.getCode())
|
||||
.getUrlInfo().getUrl();
|
||||
return new ForestAddress("https", apiBaseUrl, 443, "");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,132 +0,0 @@
|
|||
package com.ff.game.api.ae.client;
|
||||
|
||||
import com.dtflys.forest.annotation.*;
|
||||
import com.ff.game.api.ae.address.MyAEAddressSource;
|
||||
import com.ff.game.api.ae.dto.*;
|
||||
import com.ff.game.api.jili.dto.*;
|
||||
import com.ff.game.api.xk.dto.XKKickMemberAllDTO;
|
||||
import com.ff.game.api.xk.dto.XKKickMemberDTO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* xk 请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Address(source = MyAEAddressSource.class)
|
||||
public interface AEClient {
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Post(url ="/wallet/createMember",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AEResponse createMember(@Body Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link AEMemberInfo }
|
||||
*/
|
||||
@Post(url ="/wallet/getBalance",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AEMemberInfo getMemberInfo(@Body Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 无重定向登录
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link AELoginResponse }
|
||||
*/
|
||||
@Post("/wallet/login")
|
||||
AELoginResponse loginWithoutRedirect(@Body Map<String, Object> params);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 按代理id进行交换转账
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link JILIExchangeMoneyResponseDTO }
|
||||
*/
|
||||
@Post(url ="/wallet/deposit",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AETransactionResponse deposit(@Body Map<String, Object> params);
|
||||
|
||||
|
||||
@Post(url ="/wallet/withdraw",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AETransactionResponse withdraw(@Body Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* 汇兑转移状态
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link AEExchangeTransferStatusResponse }
|
||||
*/
|
||||
@Post(url ="/wallet/checkTransferOperation",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AEExchangeTransferStatusResponse exchangeTransferStatus(@Body Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 按时间获取投注记录
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link AEBetRecordResponse }
|
||||
*/
|
||||
@Post(url ="https://tttfetch.apihub55.com/fetch/gzip/getTransactionByUpdateDate",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AEBetRecordResponse getBetRecordByTime(@Body Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 按时间获取投注历史记录
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link AEBetRecordResponse }
|
||||
*/
|
||||
@Post(url ="https://tttfetch.apihub55.com/fetch/gzip/getTransactionByTxTime",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AEBetRecordResponse getBetHistoryRecordByTime(@Body Map<String, Object> params);
|
||||
/**
|
||||
* 踢出队员
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link JILIKickMemberDTO }
|
||||
*/
|
||||
@Post(url ="/wallet/logout",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
XKKickMemberDTO kickMember(@Body Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 踢出所有队员
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link JILIKickMemberAllDTO }
|
||||
*/
|
||||
@Get("/kickMemberAll")
|
||||
XKKickMemberAllDTO kickMemberAll(@JSONBody Map<String, Object> params);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,186 +0,0 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* aebet记录响应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/04/01
|
||||
*/
|
||||
@Data
|
||||
public class AEBetRecordResponse {
|
||||
|
||||
/**
|
||||
* 状态代码
|
||||
*/
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 描述信息 (String类型)
|
||||
* "Success" - 请求成功
|
||||
* 其他 - 错误信息
|
||||
*/
|
||||
private String desc;
|
||||
/**
|
||||
* 交易记录
|
||||
*/
|
||||
@JsonProperty("transactions")
|
||||
private List<Transaction> transactions;
|
||||
|
||||
@Data
|
||||
public static class Transaction {
|
||||
|
||||
/**
|
||||
* 游戏类型
|
||||
*/
|
||||
@JsonProperty("gameType")
|
||||
private String gameType;
|
||||
|
||||
/**
|
||||
* 返还金额(包含下注金额)
|
||||
*/
|
||||
@JsonProperty("winAmount")
|
||||
private BigDecimal winAmount;
|
||||
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
@JsonProperty("txTime")
|
||||
private Date txTime;
|
||||
|
||||
/**
|
||||
* 结算状态
|
||||
*/
|
||||
@JsonProperty("settleStatus")
|
||||
private Integer settleStatus;
|
||||
|
||||
/**
|
||||
* 游戏信息
|
||||
*/
|
||||
@JsonProperty("gameInfo")
|
||||
private String gameInfo;
|
||||
|
||||
/**
|
||||
* 真实返还金额
|
||||
*/
|
||||
@JsonProperty("realWinAmount")
|
||||
private BigDecimal realWinAmount;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonProperty("updateTime")
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 真实下注金额
|
||||
*/
|
||||
@JsonProperty("realBetAmount")
|
||||
private BigDecimal realBetAmount;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@JsonProperty("userId")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 下注类型
|
||||
*/
|
||||
@JsonProperty("betType")
|
||||
private String betType;
|
||||
|
||||
/**
|
||||
* 平台名称
|
||||
*/
|
||||
@JsonProperty("platform")
|
||||
private String platform;
|
||||
|
||||
/**
|
||||
* 交易状态
|
||||
*/
|
||||
@JsonProperty("txStatus")
|
||||
private Integer txStatus;
|
||||
|
||||
/**
|
||||
* 下注金额
|
||||
*/
|
||||
@JsonProperty("betAmount")
|
||||
private BigDecimal betAmount;
|
||||
|
||||
/**
|
||||
* 游戏名称
|
||||
*/
|
||||
@JsonProperty("gameName")
|
||||
private String gameName;
|
||||
|
||||
/**
|
||||
* 平台注单号
|
||||
*/
|
||||
@JsonProperty("platformTxId")
|
||||
private String platformTxId;
|
||||
|
||||
/**
|
||||
* 下注时间
|
||||
*/
|
||||
@JsonProperty("betTime")
|
||||
private Date betTime;
|
||||
|
||||
/**
|
||||
* 平台游戏代码
|
||||
*/
|
||||
@JsonProperty("gameCode")
|
||||
private String gameCode;
|
||||
|
||||
/**
|
||||
* 玩家货币代码
|
||||
*/
|
||||
@JsonProperty("currency")
|
||||
private String currency;
|
||||
|
||||
/**
|
||||
* 累积奖金的获胜金额
|
||||
*/
|
||||
@JsonProperty("jackpotWinAmount")
|
||||
private BigDecimal jackpotWinAmount;
|
||||
|
||||
/**
|
||||
* 累积奖金贡献金额
|
||||
*/
|
||||
@JsonProperty("jackpotBetAmount")
|
||||
private BigDecimal jackpotBetAmount;
|
||||
|
||||
/**
|
||||
* 平台有效投注
|
||||
*/
|
||||
@JsonProperty("turnover")
|
||||
private BigDecimal turnover;
|
||||
|
||||
/**
|
||||
* 游戏商的回合识别码
|
||||
*/
|
||||
@JsonProperty("roundId")
|
||||
private String roundId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 子注单号
|
||||
*/
|
||||
@JsonProperty("refPlatformTxId")
|
||||
private String refPlatformTxId;
|
||||
|
||||
/**
|
||||
* 是否为特殊收费游戏
|
||||
*/
|
||||
@JsonProperty("isPremium")
|
||||
private Boolean isPremium;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* aeexchange传输状态响应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/04/01
|
||||
*/
|
||||
@Data
|
||||
public class AEExchangeTransferStatusResponse {
|
||||
|
||||
/**
|
||||
* 响应状态
|
||||
*/
|
||||
@JsonProperty("status")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 情境 1:响应 status = 0000 & txStatus = 1 表示存款/提款成功
|
||||
* 情境 2:响应 status = 0000 & txStatus = 0 表示存款/提款失败
|
||||
* 情境 3:响应 status = 0000 & txStatus = 2 表示存款/提款处理中,可 3 秒后调用 checkTransferOperation API 确认回覆直到 txStatus = 0 或 1 的回覆
|
||||
* 情境 4:响应 status = 1017 表示交易不存在
|
||||
*/
|
||||
@JsonProperty("txStatus")
|
||||
private String txStatus;
|
||||
|
||||
/**
|
||||
* 当前余额
|
||||
*/
|
||||
@JsonProperty("balance")
|
||||
private BigDecimal balance;
|
||||
|
||||
/**
|
||||
* 转账金额
|
||||
*/
|
||||
@JsonProperty("transferAmount")
|
||||
private BigDecimal transferAmount;
|
||||
|
||||
/**
|
||||
* 转账类型(如:DEPOSIT 或 WITHDRAW)
|
||||
*/
|
||||
@JsonProperty("transferType")
|
||||
private String transferType;
|
||||
|
||||
/**
|
||||
* 交易代码
|
||||
*/
|
||||
@JsonProperty("txCode")
|
||||
private String txCode;
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* aelogin回应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/04/01
|
||||
*/
|
||||
@Data
|
||||
public class AELoginResponse {
|
||||
/**
|
||||
* 响应状态
|
||||
*/
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
|
||||
|
||||
/**
|
||||
* 描述信息 (String类型)
|
||||
* "Success" - 请求成功
|
||||
* 其他 - 错误信息
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
* 登录 URL
|
||||
*/
|
||||
@JsonProperty("url")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 扩展字段,类型为列表,可以存储多项数据
|
||||
*/
|
||||
@JsonProperty("extension")
|
||||
private List<String> extension;
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 注销用户响应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/04/01
|
||||
*/
|
||||
@Data
|
||||
public class AELogoutUserResponse {
|
||||
/**
|
||||
* 状态代码
|
||||
*/
|
||||
@JsonProperty("status")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 已注销的用户列表
|
||||
*/
|
||||
@JsonProperty("logoutUsers")
|
||||
private List<String> logoutUsers;
|
||||
|
||||
/**
|
||||
* 用户数量
|
||||
*/
|
||||
@JsonProperty("count")
|
||||
private Integer count;
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AEMEMBER信息
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/03/31
|
||||
*/
|
||||
@Data
|
||||
public class AEMemberInfo {
|
||||
/**
|
||||
* 响应结果列表,包含用户信息
|
||||
*/
|
||||
@JsonProperty("results")
|
||||
private List<UserInfo> result;
|
||||
|
||||
/**
|
||||
* 记录数量
|
||||
*/
|
||||
@JsonProperty("count")
|
||||
private int count;
|
||||
|
||||
/**
|
||||
* 查询时间
|
||||
*/
|
||||
@JsonProperty("querytime")
|
||||
private Date queryTime;
|
||||
|
||||
/**
|
||||
* 响应状态
|
||||
*/
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
|
||||
@Data
|
||||
public static class UserInfo {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@JsonProperty("userId")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户余额
|
||||
*/
|
||||
@JsonProperty("balance")
|
||||
private BigDecimal balance;
|
||||
|
||||
/**
|
||||
* 最后修改时间
|
||||
*/
|
||||
@JsonProperty("lastModified")
|
||||
private Date lastModified;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 航空响应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/03/28
|
||||
*/
|
||||
@Data
|
||||
public class AEResponse {
|
||||
/**
|
||||
* 状态码 (String类型)
|
||||
* 0000 - 成功
|
||||
* 其他 - 错误状态码
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 描述信息 (String类型)
|
||||
* "Success" - 请求成功
|
||||
* 其他 - 错误信息
|
||||
*/
|
||||
private String desc;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue