项目初始化
commit
12981b9dbd
|
|
@ -0,0 +1,128 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>ff</artifactId>
|
||||
<groupId>com.ff</groupId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.ff</groupId>
|
||||
<artifactId>ff-admin</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<name>ff-admin</name>
|
||||
<description>ff-admin</description>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- spring-boot-devtools -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- swagger3-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 定时任务 -->
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.mchange</groupId>
|
||||
<artifactId>c3p0</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.ff</groupId>
|
||||
<artifactId>ff-base</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成-->
|
||||
<dependency>
|
||||
<groupId>com.ff</groupId>
|
||||
<artifactId>ff-gen</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>4.1.111.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.socket</groupId>
|
||||
<artifactId>socket.io-client</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dtflys.forest</groupId>
|
||||
<artifactId>forest-spring-boot-starter</artifactId>
|
||||
<version>1.6.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.5.15</version>
|
||||
<configuration>
|
||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.ff;
|
||||
|
||||
import com.ff.base.config.IdGeneratorUtil;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
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 })
|
||||
@MapperScan({"com.ff.base.system.mapper","com.ff.quartz.mapper","com.ff.gen.mapper"})
|
||||
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = DaoAuthenticationProvider.class)})
|
||||
@EnableAsync
|
||||
public class FFApplication implements CommandLineRunner
|
||||
{
|
||||
@Autowired
|
||||
private IdGeneratorUtil idGeneratorUtil;
|
||||
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(FFApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ FF启动成功 ლ(´ڡ`ლ)゙"+ SpringBootVersion.getVersion());
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
idGeneratorUtil.init();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.ff;
|
||||
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
/**
|
||||
* web容器中进行部署
|
||||
*
|
||||
* @author ff
|
||||
*/
|
||||
public class FFServletInitializer extends SpringBootServletInitializer
|
||||
{
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
|
||||
{
|
||||
return application.sources(FFApplication.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
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 {
|
||||
// 该注解没有参数,直接标识类需要进行头部验证
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.ff.annotation;
|
||||
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.config.KeyConfig;
|
||||
import com.ff.base.utils.sign.Md5Utils;
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
import com.ff.common.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;
|
||||
|
||||
/**
|
||||
* 标题检查方面
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
public class HeaderCheckAspect {
|
||||
|
||||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
@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不存在");
|
||||
|
||||
String keyG = Md5Utils.md5New(random + key + tenantSecretKey.getTenantSecret());
|
||||
Assert.isTrue(keyG.equals(sign), "签名错误");
|
||||
//保存
|
||||
keyUtils.set(tenantSecretKey);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
package com.ff.api.controller;
|
||||
|
||||
|
||||
import com.ff.annotation.CheckHeader;
|
||||
import com.ff.api.request.GameLoginRequest;
|
||||
import com.ff.api.request.MemberCreateApiRequest;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.utils.SecurityUtils;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
import com.ff.config.KeyConfig;
|
||||
import com.ff.game.api.IGamesService;
|
||||
import com.ff.game.api.request.CreateMemberRequestDTO;
|
||||
import com.ff.game.api.request.GamesLogin;
|
||||
import com.ff.game.api.request.MemberInfoRequestDTO;
|
||||
import com.ff.game.domain.Game;
|
||||
import com.ff.game.domain.GamePlatform;
|
||||
import com.ff.game.domain.GameSecretKey;
|
||||
import com.ff.game.service.IGamePlatformService;
|
||||
import com.ff.game.service.IGameSecretKeyService;
|
||||
import com.ff.game.service.IGameService;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
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.util.Map;
|
||||
|
||||
/**
|
||||
* api控制器
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@RestController
|
||||
@CheckHeader
|
||||
@RequestMapping("/api/game")
|
||||
public class ApiGameController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private Map<String, IGamesService> gamesService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IGameService gameService;
|
||||
|
||||
|
||||
@Resource
|
||||
private KeyConfig keyConfig;
|
||||
|
||||
@Resource
|
||||
private IGameSecretKeyService gameSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private IMemberService memberService;
|
||||
|
||||
@Resource
|
||||
private IGamePlatformService gamePlatformService;
|
||||
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
* @param memberCreateApiRequest 成员创建api请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@Validated @RequestBody GameLoginRequest memberCreateApiRequest) {
|
||||
|
||||
Game game = gameService.selectGameById(memberCreateApiRequest.getGameId());
|
||||
Assert.notNull(game, "游戏不存在");
|
||||
|
||||
GamePlatform gamePlatform = gamePlatformService.selectGamePlatformById(game.getPlatformId());
|
||||
Assert.notNull(gamePlatform, "游戏平台不存在");
|
||||
|
||||
|
||||
IGamesService iGamesService = gamesService.get(gamePlatform.getPlatformCode() + Constants.SERVICE);
|
||||
Assert.notNull(iGamesService, "平台不存在");
|
||||
|
||||
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
GameSecretKey gameSecretKey = gameSecretKeyService.findSecretKeyByPlatformAndSystemCode(gamePlatform.getPlatformCode(), memberCreateApiRequest.getCurrencyCode());
|
||||
Assert.notNull(gameSecretKey, "货币游戏平台不存在");
|
||||
|
||||
GameSecretKey gameSecretKeyLang = gameSecretKeyService.findByPlatformAndSystemLangCode(gamePlatform.getPlatformCode(), memberCreateApiRequest.getLangCode());
|
||||
Assert.notNull(gameSecretKeyLang, "当前语言不存在");
|
||||
|
||||
Member member = memberService.selectMemberByGameAccount(StringUtils.addSuffix(memberCreateApiRequest.getAccount(), memberCreateApiRequest.getCurrencyCode() + tenantSecretKey.getTenantSn()));
|
||||
|
||||
GamesLogin gamesLogin = GamesLogin.builder()
|
||||
.agentId(gameSecretKey.getCode())
|
||||
.agentKey(gameSecretKey.getKey())
|
||||
.account(member.getGameAccount())
|
||||
.gameId(game.getGameCode())
|
||||
.homeUrl(memberCreateApiRequest.getHomeUrl())
|
||||
.platform(memberCreateApiRequest.getPlatform())
|
||||
.disableFullScreen(memberCreateApiRequest.getDisableFullScreen())
|
||||
.lang(gameSecretKeyLang.getLang())
|
||||
.build();
|
||||
|
||||
String login = iGamesService.loginWithoutRedirect(gamesLogin);
|
||||
|
||||
return AjaxResult.success(login);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
package com.ff.api.controller;
|
||||
|
||||
|
||||
import com.ff.annotation.CheckHeader;
|
||||
import com.ff.api.request.MemberCreateApiRequest;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
import com.ff.config.KeyConfig;
|
||||
import com.ff.game.api.IGamesService;
|
||||
import com.ff.game.api.request.CreateMemberRequestDTO;
|
||||
import com.ff.game.api.request.MemberInfoRequestDTO;
|
||||
import com.ff.game.domain.GameSecretKey;
|
||||
import com.ff.game.service.IGameSecretKeyService;
|
||||
import com.ff.game.service.IGameService;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* api控制器
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@RestController
|
||||
@CheckHeader
|
||||
@RequestMapping("/api/member")
|
||||
public class ApiMemberController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private Map<String, IGamesService> gamesService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IGameService gameService;
|
||||
|
||||
|
||||
@Resource
|
||||
private KeyConfig keyConfig;
|
||||
|
||||
@Resource
|
||||
private IGameSecretKeyService gameSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private IMemberService memberService;
|
||||
|
||||
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @param memberCreateApiRequest 创建成员api请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public AjaxResult createMember(@Validated @RequestBody MemberCreateApiRequest memberCreateApiRequest) {
|
||||
|
||||
IGamesService iGamesService = gamesService.get(memberCreateApiRequest.getPlatformCode() + Constants.SERVICE);
|
||||
Assert.notNull(iGamesService, "平台不存在");
|
||||
|
||||
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
GameSecretKey gameSecretKey = gameSecretKeyService.findSecretKeyByPlatformAndSystemCode(memberCreateApiRequest.getPlatformCode(), memberCreateApiRequest.getCurrencyCode());
|
||||
Assert.notNull(gameSecretKey, "货币游戏平台不存在");
|
||||
|
||||
String gameAccount = StringUtils.addSuffix(memberCreateApiRequest.getAccount(), memberCreateApiRequest.getCurrencyCode() + tenantSecretKey.getTenantSn());
|
||||
//向第三方注册账号
|
||||
CreateMemberRequestDTO gamesBaseRequestDTO = CreateMemberRequestDTO.builder()
|
||||
.account(gameAccount)
|
||||
.agentId(gameSecretKey.getCode())
|
||||
.agentKey(gameSecretKey.getKey())
|
||||
.build();
|
||||
Boolean result = iGamesService.createMember(gamesBaseRequestDTO);
|
||||
Assert.isTrue(result, "建立游戏账号失败");
|
||||
//注册本地账号
|
||||
Member member = Member.builder()
|
||||
.tenantKey(tenantSecretKey.getTenantSn())
|
||||
.memberAccount(memberCreateApiRequest.getAccount())
|
||||
.gameAccount(gameAccount)
|
||||
.platformCode(memberCreateApiRequest.getPlatformCode())
|
||||
.currencyCode(memberCreateApiRequest.getCurrencyCode())
|
||||
.build();
|
||||
return toAjax(memberService.insertMember(member));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param memberCreateApiRequest 成员创建api请求
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/info")
|
||||
public AjaxResult getMemberInfo(@Validated @RequestBody MemberCreateApiRequest memberCreateApiRequest) {
|
||||
IGamesService iGamesService = gamesService.get(memberCreateApiRequest.getPlatformCode() + Constants.SERVICE);
|
||||
Assert.notNull(iGamesService, "平台不存在");
|
||||
|
||||
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
GameSecretKey gameSecretKey = gameSecretKeyService.findSecretKeyByPlatformAndSystemCode(memberCreateApiRequest.getPlatformCode(), memberCreateApiRequest.getCurrencyCode());
|
||||
Assert.notNull(gameSecretKey, "货币游戏平台不存在");
|
||||
|
||||
Member member = memberService.selectMemberByGameAccount(StringUtils.addSuffix(memberCreateApiRequest.getAccount(), memberCreateApiRequest.getCurrencyCode() + tenantSecretKey.getTenantSn()));
|
||||
Assert.notNull(member, "会员不存在");
|
||||
//向第三方查询账号
|
||||
MemberInfoRequestDTO gamesBaseRequestDTO = MemberInfoRequestDTO.builder()
|
||||
.accounts(member.getGameAccount())
|
||||
.agentId(gameSecretKey.getCode())
|
||||
.agentKey(gameSecretKey.getKey())
|
||||
.build();
|
||||
return AjaxResult.success(iGamesService.getMemberInfo(gamesBaseRequestDTO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
import com.dtflys.forest.annotation.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 游戏登录请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/11
|
||||
*/
|
||||
@Data
|
||||
public class GameLoginRequest implements Serializable {
|
||||
private final static long serialVersionUID = 7699430372422335056L;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 货币代码
|
||||
*/
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 语种id
|
||||
*/
|
||||
@NotBlank(message = "langCode不能为空")
|
||||
private String langCode;
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
@NotBlank(message = "account不能为空")
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
@NotBlank(message = "gameId不能为空")
|
||||
private Long gameId;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏回主页功能导向位置
|
||||
*/
|
||||
private String homeUrl;
|
||||
/**
|
||||
* 带入 web 或是 app
|
||||
*/
|
||||
private String platform;
|
||||
/**
|
||||
* 带入 1 即关闭全屏幕模式
|
||||
*/
|
||||
private Integer disableFullScreen;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 创建成员请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Data
|
||||
public class MemberCreateApiRequest implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 8071608271351542925L;
|
||||
|
||||
@NotBlank(message = "account不能为空")
|
||||
private String account;
|
||||
|
||||
/** 平台编码 */
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
private String platformCode;
|
||||
|
||||
/** 币种编码 */
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
private String currencyCode;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ff.api.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
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不能为空")
|
||||
private String account;
|
||||
|
||||
/** 平台编码 */
|
||||
@NotBlank(message = "platformCode不能为空")
|
||||
private String platformCode;
|
||||
|
||||
/** 币种编码 */
|
||||
@NotBlank(message = "currencyCode不能为空")
|
||||
private String currencyCode;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出币种列表
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
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));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
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.TenantSecretKey;
|
||||
import com.ff.common.service.ITenantSecretKeyService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户租户密钥Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/key")
|
||||
public class TenantSecretKeyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
/**
|
||||
* 查询用户租户密钥列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
startPage();
|
||||
List<TenantSecretKey> list = tenantSecretKeyService.selectTenantSecretKeyList(tenantSecretKey);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户租户密钥列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:export')")
|
||||
@Log(title = "用户租户密钥", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
List<TenantSecretKey> list = tenantSecretKeyService.selectTenantSecretKeyList(tenantSecretKey);
|
||||
ExcelUtil<TenantSecretKey> util = new ExcelUtil<TenantSecretKey>(TenantSecretKey.class);
|
||||
util.exportExcel(response, list, "用户租户密钥数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户租户密钥详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(tenantSecretKeyService.selectTenantSecretKeyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户租户密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:add')")
|
||||
@Log(title = "用户租户密钥", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
return toAjax(tenantSecretKeyService.insertTenantSecretKey(tenantSecretKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户租户密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:edit')")
|
||||
@Log(title = "用户租户密钥", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
return toAjax(tenantSecretKeyService.updateTenantSecretKey(tenantSecretKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户租户密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:remove')")
|
||||
@Log(title = "用户租户密钥", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(tenantSecretKeyService.deleteTenantSecretKeyByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.ff.common.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 币种对象 ff_currency
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
public class Currency extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 币种状态(0正常 1停用) */
|
||||
@Excel(name = "币种状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 币种国家 */
|
||||
@Excel(name = "币种国家")
|
||||
private String country;
|
||||
|
||||
/** 币种编码 */
|
||||
@Excel(name = "币种编码")
|
||||
private String currencyCode;
|
||||
|
||||
/** 币种符号 */
|
||||
@Excel(name = "币种符号")
|
||||
private String currencySign;
|
||||
|
||||
/** 汇率 */
|
||||
@Excel(name = "汇率")
|
||||
private BigDecimal gameRate;
|
||||
|
||||
/** 币种展示内容 */
|
||||
@Excel(name = "币种展示内容")
|
||||
private String currencyDisplay;
|
||||
|
||||
/** 币种名称 */
|
||||
@Excel(name = "币种名称")
|
||||
private String currencyName;
|
||||
|
||||
/** 币种全称 */
|
||||
@Excel(name = "币种全称")
|
||||
private String fullName;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ff.common.domain;
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 系统语种管理 对象 ff_lang
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
public class Lang extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 语言名称 */
|
||||
@Excel(name = "语言名称")
|
||||
private String name;
|
||||
|
||||
/** 国家代码 */
|
||||
@Excel(name = "国家代码")
|
||||
private String country;
|
||||
|
||||
/** 语种 */
|
||||
@Excel(name = "语种")
|
||||
private String langCode;
|
||||
|
||||
/** 语种开关 0 关闭 1 开启 */
|
||||
@Excel(name = "语种开关 0 关闭 1 开启")
|
||||
private Boolean langStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ff.common.domain;
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 用户租户密钥对象 ff_tenant_secret_key
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-11
|
||||
*/
|
||||
@Data
|
||||
public class TenantSecretKey extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 租户key */
|
||||
@Excel(name = "租户key")
|
||||
private String tenantKey;
|
||||
|
||||
/** 商户后缀 */
|
||||
@Excel(name = "商户后缀")
|
||||
private String tenantSn;
|
||||
|
||||
/** 租户密钥 */
|
||||
@Excel(name = "租户密钥")
|
||||
private String tenantSecret;
|
||||
|
||||
/** 租户状态(0正常 1停用) */
|
||||
@Excel(name = "租户状态", readConverterExp = "0=正常,1=停用")
|
||||
private String tenantStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
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);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
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);
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.ff.common.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
|
||||
/**
|
||||
* 用户租户密钥Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-11
|
||||
*/
|
||||
public interface TenantSecretKeyMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户租户密钥
|
||||
*
|
||||
* @param id 用户租户密钥主键
|
||||
* @return 用户租户密钥
|
||||
*/
|
||||
TenantSecretKey selectTenantSecretKeyById(Long id);
|
||||
|
||||
/**
|
||||
* 按租户密钥选择租户密钥
|
||||
*
|
||||
* @param tenantKey 租户密钥
|
||||
* @return {@link TenantSecretKey }
|
||||
*/
|
||||
TenantSecretKey selectTenantSecretKeyByTenantKey(String tenantKey);
|
||||
|
||||
/**
|
||||
* 查询用户租户密钥列表
|
||||
*
|
||||
* @param tenantSecretKey 用户租户密钥
|
||||
* @return 用户租户密钥集合
|
||||
*/
|
||||
List<TenantSecretKey> selectTenantSecretKeyList(TenantSecretKey tenantSecretKey);
|
||||
|
||||
/**
|
||||
* 新增用户租户密钥
|
||||
*
|
||||
* @param tenantSecretKey 用户租户密钥
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantSecretKey(TenantSecretKey tenantSecretKey);
|
||||
|
||||
/**
|
||||
* 修改用户租户密钥
|
||||
*
|
||||
* @param tenantSecretKey 用户租户密钥
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantSecretKey(TenantSecretKey tenantSecretKey);
|
||||
|
||||
/**
|
||||
* 删除用户租户密钥
|
||||
*
|
||||
* @param id 用户租户密钥主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantSecretKeyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户租户密钥
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantSecretKeyByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
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);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
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);
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.ff.common.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
|
||||
/**
|
||||
* 用户租户密钥Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-11
|
||||
*/
|
||||
public interface ITenantSecretKeyService
|
||||
{
|
||||
/**
|
||||
* 查询用户租户密钥
|
||||
*
|
||||
* @param id 用户租户密钥主键
|
||||
* @return 用户租户密钥
|
||||
*/
|
||||
TenantSecretKey selectTenantSecretKeyById(Long id);
|
||||
|
||||
/**
|
||||
* 按租户密钥选择租户密钥
|
||||
*
|
||||
* @param tenantKey 租户密钥
|
||||
* @return {@link TenantSecretKey }
|
||||
*/
|
||||
TenantSecretKey selectTenantSecretKeyByTenantKey(String tenantKey);
|
||||
|
||||
/**
|
||||
* 查询用户租户密钥列表
|
||||
*
|
||||
* @param tenantSecretKey 用户租户密钥
|
||||
* @return 用户租户密钥集合
|
||||
*/
|
||||
List<TenantSecretKey> selectTenantSecretKeyList(TenantSecretKey tenantSecretKey);
|
||||
|
||||
/**
|
||||
* 新增用户租户密钥
|
||||
*
|
||||
* @param tenantSecretKey 用户租户密钥
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantSecretKey(TenantSecretKey tenantSecretKey);
|
||||
|
||||
/**
|
||||
* 修改用户租户密钥
|
||||
*
|
||||
* @param tenantSecretKey 用户租户密钥
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantSecretKey(TenantSecretKey tenantSecretKey);
|
||||
|
||||
/**
|
||||
* 批量删除用户租户密钥
|
||||
*
|
||||
* @param ids 需要删除的用户租户密钥主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantSecretKeyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除用户租户密钥信息
|
||||
*
|
||||
* @param id 用户租户密钥主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantSecretKeyById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
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.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.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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
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.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.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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
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.TenantSecretKeyMapper;
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
import com.ff.common.service.ITenantSecretKeyService;
|
||||
|
||||
/**
|
||||
* 用户租户密钥Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-11
|
||||
*/
|
||||
@Service
|
||||
public class TenantSecretKeyServiceImpl implements ITenantSecretKeyService
|
||||
{
|
||||
@Autowired
|
||||
private TenantSecretKeyMapper tenantSecretKeyMapper;
|
||||
|
||||
/**
|
||||
* 查询用户租户密钥
|
||||
*
|
||||
* @param id 用户租户密钥主键
|
||||
* @return 用户租户密钥
|
||||
*/
|
||||
@Override
|
||||
public TenantSecretKey selectTenantSecretKeyById(Long id)
|
||||
{
|
||||
return tenantSecretKeyMapper.selectTenantSecretKeyById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按租户密钥选择租户密钥
|
||||
*
|
||||
* @param tenantKey 租户密钥
|
||||
* @return {@link TenantSecretKey }
|
||||
*/
|
||||
@Override
|
||||
public TenantSecretKey selectTenantSecretKeyByTenantKey(String tenantKey) {
|
||||
return tenantSecretKeyMapper.selectTenantSecretKeyByTenantKey(tenantKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户租户密钥列表
|
||||
*
|
||||
* @param tenantSecretKey 用户租户密钥
|
||||
* @return 用户租户密钥
|
||||
*/
|
||||
@Override
|
||||
public List<TenantSecretKey> selectTenantSecretKeyList(TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
return tenantSecretKeyMapper.selectTenantSecretKeyList(tenantSecretKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户租户密钥
|
||||
*
|
||||
* @param tenantSecretKey 用户租户密钥
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantSecretKey(TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
tenantSecretKey.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantSecretKeyMapper.insertTenantSecretKey(tenantSecretKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户租户密钥
|
||||
*
|
||||
* @param tenantSecretKey 用户租户密钥
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantSecretKey(TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
tenantSecretKey.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantSecretKeyMapper.updateTenantSecretKey(tenantSecretKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户租户密钥
|
||||
*
|
||||
* @param ids 需要删除的用户租户密钥主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantSecretKeyByIds(Long[] ids)
|
||||
{
|
||||
return tenantSecretKeyMapper.deleteTenantSecretKeyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户租户密钥信息
|
||||
*
|
||||
* @param id 用户租户密钥主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantSecretKeyById(Long id)
|
||||
{
|
||||
return tenantSecretKeyMapper.deleteTenantSecretKeyById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
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 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;
|
||||
/**
|
||||
* 项目加载时运行
|
||||
*
|
||||
* @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();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.ff.config;
|
||||
|
||||
import com.ff.common.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();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
package com.ff.config;
|
||||
|
||||
import com.ff.base.config.FFConfig;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.*;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Swagger2的接口配置
|
||||
*
|
||||
* @author ff
|
||||
*/
|
||||
@Configuration
|
||||
public class SwaggerConfig
|
||||
{
|
||||
/** 系统基础配置 */
|
||||
@Autowired
|
||||
private FFConfig ffConfig;
|
||||
|
||||
/** 是否开启swagger */
|
||||
@Value("${swagger.enabled}")
|
||||
private boolean enabled;
|
||||
|
||||
/** 设置请求的统一前缀 */
|
||||
@Value("${swagger.pathMapping}")
|
||||
private String pathMapping;
|
||||
|
||||
/**
|
||||
* 创建API
|
||||
*/
|
||||
@Bean
|
||||
public Docket createRestApi()
|
||||
{
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
// 是否启用Swagger
|
||||
.enable(enabled)
|
||||
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||
.apiInfo(apiInfo())
|
||||
// 设置哪些接口暴露给Swagger展示
|
||||
.select()
|
||||
// 扫描所有有注解的api,用这种方式更灵活
|
||||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
// 扫描指定包中的swagger注解
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.ff.project.tool.swagger"))
|
||||
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
/* 设置安全模式,swagger可以设置访问token */
|
||||
.securitySchemes(securitySchemes())
|
||||
.securityContexts(securityContexts())
|
||||
.pathMapping(pathMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全模式,这里指定token通过Authorization头请求头传递
|
||||
*/
|
||||
private List<SecurityScheme> securitySchemes()
|
||||
{
|
||||
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
|
||||
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
|
||||
return apiKeyList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全上下文
|
||||
*/
|
||||
private List<SecurityContext> securityContexts()
|
||||
{
|
||||
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||
securityContexts.add(
|
||||
SecurityContext.builder()
|
||||
.securityReferences(defaultAuth())
|
||||
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
|
||||
.build());
|
||||
return securityContexts;
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认的安全上引用
|
||||
*/
|
||||
private List<SecurityReference> defaultAuth()
|
||||
{
|
||||
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||
authorizationScopes[0] = authorizationScope;
|
||||
List<SecurityReference> securityReferences = new ArrayList<>();
|
||||
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
|
||||
return securityReferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加摘要信息
|
||||
*/
|
||||
private ApiInfo apiInfo()
|
||||
{
|
||||
// 用ApiInfoBuilder进行定制
|
||||
return new ApiInfoBuilder()
|
||||
// 设置标题
|
||||
.title("标题:FF管理系统_接口文档")
|
||||
// 描述
|
||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||
// 作者信息
|
||||
.contact(new Contact(ffConfig.getName(), null, null))
|
||||
// 版本
|
||||
.version("版本号:" + ffConfig.getVersion())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
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) ;
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
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 gamesBaseRequestDTO 游戏请求dto
|
||||
* @return {@link String }
|
||||
*/
|
||||
String getKey(GamesBaseRequestDTO gamesBaseRequestDTO);
|
||||
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @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 betRecordByTimeDTO 按时间dto投注记录
|
||||
* @return {@link List }<{@link GameBettingDetails }>
|
||||
*/
|
||||
List<GameBettingDetails> getBetRecordByTime(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 gamesDataBuildDTO 数据
|
||||
* @return {@link GameBettingDetails }
|
||||
*/
|
||||
GameBettingDetails dataBuild(GamesDataBuildDTO gamesDataBuildDTO);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.ff.game.api.jili.address;
|
||||
|
||||
import com.dtflys.forest.callback.AddressSource;
|
||||
import com.dtflys.forest.http.ForestAddress;
|
||||
import com.dtflys.forest.http.ForestRequest;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.system.service.ISysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
/**
|
||||
* 我jili address来源
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Component
|
||||
public class MyJILIAddressSource implements AddressSource {
|
||||
|
||||
@Resource
|
||||
private ISysConfigService configService;
|
||||
|
||||
|
||||
@Override
|
||||
public ForestAddress getAddress(ForestRequest request) {
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
|
||||
return new ForestAddress("https",apiBaseUrl, 443,"api1");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.ff.game.api.jili.client;
|
||||
|
||||
import com.dtflys.forest.annotation.Address;
|
||||
import com.dtflys.forest.annotation.Get;
|
||||
import com.dtflys.forest.annotation.Request;
|
||||
import com.dtflys.forest.annotation.Var;
|
||||
import com.ff.game.api.jili.address.MyJILIAddressSource;
|
||||
import com.ff.game.api.jili.dto.JILICreateMemberResponseDTO;
|
||||
import com.ff.game.api.jili.dto.JILIGamesDTO;
|
||||
import com.ff.game.api.jili.dto.JILILoginWithoutRedirectResponseDTO;
|
||||
import com.ff.game.api.jili.dto.JILIMemberInfoDTO;
|
||||
|
||||
/**
|
||||
* jili 请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Address(source = MyJILIAddressSource.class)
|
||||
public interface JILIClient {
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @param parameters 参数
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Get("/CreateMember?${parameters}")
|
||||
JILICreateMemberResponseDTO createMember(@Var("parameters") String parameters);
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param parameters 参数
|
||||
* @return {@link JILIMemberInfoDTO }
|
||||
*/
|
||||
@Get("/GetMemberInfo?${parameters}")
|
||||
JILIMemberInfoDTO getMemberInfo(@Var("parameters") String parameters);
|
||||
|
||||
/**
|
||||
* 无重定向登录
|
||||
*
|
||||
* @param parameters 参数
|
||||
* @return {@link JILILoginWithoutRedirectResponseDTO }
|
||||
*/
|
||||
@Get("/LoginWithoutRedirect?${parameters}")
|
||||
JILILoginWithoutRedirectResponseDTO loginWithoutRedirect(@Var("parameters") String parameters);
|
||||
|
||||
/**
|
||||
* 获取游戏列表
|
||||
*
|
||||
* @param parameters 参数
|
||||
* @return {@link JILIGamesDTO }
|
||||
*/
|
||||
@Get("/GetGameList?${parameters}")
|
||||
JILIGamesDTO getGameList(@Var("parameters") String parameters);
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* JiLi游戏纪录查询返回数据类型
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/21
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILIBetRecordDataResponseDTO {
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
@JsonProperty("Account")
|
||||
private String account;
|
||||
/**
|
||||
* 投注id
|
||||
*/
|
||||
@JsonProperty("WagersId")
|
||||
private long wagersId;
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
@JsonProperty("GameId")
|
||||
private int gameId;
|
||||
/**
|
||||
* 下注时间
|
||||
*/
|
||||
@JsonProperty("WagersTime")
|
||||
private Long wagersTime;
|
||||
/**
|
||||
* 投注金额
|
||||
*/
|
||||
@JsonProperty("BetAmount")
|
||||
private BigDecimal betAmount;
|
||||
/**
|
||||
* 回报时间
|
||||
*/
|
||||
@JsonProperty("PayoffTime")
|
||||
private Long payoffTime;
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@JsonProperty("PayoffAmount")
|
||||
private BigDecimal payoffAmount;
|
||||
/**
|
||||
* 注单状态 1: 赢 2: 输 3: 平局
|
||||
*/
|
||||
@JsonProperty("Status")
|
||||
private int status;
|
||||
/**
|
||||
* 结算时间
|
||||
*/
|
||||
@JsonProperty("SettlementTime")
|
||||
private Long settlementTime;
|
||||
/**
|
||||
* 游戏类别id
|
||||
*/
|
||||
@JsonProperty("GameCategoryId")
|
||||
private int gameCategoryId;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@JsonProperty("Type")
|
||||
private int type;
|
||||
/**
|
||||
* 代理id
|
||||
*/
|
||||
@JsonProperty("AgentId")
|
||||
private String agentId;
|
||||
/**
|
||||
* 有效投注金额
|
||||
*/
|
||||
@JsonProperty("Turnover")
|
||||
private BigDecimal turnover;
|
||||
/**
|
||||
* 圆形指数
|
||||
*/
|
||||
@JsonProperty("RoundIndex")
|
||||
private long roundIndex;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* JiLi游戏纪录查询返回值
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/21
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILIBetRecordResponseDTO {
|
||||
|
||||
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
@JsonProperty("Data")
|
||||
private DataBean data;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
@JsonProperty("Result")
|
||||
private List<JILIBetRecordDataResponseDTO> result;
|
||||
@JsonProperty("Pagination")
|
||||
private PaginationBean pagination;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class PaginationBean {
|
||||
/**
|
||||
* 当前页面
|
||||
*/
|
||||
@JsonProperty("CurrentPage")
|
||||
private int currentPage;
|
||||
/**
|
||||
* 总页数
|
||||
*/
|
||||
@JsonProperty("TotalPages")
|
||||
private int totalPages;
|
||||
/**
|
||||
* 页数限制
|
||||
*/
|
||||
@JsonProperty("PageLimit")
|
||||
private int pageLimit;
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
@JsonProperty("TotalNumber")
|
||||
private int totalNumber;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* jilicancel自由自旋响应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/11
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILICancelFreeSpinResponseDTO {
|
||||
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
@JsonProperty("CancelTime")
|
||||
private int cancelTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* jilicreate自由旋转响应dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/11
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILICreateFreeSpinResponseDTO {
|
||||
/**
|
||||
* 错误代码
|
||||
*/
|
||||
@JsonProperty("ErrorCode")
|
||||
private Integer errorCode;
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
/**
|
||||
* 创造时间
|
||||
*/
|
||||
@JsonProperty("CreateTime")
|
||||
private Integer createTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.ff.game.api.request.GamesBaseRequestDTO;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 创建成员响应dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
public class JILICreateMemberResponseDTO extends GamesBaseRequestDTO {
|
||||
|
||||
/**
|
||||
* 错误代码
|
||||
*/
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* jiliexchange货币回应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
public class JILIExchangeMoneyResponseDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 错误代码
|
||||
*/
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
|
||||
|
||||
|
||||
@JsonProperty("Data")
|
||||
private BeanData data;
|
||||
|
||||
@Data
|
||||
public class BeanData{
|
||||
/**
|
||||
* 交易序号,额度转移纪录唯一值, 长度上限 50
|
||||
*/
|
||||
@JsonProperty("TransactionId")
|
||||
private String transactionId;
|
||||
/**
|
||||
* 转账前金额(游戏币)
|
||||
*/
|
||||
@JsonProperty("CoinBefore")
|
||||
private BigDecimal coinBefore;
|
||||
/**
|
||||
* 转账后金额(游戏币)
|
||||
*/
|
||||
@JsonProperty("CoinAfter")
|
||||
private BigDecimal coinAfter;
|
||||
/**
|
||||
* 转账前金额(指定货币)
|
||||
*/
|
||||
@JsonProperty("CurrencyBefore")
|
||||
private BigDecimal currencyBefore;
|
||||
/**
|
||||
* 转账后金额(指定货币)
|
||||
*/
|
||||
@JsonProperty("CurrencyAfter")
|
||||
private BigDecimal currencyAfter;
|
||||
/**
|
||||
* 状态:
|
||||
* 1: 成功
|
||||
* 2: 失败
|
||||
*/
|
||||
@JsonProperty("Status")
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 游戏
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILIGamesDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 错误代码
|
||||
*/
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
@JsonProperty("Data")
|
||||
private List<JILIGamesDataDTO> data;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* jiligames数据dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILIGamesDataDTO {
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
@JsonProperty("GameId")
|
||||
private int gameId;
|
||||
|
||||
/**
|
||||
*自己系统游戏id
|
||||
*/
|
||||
private Long systemGameId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private NameBean name;
|
||||
/**
|
||||
* 游戏类别id
|
||||
*/
|
||||
@JsonProperty("GameCategoryId")
|
||||
private int gameCategoryId;
|
||||
/**
|
||||
* jp
|
||||
*/
|
||||
@JsonProperty("JP")
|
||||
private boolean jP;
|
||||
/**
|
||||
* freespin
|
||||
*/
|
||||
@JsonProperty("Freespin")
|
||||
private boolean freespin;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class NameBean {
|
||||
/**
|
||||
* en-us
|
||||
*/
|
||||
@JsonProperty("en-US")
|
||||
private String enUS;
|
||||
/**
|
||||
* zh cn
|
||||
*/
|
||||
@JsonProperty("zh-CN")
|
||||
private String zhCN;
|
||||
/**
|
||||
* zh-tw
|
||||
*/
|
||||
@JsonProperty("zh-TW")
|
||||
private String zhTW;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* jiliget自由旋转气流响应dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/11
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILIGetFreeSpinDashflowResponseDTO {
|
||||
/** 错误码 */
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
|
||||
/** 错误信息 */
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
|
||||
/** 数据列表 */
|
||||
@JsonProperty("Data")
|
||||
private List<DataBean> data;
|
||||
|
||||
/**
|
||||
* 内部类 DataBean
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
|
||||
/** 用户账号 */
|
||||
@JsonProperty("Account")
|
||||
private String account;
|
||||
|
||||
/** 参考ID */
|
||||
@JsonProperty("ReferenceID")
|
||||
private String referenceID;
|
||||
|
||||
/** 发送时间 */
|
||||
@JsonProperty("SendTime")
|
||||
private Long sendTime;
|
||||
|
||||
/** 过期时间 */
|
||||
@JsonProperty("ExpiredTime")
|
||||
private Long expiredTime;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonProperty("UpdateTime")
|
||||
private Long updateTime;
|
||||
|
||||
/** 发送金额 */
|
||||
@JsonProperty("SendAmount")
|
||||
private int sendAmount;
|
||||
|
||||
/** 已使用金额 */
|
||||
@JsonProperty("UsedAmount")
|
||||
private int usedAmount;
|
||||
|
||||
/** 未使用金额 */
|
||||
@JsonProperty("UnusedAmount")
|
||||
private int unusedAmount;
|
||||
|
||||
/** 可领取的游戏 */
|
||||
@JsonProperty("ClaimGame")
|
||||
private int claimGame;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 获取游戏详细信息请求dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/12
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILIGetGameDetailResponseDTO {
|
||||
|
||||
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
@JsonProperty("Data")
|
||||
private DataBean data;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
@JsonProperty("Url")
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* jilikick会员全部dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/12
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILIKickMemberAllDTO {
|
||||
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILIKickMemberDTO {
|
||||
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 登录时不重定向响应dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILILoginWithoutRedirectResponseDTO {
|
||||
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
@JsonProperty("Data")
|
||||
private String data;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ff.game.api.jili.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员信息dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/30
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class JILIMemberInfoDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 错误代码
|
||||
*/
|
||||
@JsonProperty("ErrorCode")
|
||||
private int errorCode;
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
@JsonProperty("Message")
|
||||
private String message;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
@JsonProperty("Data")
|
||||
private List<DataBean> data;
|
||||
|
||||
/**
|
||||
* 数据bean
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/30
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
@JsonProperty("Account")
|
||||
private String account;
|
||||
/**
|
||||
* 平衡
|
||||
*/
|
||||
@JsonProperty("Balance")
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 地位
|
||||
*/
|
||||
@JsonProperty("Status")
|
||||
private Integer status;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,763 @@
|
|||
package com.ff.game.api.jili.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ff.base.constant.CacheConstants;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.redis.RedisCache;
|
||||
import com.ff.base.enums.FreeStatus;
|
||||
import com.ff.base.enums.GamePlatforms;
|
||||
import com.ff.base.enums.GameStatus;
|
||||
import com.ff.base.enums.JILIGameType;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.system.service.ISysConfigService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.JsonUtil;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import com.ff.base.utils.http.HttpClientSslUtils;
|
||||
import com.ff.base.utils.http.HttpUtils;
|
||||
import com.ff.base.utils.sign.Md5Utils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.ff.game.api.IGamesService;
|
||||
import com.ff.game.api.jili.client.JILIClient;
|
||||
import com.ff.game.api.jili.dto.*;
|
||||
import com.ff.game.api.request.*;
|
||||
import com.ff.game.domain.*;
|
||||
import com.ff.game.service.*;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏数据解析服务
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/21
|
||||
*/
|
||||
@Service("JILIService")
|
||||
@Slf4j
|
||||
public class GamesJILIServiceImpl implements IGamesService {
|
||||
|
||||
|
||||
@Resource
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Resource
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Resource
|
||||
private IGameExchangeMoneyService gameExchangeMoneyService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IGamePlatformService gamePlatformService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IGameService gameService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IMemberService memberService;
|
||||
|
||||
@Resource
|
||||
private IGameFreeRecordService gameFreeRecordService;
|
||||
|
||||
@Resource
|
||||
private IGameSecretKeyService gameSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private JILIClient jiliClient;
|
||||
|
||||
/**
|
||||
* 获得就是成功
|
||||
*
|
||||
* @param errorCode 错误代码
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
private Boolean getIsSuccess(Integer errorCode) {
|
||||
return 0 == errorCode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取密钥
|
||||
*
|
||||
* @param gamesBaseRequestDTO 游戏请求dto
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Override
|
||||
public String getKey(GamesBaseRequestDTO gamesBaseRequestDTO) {
|
||||
Random random = new Random();
|
||||
//取出对应的key跟密钥跟请求参数
|
||||
String agentKey = gamesBaseRequestDTO.getAgentKey();
|
||||
String agentId = gamesBaseRequestDTO.getAgentId();
|
||||
String query = gamesBaseRequestDTO.getQuery();
|
||||
|
||||
String now = DateUtils.getFormattedDate();
|
||||
String keyG = Md5Utils.md5New(now + agentId + agentKey);
|
||||
|
||||
String md5string = Md5Utils.md5New(query + keyG);
|
||||
Integer randomText1 = 100000 + random.nextInt(900000);
|
||||
Integer randomText2 = 100000 + random.nextInt(900000);
|
||||
String key = randomText1 + md5string + randomText2;
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @param createMemberRequestDTO 创建成员请求dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean createMember(CreateMemberRequestDTO createMemberRequestDTO) {
|
||||
String query = "Account=" + createMemberRequestDTO.getAccount() + "&AgentId=" + createMemberRequestDTO.getAgentId();
|
||||
log.info("GamesJILIServiceImpl [createMember] 请求参数 {}", query);
|
||||
createMemberRequestDTO.setQuery(query);
|
||||
String key = this.getKey(createMemberRequestDTO);
|
||||
JILICreateMemberResponseDTO createMemberResponseDTO = jiliClient.createMember(query + "&Key=" + key);
|
||||
Boolean isSuccess = this.getIsSuccess(createMemberResponseDTO.getErrorCode());
|
||||
if (!isSuccess) {
|
||||
throw new BaseException(createMemberResponseDTO.getMessage());
|
||||
}
|
||||
//判断是否获取成功
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param memberInfoRequestDTO 会员信息请求dto
|
||||
* @return {@link MemberInfoResponseDTO }
|
||||
*/
|
||||
@Override
|
||||
public MemberInfoResponseDTO getMemberInfo(MemberInfoRequestDTO memberInfoRequestDTO) {
|
||||
String query = "Accounts=" + memberInfoRequestDTO.getAccounts() + "&AgentId=" + memberInfoRequestDTO.getAgentId();
|
||||
log.info("GamesJILIServiceImpl [getMemberInfo] 请求参数 {}", query);
|
||||
memberInfoRequestDTO.setQuery(query);
|
||||
String key = this.getKey(memberInfoRequestDTO);
|
||||
JILIMemberInfoDTO jiliMemberInfoDTO = jiliClient.getMemberInfo(query + "&Key=" + key);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(jiliMemberInfoDTO.getErrorCode())) {
|
||||
List<MemberInfoResponseDTO> memberInfoResponseDTOS = new ArrayList<>();
|
||||
jiliMemberInfoDTO.getData().forEach(e -> {
|
||||
memberInfoResponseDTOS.add(MemberInfoResponseDTO.builder()
|
||||
.status(e.getStatus())
|
||||
.balance(e.getBalance())
|
||||
.account(e.getAccount())
|
||||
.build());
|
||||
});
|
||||
return memberInfoResponseDTOS.get(0);
|
||||
} else {
|
||||
throw new BaseException(jiliMemberInfoDTO.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 无重定向登录
|
||||
*
|
||||
* @param gamesLogin 游戏登录
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Override
|
||||
public String loginWithoutRedirect(GamesLogin gamesLogin) {
|
||||
String query = "Account=" + gamesLogin.getAccount() + "&GameId=" + gamesLogin.getGameId() + "&Lang=" + gamesLogin.getLang() + "&AgentId=" + gamesLogin.getAgentId();
|
||||
log.info("GamesJILIServiceImpl [loginWithoutRedirect] 请求参数 {}", query);
|
||||
gamesLogin.setQuery(query);
|
||||
String key = this.getKey(gamesLogin);
|
||||
|
||||
// if (!StringUtils.isEmpty(gamesLogin.getHomeUrl())) {
|
||||
// query += "&HomeUrl=" + gamesLogin.getHomeUrl();
|
||||
// }
|
||||
if (!StringUtils.isEmpty(gamesLogin.getPlatform())) {
|
||||
query += "&platform=" + gamesLogin.getPlatform();
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(gamesLogin.getDisableFullScreen())) {
|
||||
query += "&disableFullScreen=" + gamesLogin.getDisableFullScreen();
|
||||
}
|
||||
|
||||
JILILoginWithoutRedirectResponseDTO loginWithoutRedirectResponseDTO = jiliClient.loginWithoutRedirect(query + "&AgentId=" + gamesLogin.getAgentId() + "&Key=" + key);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(loginWithoutRedirectResponseDTO.getErrorCode())) {
|
||||
return loginWithoutRedirectResponseDTO.getData();
|
||||
} else {
|
||||
throw new BaseException(loginWithoutRedirectResponseDTO.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取游戏列表
|
||||
*
|
||||
* @param gamesBaseRequestDTO 游戏请求dto
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public String getGameList(GamesBaseRequestDTO gamesBaseRequestDTO) {
|
||||
|
||||
List<JILIGamesDataDTO> gamesDatas = redisCache.getCacheList(CacheConstants.JILI_GAMES);
|
||||
if (!CollectionUtils.isEmpty(gamesDatas)) {
|
||||
return CacheConstants.JILI_GAMES;
|
||||
}
|
||||
|
||||
|
||||
gamesBaseRequestDTO.setQuery("AgentId=" + gamesBaseRequestDTO.getAgentId());
|
||||
String key = this.getKey(gamesBaseRequestDTO);
|
||||
JILIGamesDTO jiliGames = jiliClient.getGameList("AgentId=" + gamesBaseRequestDTO.getAgentId() + "&Key=" + key);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(jiliGames.getErrorCode())) {
|
||||
|
||||
for (JILIGamesDataDTO gamesDataDTO : jiliGames.getData()) {
|
||||
if (JILIGameType.GAME_HALL.getCode().equals(gamesDataDTO.getGameCategoryId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
GamePlatform gamePlatform = GamePlatform.builder()
|
||||
.platformType(JILIGameType.findSystemByCode(gamesDataDTO.getGameCategoryId()))
|
||||
.platformCode(GamePlatforms.JILI.getCode())
|
||||
.build();
|
||||
List<GamePlatform> gamePlatforms = gamePlatformService.selectGamePlatformList(gamePlatform);
|
||||
//没有此平台就新增一个平台
|
||||
if (CollectionUtils.isEmpty(gamePlatforms)) {
|
||||
gamePlatform.setPlatformName(GamePlatforms.JILI.getInfo() + JILIGameType.findInfoByCode(gamesDataDTO.getGameCategoryId()));
|
||||
gamePlatform.setSortNo(gamePlatformService.selectMaxSortNo() + 1);
|
||||
gamePlatform.setCreateBy(Constants.SYSTEM);
|
||||
gamePlatformService.insertGamePlatform(gamePlatform);
|
||||
} else {
|
||||
gamePlatform = gamePlatforms.get(0);
|
||||
}
|
||||
Game game = Game.builder()
|
||||
.platformId(gamePlatform.getId())
|
||||
.gameCode(gamesDataDTO.getGameId())
|
||||
.build();
|
||||
List<Game> games = gameService.selectGameList(game);
|
||||
//不存在这个游戏
|
||||
if (CollectionUtils.isEmpty(games)) {
|
||||
game.setFreespin(gamesDataDTO.isFreespin());
|
||||
game.setSortNo(gameService.selectMaxSortNoByPlatformId(gamePlatform.getId()) + 1);
|
||||
game.setGameName(gamesDataDTO.getName().getZhCN());
|
||||
game.setCreateBy(Constants.SYSTEM);
|
||||
gameService.insertGame(game);
|
||||
} else {
|
||||
game = games.get(0);
|
||||
}
|
||||
gamesDataDTO.setSystemGameId(game.getId());
|
||||
|
||||
|
||||
}
|
||||
|
||||
redisCache.deleteObject(CacheConstants.JILI_GAMES);
|
||||
redisCache.setCacheList(CacheConstants.JILI_GAMES, jiliGames.getData());
|
||||
redisCache.expire(CacheConstants.JILI_GAMES, 5L, TimeUnit.HOURS);
|
||||
} else {
|
||||
log.error("GameBettingDataJILIServiceImpl [getGameList] 获取游戏列表失败,错误代码{},错误信息{}", jiliGames.getErrorCode(), jiliGames.getMessage());
|
||||
throw new BaseException(MessageUtils.message("game.list.retrieve.failed"));
|
||||
|
||||
}
|
||||
|
||||
return CacheConstants.JILI_GAMES;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按代理id进行交换转账
|
||||
*
|
||||
* @param exchangeTransferMoneyRequestDTO 外汇转账moeny dto
|
||||
* @return {@link Long }
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Long exchangeTransferByAgentId(ExchangeTransferMoneyRequestDTO exchangeTransferMoneyRequestDTO) {
|
||||
String systemByCode = gameSecretKeyService.findSystemByCode(exchangeTransferMoneyRequestDTO.getAgentId(), GamePlatforms.JILI.getInfo());
|
||||
Member member = memberService.selectMemberByMemberAccount(exchangeTransferMoneyRequestDTO.getAccount());
|
||||
String transactionId = exchangeTransferMoneyRequestDTO.getTransactionId();
|
||||
//如果没有自定义单号
|
||||
if (!StringUtils.hasText(exchangeTransferMoneyRequestDTO.getTransactionId())) {
|
||||
transactionId = GamePlatforms.JILI.getCode() + IdUtils.simpleUUID();
|
||||
}
|
||||
|
||||
//获取下一个自增id
|
||||
GameExchangeMoney exchangeMoney = GameExchangeMoney
|
||||
.builder()
|
||||
.quota(exchangeTransferMoneyRequestDTO.getQuota())
|
||||
.platformId(exchangeTransferMoneyRequestDTO.getPlatformId())
|
||||
.balance(exchangeTransferMoneyRequestDTO.getAmount())
|
||||
.exchangeType(exchangeTransferMoneyRequestDTO.getTransferType())
|
||||
.currencyCode(systemByCode)
|
||||
.memberId(member.getId())
|
||||
.platformCode(GamePlatforms.JILI.getCode())
|
||||
.build();
|
||||
exchangeMoney.setCreateBy(Constants.SYSTEM);
|
||||
//接口限制限制50字符
|
||||
exchangeMoney.setTransactionId(transactionId);
|
||||
String query = "Account=" + exchangeTransferMoneyRequestDTO.getAccount()
|
||||
+ "&TransactionId=" + exchangeMoney.getTransactionId()
|
||||
+ "&Amount=" + exchangeTransferMoneyRequestDTO.getAmount()
|
||||
+ "&TransferType=" + exchangeTransferMoneyRequestDTO.getTransferType()
|
||||
+ "&AgentId=" + exchangeTransferMoneyRequestDTO.getAgentId();
|
||||
log.info("GamesJILIServiceImpl [exchangeTransferByAgentId] 请求参数 {}", query);
|
||||
exchangeTransferMoneyRequestDTO.setQuery(query);
|
||||
|
||||
String key = this.getKey(exchangeTransferMoneyRequestDTO);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
|
||||
try {
|
||||
String result = HttpClientSslUtils.doPost(apiBaseUrl + "/ExchangeTransferByAgentId?" + query + "&Key=" + key, "AgentId=" + exchangeTransferMoneyRequestDTO.getAgentId(), ContentType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
JILIExchangeMoneyResponseDTO exchangeMoneyResponse = JsonUtil.stringToObj(result, JILIExchangeMoneyResponseDTO.class);
|
||||
//判断是否转移成功
|
||||
if (this.getIsSuccess(exchangeMoneyResponse.getErrorCode())) {
|
||||
JILIExchangeMoneyResponseDTO.BeanData exchangeMoneyResponseData = exchangeMoneyResponse.getData();
|
||||
//更新数据
|
||||
exchangeMoney.setBalance(NumberUtil.sub(exchangeMoneyResponseData.getCurrencyAfter(), exchangeMoneyResponseData.getCurrencyBefore()).abs());
|
||||
exchangeMoney.setCoinBefore(exchangeMoneyResponseData.getCoinBefore());
|
||||
exchangeMoney.setCoinAfter(exchangeMoneyResponseData.getCoinAfter());
|
||||
exchangeMoney.setCurrencyBefore(exchangeMoneyResponseData.getCurrencyBefore());
|
||||
exchangeMoney.setCurrencyAfter(exchangeMoneyResponseData.getCurrencyAfter());
|
||||
exchangeMoney.setStatus(exchangeMoneyResponseData.getStatus());
|
||||
gameExchangeMoneyService.insertGameExchangeMoney(exchangeMoney);
|
||||
} else {
|
||||
log.error("GameBettingDataJILIServiceImpl [exchangeTransferByAgentId] 金额转移失败,错误代码{},错误信息{}", exchangeMoneyResponse.getErrorCode(), exchangeMoneyResponse.getMessage());
|
||||
throw new BaseException(MessageUtils.message("game.account.balance.transfer.failed"));
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GameBettingDataJILIServiceImpl [exchangeTransferByAgentId] 金额转移失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.account.balance.transfer.failed"));
|
||||
|
||||
}
|
||||
|
||||
return exchangeMoney.getId();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 按时间获取投注记录
|
||||
*
|
||||
* @param betRecordByTimeDTO 按时间dto投注记录
|
||||
* @return {@link List }<{@link GameBettingDetails }>
|
||||
*/
|
||||
@Override
|
||||
public List<GameBettingDetails> getBetRecordByTime(BetRecordByTimeDTO betRecordByTimeDTO) {
|
||||
String startTime = DateUtils.formatDateToGMT4(new Date(betRecordByTimeDTO.getStartTime()));
|
||||
String endTime = DateUtils.formatDateToGMT4(new Date(betRecordByTimeDTO.getEndTime()));
|
||||
List<GameBettingDetails> gameBettingDetails = new ArrayList<>();
|
||||
//请求参数
|
||||
String query = "StartTime=" + startTime + "&EndTime=" + endTime + "&Page=" + betRecordByTimeDTO.getPage() + "&PageLimit=" + betRecordByTimeDTO.getPageLimit() + "&AgentId=" + betRecordByTimeDTO.getAgentId();
|
||||
log.info("GamesJILIServiceImpl [getBetRecordByTime] 请求参数 {}", query);
|
||||
betRecordByTimeDTO.setQuery(query);
|
||||
//获取key
|
||||
String key = this.getKey(betRecordByTimeDTO);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
|
||||
String result = null;
|
||||
try {
|
||||
result = HttpClientSslUtils.doPost(apiBaseUrl + "/GetBetRecordByTime?" + query + "&Key=" + key, "AgentId=" + betRecordByTimeDTO.getAgentId(), ContentType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
JILIBetRecordResponseDTO betRecordJILIResponse = JSON.parseObject(result, JILIBetRecordResponseDTO.class);
|
||||
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(betRecordJILIResponse.getErrorCode())) {
|
||||
//数据组装
|
||||
JILIBetRecordResponseDTO.DataBean dataBean = betRecordJILIResponse.getData();
|
||||
for (JILIBetRecordDataResponseDTO jiliBetRecordDataResponseDTO : dataBean.getResult()) {
|
||||
GameBettingDetails bettingDetails = this.dataBuild(GamesDataBuildDTO.builder().data(jiliBetRecordDataResponseDTO).gamesKey(key).build());
|
||||
if (!ObjectUtils.isEmpty(bettingDetails)) {
|
||||
gameBettingDetails.add(bettingDetails);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//获取下一页数据
|
||||
while (dataBean.getPagination().getCurrentPage() != dataBean.getPagination().getTotalPages() && dataBean.getPagination().getTotalPages() > 0) {
|
||||
betRecordByTimeDTO.setPage(dataBean.getPagination().getCurrentPage() + 1);
|
||||
//请求参数
|
||||
query = "StartTime=" + startTime + "&EndTime=" + endTime + "&Page=" + betRecordByTimeDTO.getPage() + "&PageLimit=" + betRecordByTimeDTO.getPageLimit() + "&AgentId=" + betRecordByTimeDTO.getAgentId();
|
||||
log.info("GamesJILIServiceImpl [getBetRecordByTime] 请求参数 {}", query);
|
||||
betRecordByTimeDTO.setQuery(query);
|
||||
key = this.getKey(betRecordByTimeDTO);
|
||||
result = HttpUtils.sendPost(apiBaseUrl + "/GetBetRecordByTime?" + query + "&Key=" + key, "");
|
||||
betRecordJILIResponse = JsonUtil.stringToObj(result, JILIBetRecordResponseDTO.class);
|
||||
dataBean = betRecordJILIResponse.getData();
|
||||
for (JILIBetRecordDataResponseDTO jiliBetRecordDataResponseDTO : dataBean.getResult()) {
|
||||
GameBettingDetails bettingDetails = this.dataBuild(GamesDataBuildDTO.builder().data(jiliBetRecordDataResponseDTO).gamesKey(key).build());
|
||||
if (!ObjectUtils.isEmpty(bettingDetails)) {
|
||||
gameBettingDetails.add(bettingDetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return gameBettingDetails;
|
||||
} else {
|
||||
log.error("GameBettingDataJILIServiceImpl [getBetRecordByTime] 获取投注记录失败,错误代码{},错误信息{}", betRecordJILIResponse.getErrorCode(), betRecordJILIResponse.getMessage());
|
||||
throw new BaseException(MessageUtils.message("game.bet.record.retrieve.failed"));
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GameBettingDataJILIServiceImpl [getBetRecordByTime] 获取投注记录失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.bet.record.retrieve.failed"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送免费局数
|
||||
*
|
||||
* @param createFreeSpinRequest 创建自由旋转请求
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean createFreeSpin(CreateFreeSpinRequestDTO createFreeSpinRequest) {
|
||||
|
||||
String freeSpinValidity = DateUtils.formatDateToGMT4(new Date(createFreeSpinRequest.getFreeSpinValidity()));
|
||||
|
||||
|
||||
List<Long> gameIds = createFreeSpinRequest.getGameIds();
|
||||
GameUniqueDTO gameUniqueDTO = new GameUniqueDTO();
|
||||
gameUniqueDTO.setGameIds(gameIds);
|
||||
List<Game> gameList = gameService.selectGameUniqueList(gameUniqueDTO);
|
||||
String gameCodes = gameList.stream()
|
||||
.map(Game::getGameCode)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
String referenceId = GamePlatforms.JILI.getCode() + IdUtils.simpleUUID();
|
||||
//请求参数
|
||||
String query = "Account=" + createFreeSpinRequest.getAccount()
|
||||
+ "&Currency=" + createFreeSpinRequest.getCurrency()
|
||||
+ "&ReferenceId=" + referenceId
|
||||
+ "&FreeSpinValidity=" + freeSpinValidity
|
||||
+ "&NumberOfRounds=" + createFreeSpinRequest.getNumberOfRounds()
|
||||
+ "&GameIds=" + gameCodes;
|
||||
//判断是否有免费游戏局数可使用的开始时间
|
||||
if (!ObjectUtils.isEmpty(createFreeSpinRequest.getStartTime())) {
|
||||
String startTime = DateUtils.formatDateToGMT4(new Date(createFreeSpinRequest.getStartTime()));
|
||||
query += "&StartTime=" + startTime;
|
||||
}
|
||||
query += "&AgentId=" + createFreeSpinRequest.getAgentId();
|
||||
;
|
||||
log.info("GamesJILIServiceImpl [createFreeSpin] 请求参数 {}", query);
|
||||
createFreeSpinRequest.setQuery(query);
|
||||
//获取key
|
||||
String key = this.getKey(createFreeSpinRequest);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
|
||||
String result = null;
|
||||
try {
|
||||
result = HttpClientSslUtils.doPost(apiBaseUrl + "/CreateFreeSpin?" + query + "&Key=" + key, "AgentId=" + createFreeSpinRequest.getAgentId(), ContentType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
JILICreateFreeSpinResponseDTO createFreeSpinResponseDTO = JSON.parseObject(result, JILICreateFreeSpinResponseDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(createFreeSpinResponseDTO.getErrorCode())) {
|
||||
Member member = memberService.selectMemberByMemberAccount(createFreeSpinRequest.getAccount());
|
||||
if (ObjectUtils.isEmpty(member)) {
|
||||
member = new Member();
|
||||
}
|
||||
for (Game game : gameList) {
|
||||
GameFreeRecord gameFreeRecord = GameFreeRecord.builder()
|
||||
.currencyCode(gameSecretKeyService.findSystemByCode(createFreeSpinRequest.getAgentId(), GamePlatforms.JILI.getInfo()))
|
||||
.referenceId(referenceId)
|
||||
.memberId(member.getId())
|
||||
.memberAccount(createFreeSpinRequest.getAccount())
|
||||
.gameId(game.getId())
|
||||
.sendTime(createFreeSpinRequest.getStartTime())
|
||||
.expiredTime(createFreeSpinRequest.getFreeSpinValidity())
|
||||
.freeUpdateTime(DateUtils.getNowDate())
|
||||
.sendGame(game.getGameName())
|
||||
.sendAmount(createFreeSpinRequest.getNumberOfRounds())
|
||||
.unusedAmount(createFreeSpinRequest.getNumberOfRounds())
|
||||
.build();
|
||||
gameFreeRecord.setCreateBy(Constants.SYSTEM);
|
||||
gameFreeRecordService.insertGameFreeRecord(gameFreeRecord);
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
} else {
|
||||
log.error("GameBettingDataJILIServiceImpl [createFreeSpin] 赠送免费局数,错误代码{},错误信息{}", createFreeSpinResponseDTO.getErrorCode(), createFreeSpinResponseDTO.getMessage());
|
||||
throw new BaseException(createFreeSpinResponseDTO.getMessage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GameBettingDataJILIServiceImpl [createFreeSpin] 赠送免费局数,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.free.round.gift.failed"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取游戏详细信息
|
||||
*
|
||||
* @param getGameDetailRequestDTO 获取游戏详细信息请求dto
|
||||
* @return {@link GetGameDetailResponseDTO }
|
||||
*/
|
||||
@Override
|
||||
public GetGameDetailResponseDTO getGameDetail(GetGameDetailRequestDTO getGameDetailRequestDTO) {
|
||||
String query = "WagersId=" + getGameDetailRequestDTO.getWagersId();
|
||||
|
||||
getGameDetailRequestDTO.setQuery(query + "&AgentId=" + getGameDetailRequestDTO.getAgentId());
|
||||
String key = this.getKey(getGameDetailRequestDTO);
|
||||
if (StringUtils.hasText(getGameDetailRequestDTO.getLang())) {
|
||||
query += "&Lang=" + getGameDetailRequestDTO.getLang();
|
||||
}
|
||||
getGameDetailRequestDTO.setQuery(query);
|
||||
log.info("GamesJILIServiceImpl [getGameDetail] 请求参数 {}", query);
|
||||
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
|
||||
try {
|
||||
|
||||
String result = HttpClientSslUtils.doGet(apiBaseUrl + "/GetGameDetailUrl?" + query + "&AgentId=" + getGameDetailRequestDTO.getAgentId() + "&Key=" + key);
|
||||
JILIGetGameDetailResponseDTO jiliGetGameDetailResponseDTO = JsonUtil.stringToObj(result, JILIGetGameDetailResponseDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(jiliGetGameDetailResponseDTO.getErrorCode())) {
|
||||
GetGameDetailResponseDTO getGameDetailResponseDTO = new GetGameDetailResponseDTO();
|
||||
getGameDetailResponseDTO.setUrl(jiliGetGameDetailResponseDTO.getData().getUrl());
|
||||
return getGameDetailResponseDTO;
|
||||
} else {
|
||||
log.error("GameBettingDataJILIServiceImpl [getGameDetail] 获取游戏游玩详情失败,错误代码{},错误信息{}", jiliGetGameDetailResponseDTO.getErrorCode(), jiliGetGameDetailResponseDTO.getMessage());
|
||||
throw new BaseException(MessageUtils.message("game.play.details.retrieve.failed"));
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GameBettingDataJILIServiceImpl [getGameDetail] 获取游戏游玩详情失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.play.details.retrieve.failed"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 强制会员从游戏注销
|
||||
*
|
||||
* @param kickMemberRequestDTO 踢会员请求dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean kickMember(KickMemberRequestDTO kickMemberRequestDTO) {
|
||||
String query = "Account=" + kickMemberRequestDTO.getAccount();
|
||||
|
||||
kickMemberRequestDTO.setQuery(query + "&AgentId=" + kickMemberRequestDTO.getAgentId());
|
||||
String key = this.getKey(kickMemberRequestDTO);
|
||||
log.info("GamesJILIServiceImpl [kickMember] 请求参数 {}", query);
|
||||
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
|
||||
try {
|
||||
|
||||
String result = HttpClientSslUtils.doGet(apiBaseUrl + "/KickMember?" + query + "&AgentId=" + kickMemberRequestDTO.getAgentId() + "&Key=" + key);
|
||||
JILIKickMemberDTO jiliKickMemberDTO = JsonUtil.stringToObj(result, JILIKickMemberDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(jiliKickMemberDTO.getErrorCode())) {
|
||||
return Boolean.TRUE;
|
||||
} else {
|
||||
log.error("GameBettingDataJILIServiceImpl [kickMember] 强制会员从游戏注销失败,错误代码{},错误信息{}", jiliKickMemberDTO.getErrorCode(), jiliKickMemberDTO.getMessage());
|
||||
throw new BaseException(MessageUtils.message("game.member.force.logout.failed"));
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GameBettingDataJILIServiceImpl [kickMember] 强制会员从游戏注销失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.member.force.logout.failed"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 踢成员全部
|
||||
*
|
||||
* @param kickMemberAllDTO 踢成员全部dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean kickMemberAll(KickMemberAllDTO kickMemberAllDTO) {
|
||||
String query = "AgentId=" + kickMemberAllDTO.getAgentId();
|
||||
if (!ObjectUtils.isEmpty(kickMemberAllDTO.getGameId())) {
|
||||
query = "GameId=" + kickMemberAllDTO.getGameId() + "&" + query;
|
||||
}
|
||||
|
||||
|
||||
kickMemberAllDTO.setQuery(query);
|
||||
String key = this.getKey(kickMemberAllDTO);
|
||||
log.info("GamesJILIServiceImpl [kickMemberAll] 请求参数 {}", query);
|
||||
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
|
||||
try {
|
||||
|
||||
String result = HttpClientSslUtils.doGet(apiBaseUrl + "/KickMemberAll?" + query + "&Key=" + key);
|
||||
JILIKickMemberAllDTO jiliKickMemberAllDTO = JsonUtil.stringToObj(result, JILIKickMemberAllDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(jiliKickMemberAllDTO.getErrorCode())) {
|
||||
return Boolean.TRUE;
|
||||
} else {
|
||||
log.error("GameBettingDataJILIServiceImpl [kickMemberAll] 强制全部会员从游戏注销失败,错误代码{},错误信息{}", jiliKickMemberAllDTO.getErrorCode(), jiliKickMemberAllDTO.getMessage());
|
||||
throw new BaseException(MessageUtils.message("game.members.force.logout.failed"));
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GameBettingDataJILIServiceImpl [kickMemberAll] 强制全部会员从游戏注销失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.members.force.logout.failed"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 免费游戏玩家使用的纪录
|
||||
*
|
||||
* @param getFreeSpinDashflowRequestDTO 获取自由旋转dashflow请求dto
|
||||
* @return {@link List }<{@link GameFreeRecord }>
|
||||
*/
|
||||
@Override
|
||||
public List<GameFreeRecord> getFreeSpinDashflow(GetFreeSpinDashflowRequestDTO getFreeSpinDashflowRequestDTO) {
|
||||
List<GameFreeRecord> gameFreeRecordsResult = new ArrayList<>();
|
||||
//请求参数
|
||||
String query = "UpdateTime=" + DateUtils.formatDateToGMT4(new Date(getFreeSpinDashflowRequestDTO.getStartTime()))
|
||||
+ "&AgentId=" + getFreeSpinDashflowRequestDTO.getAgentId();
|
||||
|
||||
log.info("GamesJILIServiceImpl [getFreeSpinDashflow] 请求参数 {}", query);
|
||||
getFreeSpinDashflowRequestDTO.setQuery(query);
|
||||
//获取key
|
||||
String key = this.getKey(getFreeSpinDashflowRequestDTO);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
|
||||
String result = null;
|
||||
try {
|
||||
result = HttpClientSslUtils.doPost(apiBaseUrl + "/GetFreeSpinDashflow?" + query + "&Key=" + key, "AgentId=" + getFreeSpinDashflowRequestDTO.getAgentId(), ContentType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
JILIGetFreeSpinDashflowResponseDTO getFreeSpinDashflowResponseDTO = JSON.parseObject(result, JILIGetFreeSpinDashflowResponseDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(getFreeSpinDashflowResponseDTO.getErrorCode())) {
|
||||
for (JILIGetFreeSpinDashflowResponseDTO.DataBean data : getFreeSpinDashflowResponseDTO.getData()) {
|
||||
List<GameFreeRecord> gameFreeRecords = gameFreeRecordService.selectGameFreeRecordList(GameFreeRecord.builder()
|
||||
.referenceId(data.getReferenceID())
|
||||
.build());
|
||||
for (GameFreeRecord gameFreeRecord : gameFreeRecords) {
|
||||
gameFreeRecord.setSendTime(data.getSendTime());
|
||||
gameFreeRecord.setExpiredTime(data.getExpiredTime());
|
||||
gameFreeRecord.setFreeUpdateTime(data.getUpdateTime());
|
||||
gameFreeRecord.setSendAmount(data.getSendAmount());
|
||||
gameFreeRecord.setUsedAmount(data.getUsedAmount());
|
||||
gameFreeRecord.setUnusedAmount(data.getUnusedAmount());
|
||||
gameFreeRecordService.updateGameFreeRecord(gameFreeRecord);
|
||||
gameFreeRecordsResult.add(gameFreeRecord);
|
||||
}
|
||||
}
|
||||
|
||||
return gameFreeRecordsResult;
|
||||
} else {
|
||||
log.error("GameBettingDataJILIServiceImpl [getFreeSpinDashflow] 查询免费游戏玩家使用的纪录,错误代码{},错误信息{}", getFreeSpinDashflowResponseDTO.getErrorCode(), getFreeSpinDashflowResponseDTO.getMessage());
|
||||
throw new BaseException(getFreeSpinDashflowResponseDTO.getMessage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GameBettingDataJILIServiceImpl [getFreeSpinDashflow] 查询免费游戏玩家使用的纪录,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.free.play.record.query.failed"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消赠送免费局数
|
||||
*
|
||||
* @param cancelFreeSpinRequestDTO 取消免费旋转请求
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean cancelFreeSpin(CancelFreeSpinRequestDTO cancelFreeSpinRequestDTO) {
|
||||
//请求参数
|
||||
String query = "ReferenceId=" + cancelFreeSpinRequestDTO.getReferenceId()
|
||||
+ "&AgentId=" + cancelFreeSpinRequestDTO.getAgentId();
|
||||
;
|
||||
log.info("GamesJILIServiceImpl [cancelFreeSpin] 请求参数 {}", query);
|
||||
cancelFreeSpinRequestDTO.setQuery(query);
|
||||
//获取key
|
||||
String key = this.getKey(cancelFreeSpinRequestDTO);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.JILI_API_BASE_URL);
|
||||
String result = null;
|
||||
try {
|
||||
result = HttpClientSslUtils.doPost(apiBaseUrl + "/CancelFreeSpin?" + query + "&Key=" + key, "AgentId=" + cancelFreeSpinRequestDTO.getAgentId(), ContentType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
JILICancelFreeSpinResponseDTO cancelFreeSpinResponseDTO = JSON.parseObject(result, JILICancelFreeSpinResponseDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(cancelFreeSpinResponseDTO.getErrorCode())) {
|
||||
List<GameFreeRecord> gameFreeRecords = gameFreeRecordService.selectGameFreeRecordList(GameFreeRecord.builder()
|
||||
.referenceId(cancelFreeSpinRequestDTO.getReferenceId())
|
||||
.build());
|
||||
for (GameFreeRecord gameFreeRecord : gameFreeRecords) {
|
||||
gameFreeRecord.setFreeStatus(FreeStatus.CANCEL.getCode());
|
||||
gameFreeRecordService.updateGameFreeRecord(gameFreeRecord);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
} else {
|
||||
log.error("GameBettingDataJILIServiceImpl [cancelFreeSpin] 取消赠送免费局数,错误代码{},错误信息{}", cancelFreeSpinResponseDTO.getErrorCode(), cancelFreeSpinResponseDTO.getMessage());
|
||||
throw new BaseException(cancelFreeSpinResponseDTO.getMessage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GameBettingDataJILIServiceImpl [cancelFreeSpin] 取消赠送免费局数,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.free.round.cancel.failed"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据构建
|
||||
*
|
||||
* @param gamesDataBuildDTO 数据
|
||||
* @return {@link GameBettingDetails }
|
||||
*/
|
||||
@Override
|
||||
public GameBettingDetails dataBuild(GamesDataBuildDTO gamesDataBuildDTO) {
|
||||
|
||||
//转化类
|
||||
JILIBetRecordDataResponseDTO jiliBetRecordDataResponseDTO = (JILIBetRecordDataResponseDTO) gamesDataBuildDTO.getData();
|
||||
String systemByCode = gameSecretKeyService.findSystemByCode(jiliBetRecordDataResponseDTO.getAgentId(), GamePlatforms.JILI.getInfo());
|
||||
Member member = memberService.selectMemberByMemberAccount(jiliBetRecordDataResponseDTO.getAccount());
|
||||
if (ObjectUtils.isEmpty(member)) {
|
||||
return null;
|
||||
}
|
||||
List<JILIGamesDataDTO> gamesDatas = redisCache.getCacheList(CacheConstants.JILI_GAMES);
|
||||
Map<Integer, JILIGamesDataDTO> dataDTOMap = gamesDatas.stream().collect(Collectors.toMap(JILIGamesDataDTO::getGameId, e -> e));
|
||||
JILIGamesDataDTO gamesDataDTO = dataDTOMap.get(jiliBetRecordDataResponseDTO.getGameId());
|
||||
BigDecimal payoffAmount = BigDecimal.ZERO;
|
||||
if (GameStatus.WIN.getCode().equals(jiliBetRecordDataResponseDTO.getStatus())) {
|
||||
payoffAmount = NumberUtil.sub(jiliBetRecordDataResponseDTO.getPayoffAmount(), jiliBetRecordDataResponseDTO.getTurnover());
|
||||
} else if (GameStatus.FAIL.getCode().equals(jiliBetRecordDataResponseDTO.getStatus())) {
|
||||
payoffAmount = NumberUtil.sub(jiliBetRecordDataResponseDTO.getPayoffAmount(), jiliBetRecordDataResponseDTO.getTurnover()).negate();
|
||||
}
|
||||
|
||||
//数据构造
|
||||
GameBettingDetails gameBettingDetails = GameBettingDetails.builder()
|
||||
//保存我们的币种id
|
||||
.currencyCode(systemByCode)
|
||||
.memberId(member.getId())
|
||||
.gameCode(jiliBetRecordDataResponseDTO.getGameId())
|
||||
.gameType(JILIGameType.findSystemByCode(jiliBetRecordDataResponseDTO.getGameCategoryId()))
|
||||
.platformCode(GamePlatforms.JILI.getCode())
|
||||
.gameId(gamesDataDTO.getSystemGameId())
|
||||
.gameName(gamesDataDTO.getName().getZhCN())
|
||||
.gameStatus(jiliBetRecordDataResponseDTO.getStatus())
|
||||
.gameStatusType(jiliBetRecordDataResponseDTO.getType())
|
||||
.gameCurrencyCode(jiliBetRecordDataResponseDTO.getAgentId())
|
||||
.account(String.valueOf(jiliBetRecordDataResponseDTO.getAccount()))
|
||||
.wagersId(jiliBetRecordDataResponseDTO.getWagersId())
|
||||
.wagersTime(jiliBetRecordDataResponseDTO.getWagersTime())
|
||||
.betAmount(jiliBetRecordDataResponseDTO.getBetAmount().abs())
|
||||
.payoffTime(jiliBetRecordDataResponseDTO.getPayoffTime())
|
||||
.payoffAmount(payoffAmount)
|
||||
.settlementTime(jiliBetRecordDataResponseDTO.getSettlementTime())
|
||||
.turnover(jiliBetRecordDataResponseDTO.getTurnover())
|
||||
.orderNo(String.valueOf(jiliBetRecordDataResponseDTO.getRoundIndex()))
|
||||
.build();
|
||||
gameBettingDetails.setCreateBy(Constants.SYSTEM);
|
||||
gameBettingDetails.setCreateTime(DateUtils.getNowDate());
|
||||
return gameBettingDetails;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 按时间dto投注记录
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
public class BetRecordByTimeDTO extends GamesBaseRequestDTO {
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Long startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Long endTime;
|
||||
/**
|
||||
* 页数
|
||||
*/
|
||||
private Integer page;
|
||||
/**
|
||||
* 每页资料笔数
|
||||
*/
|
||||
private Integer pageLimit;
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
private Integer gameId;
|
||||
/**
|
||||
* 指定平台
|
||||
*/
|
||||
private String gamePlatform;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 取消免费旋转请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/11
|
||||
*/
|
||||
@Data
|
||||
public class CancelFreeSpinRequestDTO extends GamesBaseRequestDTO {
|
||||
/**
|
||||
* 取消免费赠送游戏id
|
||||
*/
|
||||
private String referenceId;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 创建自由旋转请求dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/11
|
||||
*/
|
||||
@Data
|
||||
public class CreateFreeSpinRequestDTO extends GamesBaseRequestDTO {
|
||||
|
||||
/**
|
||||
* 玩家账号 (JILI 新玩家则会自动创立账号)
|
||||
*/
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 玩家使用货币。转账钱包这项请填空字符串。
|
||||
*/
|
||||
private String currency;
|
||||
|
||||
/**
|
||||
* 免费局数序号, 长度上限 50
|
||||
*/
|
||||
private String referenceId;
|
||||
|
||||
/**
|
||||
* 有效期限
|
||||
*
|
||||
*
|
||||
*/
|
||||
private Long freeSpinValidity;
|
||||
|
||||
/**
|
||||
* 局数
|
||||
*/
|
||||
private Integer numberOfRounds;
|
||||
|
||||
/**
|
||||
* 可使用游戏 ID, 超过一笔时以逗号分隔; 系统内游戏id
|
||||
* 长度 上限 200
|
||||
*/
|
||||
private List<Long> gameIds;
|
||||
|
||||
/**
|
||||
* 指定投注额;
|
||||
* 未指定时, 一律使用游戏中的最小投注额
|
||||
*/
|
||||
private BigDecimal betValue;
|
||||
|
||||
/**
|
||||
* 免费游戏局数可使用的开始时间
|
||||
* 未带此参数时, 赠送后玩家可以立即使用
|
||||
*/
|
||||
private Long startTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 创建成员请求dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class CreateMemberRequestDTO extends GamesBaseRequestDTO {
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 外汇转账
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
public class ExchangeTransferMoneyRequestDTO extends GamesBaseRequestDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
|
||||
|
||||
/** 游戏平台id */
|
||||
@Excel(name = "游戏平台id")
|
||||
private Long platformId;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
/**
|
||||
* 租户额度
|
||||
*/
|
||||
private BigDecimal quota;
|
||||
|
||||
|
||||
/**
|
||||
* 转账类型
|
||||
* 1: 从 游戏商 转移额度到 平台商 (不看 amount 值,全
|
||||
* 部转出)
|
||||
* 2: 从 平台商 转移额度到 游戏商
|
||||
* 3: 从 游戏商 转移额度到 平台商
|
||||
*/
|
||||
private Integer transferType;
|
||||
|
||||
/**
|
||||
* 交易id
|
||||
*/
|
||||
private String transactionId;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
|
||||
import com.ff.game.domain.Game;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 游戏独有dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/11
|
||||
*/
|
||||
@Data
|
||||
public class GameUniqueDTO extends Game {
|
||||
|
||||
private List<Long> gameIds;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 游戏请求dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class GamesBaseRequestDTO implements Serializable {
|
||||
private static final long serialVersionUID = 5139311242800113436L;
|
||||
/**
|
||||
* 代理id
|
||||
*/
|
||||
private String agentId;
|
||||
|
||||
/**
|
||||
* 代理密钥
|
||||
*/
|
||||
private String agentKey;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
private String query;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 游戏数据构建dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Data
|
||||
public class GamesDataBuildDTO
|
||||
{
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private Object data;
|
||||
|
||||
/**
|
||||
* 游戏列表key
|
||||
*/
|
||||
private String gamesKey;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 游戏登录
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class GamesLogin extends GamesBaseRequestDTO{
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 游戏唯一识别值(同等 GameList 各游戏的 GameId)
|
||||
*/
|
||||
private Integer gameId;
|
||||
/**
|
||||
* UI 语系, 请参考 附录 – 语系参数
|
||||
*/
|
||||
private String lang;
|
||||
/**
|
||||
* 不列入 md5 加密,游戏回主页功能导向位置
|
||||
*/
|
||||
private String homeUrl;
|
||||
/**
|
||||
* 不列入 md5 加密,带入 web 或是 app
|
||||
*/
|
||||
private String platform;
|
||||
/**
|
||||
* 不列入 md5 加密, 带入 1 即关闭全屏幕模式
|
||||
*/
|
||||
private Integer disableFullScreen;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取自由旋转dashflow请求dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/11
|
||||
*/
|
||||
@Data
|
||||
public class GetFreeSpinDashflowRequestDTO extends GamesBaseRequestDTO {
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Long startTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取游戏详细信息请求dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/12
|
||||
*/
|
||||
@Data
|
||||
public class GetGameDetailRequestDTO extends GamesBaseRequestDTO {
|
||||
|
||||
/**
|
||||
* 投注id
|
||||
*/
|
||||
private Long wagersId;
|
||||
/**
|
||||
* 郎
|
||||
*/
|
||||
private String lang;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 获取游戏详细信息请求dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/12
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class GetGameDetailResponseDTO {
|
||||
|
||||
|
||||
/**
|
||||
* url
|
||||
*/
|
||||
private String url;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 踢成员全部dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/12
|
||||
*/
|
||||
@Data
|
||||
public class KickMemberAllDTO extends GamesBaseRequestDTO {
|
||||
private Long gameId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 踢会员请求dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/12
|
||||
*/
|
||||
@Data
|
||||
public class KickMemberRequestDTO extends GamesBaseRequestDTO {
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 创建成员请求dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class MemberInfoRequestDTO extends GamesBaseRequestDTO {
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String accounts;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.ff.game.api.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 成员信息响应dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/30
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class MemberInfoResponseDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 状态:
|
||||
* 1: 在线
|
||||
* 2: 脱机
|
||||
* 3: 账号不存在
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.ff.game.api.xk.dto;
|
||||
|
||||
import io.jsonwebtoken.lang.Collections;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKBetRecordResponseDTO {
|
||||
|
||||
private Integer code;
|
||||
private String msg;
|
||||
private DataBean data;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
private Integer currentPage;
|
||||
private Integer totalPages;
|
||||
private Integer pageLimit;
|
||||
private Integer totalNumber;
|
||||
private List<ResultBean> result;
|
||||
|
||||
public List<ResultBean> getResult() {
|
||||
if (Collections.isEmpty(result)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class ResultBean {
|
||||
private String account;
|
||||
private Long wagersId;
|
||||
private Integer gameId;
|
||||
private Long wagersTime;
|
||||
private BigDecimal betAmount;
|
||||
private Long payoffTime;
|
||||
private BigDecimal payoffAmount;
|
||||
private Integer status;
|
||||
private Long settlementTime;
|
||||
private Integer gameCategoryId;
|
||||
private Integer type;
|
||||
private String agentId;
|
||||
private BigDecimal turnover;
|
||||
private Long roundIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ff.game.api.xk.dto;
|
||||
|
||||
|
||||
import com.ff.game.api.request.GamesBaseRequestDTO;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
/**
|
||||
* 创建成员响应dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKCreateMemberResponseDTO extends GamesBaseRequestDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private int code;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private String data;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.ff.game.api.xk.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKExchangeMoneyResponseDTO {
|
||||
|
||||
private int code;
|
||||
private String msg;
|
||||
private DataBean data;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
/**
|
||||
* 交易序号,额度转移纪录唯一值, 长度上限 50
|
||||
*/
|
||||
private String transactionId;
|
||||
/**
|
||||
* 转账前金额(游戏币)
|
||||
*/
|
||||
private BigDecimal coinBefore;
|
||||
/**
|
||||
* 转账后金额(游戏币)
|
||||
*/
|
||||
private BigDecimal coinAfter;
|
||||
/**
|
||||
* 转账前金额(指定货币)
|
||||
*/
|
||||
private BigDecimal currencyBefore;
|
||||
/**
|
||||
* 转账后金额(指定货币)
|
||||
*/
|
||||
private BigDecimal currencyAfter;
|
||||
/**
|
||||
* 状态:
|
||||
* 1: 成功
|
||||
* 2: 失败
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.ff.game.api.xk.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* xkgames数据
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/13
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKGamesDTO {
|
||||
|
||||
private int code;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private List<DataBean> data;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
private int gameId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 游戏类别id
|
||||
*/
|
||||
private int gameCategoryId;
|
||||
/**
|
||||
*自己系统游戏id
|
||||
*/
|
||||
private Long systemGameId;
|
||||
/**
|
||||
* jp
|
||||
*/
|
||||
private boolean jp;
|
||||
/**
|
||||
* 是否免费
|
||||
*/
|
||||
private boolean freeSpin;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.ff.game.api.xk.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* xkkick会员全部dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/13
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class XKKickMemberAllDTO {
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private int code;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private String data;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.ff.game.api.xk.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKKickMemberDTO {
|
||||
|
||||
private int code;
|
||||
private String msg;
|
||||
private Object data;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.ff.game.api.xk.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 登录时不重定向响应dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKLoginWithoutRedirectResponseDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private int code;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private String data;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.ff.game.api.xk.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员信息dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/30
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKMemberInfoDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private Integer code;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private List<DataBean> data;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 平衡
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 地位
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,618 @@
|
|||
package com.ff.game.api.xk.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ff.base.constant.CacheConstants;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.redis.RedisCache;
|
||||
import com.ff.base.enums.GamePlatforms;
|
||||
import com.ff.base.enums.GameStatus;
|
||||
import com.ff.base.enums.XKGameType;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.system.service.ISysConfigService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.JsonUtil;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import com.ff.base.utils.http.HttpClientSslUtils;
|
||||
import com.ff.base.utils.sign.Md5Utils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.ff.game.api.IGamesService;
|
||||
import com.ff.game.api.request.*;
|
||||
import com.ff.game.api.xk.dto.*;
|
||||
import com.ff.game.domain.*;
|
||||
import com.ff.game.service.*;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* XK 游戏 impl
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/12
|
||||
*/
|
||||
@Service("XKService")
|
||||
@Slf4j
|
||||
public class GamesXKServiceImpl implements IGamesService {
|
||||
|
||||
|
||||
@Resource
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Resource
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Resource
|
||||
private IGameExchangeMoneyService gameExchangeMoneyService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IGamePlatformService gamePlatformService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IGameService gameService;
|
||||
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private IMemberService memberService;
|
||||
|
||||
@Resource
|
||||
private IGameFreeRecordService gameFreeRecordService;
|
||||
@Resource
|
||||
private IGameSecretKeyService gameSecretKeyService;
|
||||
/**
|
||||
* 获得就是成功
|
||||
*
|
||||
* @param errorCode 错误代码
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
private Boolean getIsSuccess(Integer errorCode) {
|
||||
return 0 == errorCode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取密钥
|
||||
*
|
||||
* @param gamesBaseRequestDTO 游戏请求dto
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Override
|
||||
public String getKey(GamesBaseRequestDTO gamesBaseRequestDTO) {
|
||||
Random random = new Random();
|
||||
//取出对应的key跟密钥跟请求参数
|
||||
String agentKey = gamesBaseRequestDTO.getAgentKey();
|
||||
String agentId = gamesBaseRequestDTO.getAgentId();
|
||||
String query = gamesBaseRequestDTO.getQuery();
|
||||
|
||||
String now = DateUtils.getFormattedDate();
|
||||
String keyG = Md5Utils.md5New(now + agentId + agentKey);
|
||||
|
||||
String md5string = Md5Utils.md5New(query + keyG);
|
||||
Integer randomText1 = 100000 + random.nextInt(900000);
|
||||
Integer randomText2 = 100000 + random.nextInt(900000);
|
||||
String key = randomText1 + md5string + randomText2;
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @param createMemberRequestDTO 创建成员请求dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean createMember(CreateMemberRequestDTO createMemberRequestDTO) {
|
||||
log.info("GamesXKServiceImpl [createMember] 请求参数 {}", createMemberRequestDTO);
|
||||
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL);
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("account", createMemberRequestDTO.getAccount());
|
||||
params.put("agentId", createMemberRequestDTO.getAgentId());
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
createMemberRequestDTO.setQuery(query);
|
||||
String key = this.getKey(createMemberRequestDTO);
|
||||
params.put("key", key);
|
||||
try {
|
||||
String result = HttpClientSslUtils.doPost(apiBaseUrl + "/api/createMember", JsonUtil.objToPrettyString(params));
|
||||
XKCreateMemberResponseDTO xkCreateMemberResponseDTO = JsonUtil.stringToObj(result, XKCreateMemberResponseDTO.class);
|
||||
//判断是否获取成功
|
||||
return !this.getIsSuccess(xkCreateMemberResponseDTO.getCode());
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("GamesXKServiceImpl [createMember] 建立游戏账号,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.account.create.failed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param memberInfoRequestDTO 会员信息请求dto
|
||||
* @return {@link MemberInfoResponseDTO }
|
||||
*/
|
||||
@Override
|
||||
public MemberInfoResponseDTO getMemberInfo(MemberInfoRequestDTO memberInfoRequestDTO) {
|
||||
log.info("GamesXKServiceImpl [getMemberInfo] 请求参数 {}", memberInfoRequestDTO);
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("accounts", memberInfoRequestDTO.getAccounts());
|
||||
params.put("agentId", memberInfoRequestDTO.getAgentId());
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
memberInfoRequestDTO.setQuery(query);
|
||||
String key = this.getKey(memberInfoRequestDTO);
|
||||
params.put("key", key);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL);
|
||||
try {
|
||||
String result = HttpClientSslUtils.doPost(apiBaseUrl + "/api/getMemberInfo", JsonUtil.objToPrettyString(params));
|
||||
XKMemberInfoDTO xkMemberInfoDTO = JsonUtil.stringToObj(result, XKMemberInfoDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(xkMemberInfoDTO.getCode())) {
|
||||
List<MemberInfoResponseDTO> memberInfoResponseDTOS = new ArrayList<>();
|
||||
xkMemberInfoDTO.getData().forEach(e -> {
|
||||
memberInfoResponseDTOS.add(MemberInfoResponseDTO.builder()
|
||||
.status(e.getStatus())
|
||||
.balance(e.getBalance())
|
||||
.account(e.getAccount())
|
||||
.build());
|
||||
});
|
||||
return memberInfoResponseDTOS.get(0);
|
||||
} else {
|
||||
log.error("GamesXKServiceImpl [getMemberInfo] 查询游戏账号信息失败,错误代码{},错误信息{}", xkMemberInfoDTO.getCode(), xkMemberInfoDTO.getMsg());
|
||||
throw new BaseException(MessageUtils.message("game.account.query.failed"));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("GamesXKServiceImpl [getMemberInfo] 查询游戏账号信息失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.account.query.failed"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 无重定向登录
|
||||
*
|
||||
* @param gamesLogin 游戏登录
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Override
|
||||
public String loginWithoutRedirect(GamesLogin gamesLogin) {
|
||||
log.info("GamesXKServiceImpl [loginWithoutRedirect] 请求参数 {}", gamesLogin);
|
||||
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("account", gamesLogin.getAccount());
|
||||
params.put("gameId", gamesLogin.getGameId());
|
||||
params.put("lang", gamesLogin.getLang());
|
||||
params.put("agentId", gamesLogin.getAgentId());
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
gamesLogin.setQuery(query);
|
||||
String key = this.getKey(gamesLogin);
|
||||
params.put("key", key);
|
||||
params.put("disableFullScreen", gamesLogin.getDisableFullScreen());
|
||||
params.put("homeUrl", gamesLogin.getHomeUrl());
|
||||
params.put("platform", gamesLogin.getPlatform());
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL);
|
||||
try {
|
||||
|
||||
String result = HttpClientSslUtils.doPost(apiBaseUrl + "/api/loginWithoutRedirect", JsonUtil.objToPrettyString(params));
|
||||
XKLoginWithoutRedirectResponseDTO xkLoginWithoutRedirectResponseDTO = JsonUtil.stringToObj(result, XKLoginWithoutRedirectResponseDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(xkLoginWithoutRedirectResponseDTO.getCode())) {
|
||||
return xkLoginWithoutRedirectResponseDTO.getData();
|
||||
} else {
|
||||
log.error("GamesXKServiceImpl [loginWithoutRedirect] 游戏登录失败,错误代码{},错误信息{}", xkLoginWithoutRedirectResponseDTO.getCode(), xkLoginWithoutRedirectResponseDTO.getMsg());
|
||||
throw new BaseException(MessageUtils.message("game.login.failed"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GamesXKServiceImpl [loginWithoutRedirect] 游戏登录失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.login.failed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取游戏列表
|
||||
*
|
||||
* @param gamesBaseRequestDTO 游戏请求dto
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public String getGameList(GamesBaseRequestDTO gamesBaseRequestDTO) {
|
||||
List<XKGamesDTO.DataBean> gamesDatas = redisCache.getCacheList(CacheConstants.XK_GAMES);
|
||||
if (!CollectionUtils.isEmpty(gamesDatas)) {
|
||||
return CacheConstants.XK_GAMES;
|
||||
}
|
||||
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("agentId", gamesBaseRequestDTO.getAgentId());
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
gamesBaseRequestDTO.setQuery(query);
|
||||
String key = this.getKey(gamesBaseRequestDTO);
|
||||
params.put("key", key);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL);
|
||||
try {
|
||||
|
||||
|
||||
String result = HttpClientSslUtils.doPost(apiBaseUrl + "/api/getGameList", JsonUtil.objToPrettyString(params));
|
||||
XKGamesDTO xkGamesDTO = JsonUtil.stringToObj(result, XKGamesDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(xkGamesDTO.getCode())) {
|
||||
|
||||
Map<Long, GamePlatform> gamePlatformMap = new HashMap<>();
|
||||
|
||||
for (XKGamesDTO.DataBean gamesDataDTO : xkGamesDTO.getData()) {
|
||||
if (XKGameType.GAME_HALL.getCode().equals(gamesDataDTO.getGameCategoryId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
GamePlatform gamePlatform = GamePlatform.builder()
|
||||
.platformType(XKGameType.findSystemByCode(gamesDataDTO.getGameCategoryId()))
|
||||
.platformCode(GamePlatforms.XK.getCode())
|
||||
.build();
|
||||
List<GamePlatform> gamePlatforms = gamePlatformService.selectGamePlatformList(gamePlatform);
|
||||
//没有此平台就新增一个平台
|
||||
if (CollectionUtils.isEmpty(gamePlatforms)) {
|
||||
gamePlatform.setPlatformName(GamePlatforms.XK.getInfo() + XKGameType.findInfoByCode(gamesDataDTO.getGameCategoryId()));
|
||||
gamePlatform.setSortNo(gamePlatformService.selectMaxSortNo() + 1);
|
||||
gamePlatform.setCreateBy(Constants.SYSTEM);
|
||||
gamePlatformService.insertGamePlatform(gamePlatform);
|
||||
} else {
|
||||
gamePlatform = gamePlatforms.get(0);
|
||||
}
|
||||
Game game = Game.builder()
|
||||
.platformId(gamePlatform.getId())
|
||||
.gameCode(gamesDataDTO.getGameId())
|
||||
.build();
|
||||
List<Game> games = gameService.selectGameList(game);
|
||||
//不存在这个游戏
|
||||
if (CollectionUtils.isEmpty(games)) {
|
||||
game.setFreespin(gamesDataDTO.isFreeSpin());
|
||||
game.setSortNo(gameService.selectMaxSortNoByPlatformId(gamePlatform.getId()) + 1);
|
||||
game.setGameName(gamesDataDTO.getName());
|
||||
game.setCreateBy(Constants.SYSTEM);
|
||||
gameService.insertGame(game);
|
||||
} else {
|
||||
game = games.get(0);
|
||||
}
|
||||
gamesDataDTO.setSystemGameId(game.getId());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
redisCache.deleteObject(CacheConstants.XK_GAMES);
|
||||
redisCache.setCacheList(CacheConstants.XK_GAMES, xkGamesDTO.getData());
|
||||
redisCache.expire(CacheConstants.XK_GAMES, 5L, TimeUnit.HOURS);
|
||||
} else {
|
||||
log.error("GamesXKServiceImpl [getGameList] 获取游戏列表失败,错误代码{},错误信息{}", xkGamesDTO.getCode(), xkGamesDTO.getMsg());
|
||||
throw new BaseException(MessageUtils.message("game.list.retrieve.failed"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GamesXKServiceImpl [getGameList] 获取游戏列表失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.list.retrieve.failed"));
|
||||
}
|
||||
return CacheConstants.JILI_GAMES;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按代理id进行交换转账
|
||||
*
|
||||
* @param exchangeTransferMoneyRequestDTO 外汇转账moeny dto
|
||||
* @return {@link Long }
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Long exchangeTransferByAgentId(ExchangeTransferMoneyRequestDTO exchangeTransferMoneyRequestDTO) {
|
||||
log.info("GamesXKServiceImpl [exchangeTransferByAgentId] 请求参数 {}", exchangeTransferMoneyRequestDTO);
|
||||
String systemByCode = gameSecretKeyService.findSystemByCode(exchangeTransferMoneyRequestDTO.getAgentId(),GamePlatforms.XK.getInfo());
|
||||
Member member = memberService.selectMemberByMemberAccount(exchangeTransferMoneyRequestDTO.getAccount());
|
||||
//获取下一个自增id
|
||||
GameExchangeMoney exchangeMoney = GameExchangeMoney
|
||||
.builder()
|
||||
.quota(exchangeTransferMoneyRequestDTO.getQuota())
|
||||
.platformId(exchangeTransferMoneyRequestDTO.getPlatformId())
|
||||
.balance(exchangeTransferMoneyRequestDTO.getAmount())
|
||||
.exchangeType(exchangeTransferMoneyRequestDTO.getTransferType())
|
||||
.currencyCode(systemByCode)
|
||||
.memberId(member.getId())
|
||||
.platformCode(GamePlatforms.XK.getCode())
|
||||
.build();
|
||||
exchangeMoney.setCreateBy(Constants.SYSTEM);
|
||||
//接口限制限制50字符
|
||||
exchangeMoney.setTransactionId(GamePlatforms.XK.getCode() + IdUtils.simpleUUID());
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("account", exchangeTransferMoneyRequestDTO.getAccount());
|
||||
params.put("transactionId", exchangeMoney.getTransactionId());
|
||||
params.put("amount", exchangeTransferMoneyRequestDTO.getAmount().stripTrailingZeros().toString());
|
||||
params.put("transferType", exchangeTransferMoneyRequestDTO.getTransferType());
|
||||
params.put("agentId", exchangeTransferMoneyRequestDTO.getAgentId());
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
exchangeTransferMoneyRequestDTO.setQuery(query);
|
||||
String key = this.getKey(exchangeTransferMoneyRequestDTO);
|
||||
params.put("key", key);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL);
|
||||
try {
|
||||
String result = HttpClientSslUtils.doPost(apiBaseUrl + "/api/exchangeTransferByAgentId", JsonUtil.objToPrettyString(params));
|
||||
|
||||
XKExchangeMoneyResponseDTO exchangeMoneyResponse = JsonUtil.stringToObj(result, XKExchangeMoneyResponseDTO.class);
|
||||
//判断是否转移成功
|
||||
if (this.getIsSuccess(exchangeMoneyResponse.getCode())) {
|
||||
XKExchangeMoneyResponseDTO.DataBean exchangeMoneyResponseData = exchangeMoneyResponse.getData();
|
||||
//更新数据
|
||||
exchangeMoney.setBalance(NumberUtil.sub(exchangeMoneyResponseData.getCurrencyAfter(), exchangeMoneyResponseData.getCurrencyBefore()).abs());
|
||||
exchangeMoney.setCoinBefore(exchangeMoneyResponseData.getCoinBefore());
|
||||
exchangeMoney.setCoinAfter(exchangeMoneyResponseData.getCoinAfter());
|
||||
exchangeMoney.setCurrencyBefore(exchangeMoneyResponseData.getCurrencyBefore());
|
||||
exchangeMoney.setCurrencyAfter(exchangeMoneyResponseData.getCurrencyAfter());
|
||||
exchangeMoney.setStatus(exchangeMoneyResponseData.getStatus());
|
||||
gameExchangeMoneyService.insertGameExchangeMoney(exchangeMoney);
|
||||
} else {
|
||||
log.error("GamesXKServiceImpl [exchangeTransferByAgentId] 金额转移失败,错误代码{},错误信息{}", exchangeMoneyResponse.getCode(), exchangeMoneyResponse.getMsg());
|
||||
throw new BaseException(MessageUtils.message("game.account.balance.transfer.failed"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GamesXKServiceImpl [exchangeTransferByAgentId] 金额转移失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.account.balance.transfer.failed"));
|
||||
}
|
||||
|
||||
return exchangeMoney.getId();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 按时间获取投注记录
|
||||
*
|
||||
* @param betRecordByTimeDTO 按时间dto投注记录
|
||||
* @return {@link List }<{@link GameBettingDetails }>
|
||||
*/
|
||||
@Override
|
||||
public List<GameBettingDetails> getBetRecordByTime(BetRecordByTimeDTO betRecordByTimeDTO) {
|
||||
List<GameBettingDetails> gameBettingDetails = new ArrayList<>();
|
||||
//请求参数
|
||||
log.info("GamesXKServiceImpl [getBetRecordByTime] 请求参数 {}", betRecordByTimeDTO);
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("startTime", betRecordByTimeDTO.getStartTime());
|
||||
params.put("endTime", betRecordByTimeDTO.getEndTime());
|
||||
params.put("page", betRecordByTimeDTO.getPage());
|
||||
params.put("pageLimit", betRecordByTimeDTO.getPageLimit());
|
||||
params.put("agentId", betRecordByTimeDTO.getAgentId());
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
betRecordByTimeDTO.setQuery(query);
|
||||
String key = this.getKey(betRecordByTimeDTO);
|
||||
params.put("key", key);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL);
|
||||
String result = null;
|
||||
try {
|
||||
result = HttpClientSslUtils.doPost(apiBaseUrl + "/api/getGameRecordByTime", JsonUtil.objToPrettyString(params));
|
||||
|
||||
XKBetRecordResponseDTO betRecordJILIResponse = JSON.parseObject(result, XKBetRecordResponseDTO.class);
|
||||
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(betRecordJILIResponse.getCode())) {
|
||||
//数据组装
|
||||
XKBetRecordResponseDTO.DataBean dataBean = betRecordJILIResponse.getData();
|
||||
for (XKBetRecordResponseDTO.DataBean.ResultBean bean : dataBean.getResult()) {
|
||||
GameBettingDetails bettingDetails = this.dataBuild(GamesDataBuildDTO.builder().data(bean).gamesKey(key).build());
|
||||
gameBettingDetails.add(bettingDetails);
|
||||
}
|
||||
|
||||
//获取下一页数据
|
||||
while (!Objects.equals(dataBean.getCurrentPage(), dataBean.getTotalPages())&&dataBean.getTotalPages()>0) {
|
||||
betRecordByTimeDTO.setPage(dataBean.getCurrentPage() + 1);
|
||||
//请求参数
|
||||
params = new LinkedHashMap<>();
|
||||
params.put("startTime", betRecordByTimeDTO.getStartTime());
|
||||
params.put("endTime", betRecordByTimeDTO.getEndTime());
|
||||
params.put("page", betRecordByTimeDTO.getPage());
|
||||
params.put("pageLimit", betRecordByTimeDTO.getPageLimit());
|
||||
params.put("agentId", betRecordByTimeDTO.getAgentId());
|
||||
query = JsonUtil.mapToQueryString(params);
|
||||
betRecordByTimeDTO.setQuery(query);
|
||||
key = this.getKey(betRecordByTimeDTO);
|
||||
params.put("key", key);
|
||||
result = HttpClientSslUtils.doPost(apiBaseUrl + "/api/getGameRecordByTime", JsonUtil.objToPrettyString(params));
|
||||
betRecordJILIResponse = JsonUtil.stringToObj(result, XKBetRecordResponseDTO.class);
|
||||
dataBean = betRecordJILIResponse.getData();
|
||||
for (XKBetRecordResponseDTO.DataBean.ResultBean bean : dataBean.getResult()) {
|
||||
GameBettingDetails bettingDetails = this.dataBuild(GamesDataBuildDTO.builder().data(bean).gamesKey(key).build());
|
||||
gameBettingDetails.add(bettingDetails);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return gameBettingDetails;
|
||||
} else {
|
||||
log.error("GamesXKServiceImpl [getBetRecordByTime] 获取投注记录失败,错误代码{},错误信息{}", betRecordJILIResponse.getCode(), betRecordJILIResponse.getMsg());
|
||||
throw new BaseException(MessageUtils.message("game.bet.record.retrieve.failed"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GamesXKServiceImpl [getBetRecordByTime] 获取投注记录失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.bet.record.retrieve.failed"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送免费局数
|
||||
*
|
||||
* @param createFreeSpinRequest 创建自由旋转请求
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean createFreeSpin(CreateFreeSpinRequestDTO createFreeSpinRequest) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取游戏详细信息
|
||||
*
|
||||
* @param getGameDetailRequestDTO 获取游戏详细信息请求dto
|
||||
* @return {@link GetGameDetailResponseDTO }
|
||||
*/
|
||||
@Override
|
||||
public GetGameDetailResponseDTO getGameDetail(GetGameDetailRequestDTO getGameDetailRequestDTO) {
|
||||
return new GetGameDetailResponseDTO();
|
||||
}
|
||||
|
||||
/**
|
||||
* 强制会员从游戏注销
|
||||
*
|
||||
* @param kickMemberRequestDTO 踢会员请求dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean kickMember(KickMemberRequestDTO kickMemberRequestDTO) {
|
||||
log.info("GamesXKServiceImpl [kickMember] 请求参数 {}", kickMemberRequestDTO);
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("account", kickMemberRequestDTO.getAccount());
|
||||
params.put("agentId", kickMemberRequestDTO.getAgentId());
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
kickMemberRequestDTO.setQuery(query);
|
||||
String key = this.getKey(kickMemberRequestDTO);
|
||||
params.put("key", key);
|
||||
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL);
|
||||
try {
|
||||
|
||||
String result = HttpClientSslUtils.doPost(apiBaseUrl + "/api/kickMember", JsonUtil.objToPrettyString(params));
|
||||
XKKickMemberDTO xkKickMemberDTO = JsonUtil.stringToObj(result, XKKickMemberDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(xkKickMemberDTO.getCode())) {
|
||||
return Boolean.TRUE;
|
||||
} else {
|
||||
log.error("GamesXKServiceImpl [kickMember] 强制会员从游戏注销失败,错误代码{},错误信息{}", xkKickMemberDTO.getCode(), xkKickMemberDTO.getMsg());
|
||||
throw new BaseException(MessageUtils.message("game.member.force.logout.failed"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GamesXKServiceImpl [kickMember] 强制会员从游戏注销失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.member.force.logout.failed"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 踢成员全部
|
||||
*
|
||||
* @param kickMemberAllDTO 踢成员全部dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean kickMemberAll(KickMemberAllDTO kickMemberAllDTO) {
|
||||
log.info("GamesXKServiceImpl [kickMemberAll] 请求参数 {}", kickMemberAllDTO);
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("agentId", kickMemberAllDTO.getAgentId());
|
||||
if (!ObjectUtils.isEmpty(kickMemberAllDTO.getGameId())) {
|
||||
params.put("gameId", kickMemberAllDTO.getGameId());
|
||||
}
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
kickMemberAllDTO.setQuery(query);
|
||||
String key = this.getKey(kickMemberAllDTO);
|
||||
params.put("key", key);
|
||||
kickMemberAllDTO.setQuery(query);
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.XK_API_BASE_URL);
|
||||
try {
|
||||
|
||||
String result = HttpClientSslUtils.doPost(apiBaseUrl + "/api/kickMemberAll", JsonUtil.objToPrettyString(params));
|
||||
XKKickMemberAllDTO xkKickMemberAllDTO = JsonUtil.stringToObj(result, XKKickMemberAllDTO.class);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(xkKickMemberAllDTO.getCode())) {
|
||||
return Boolean.TRUE;
|
||||
} else {
|
||||
log.error("GamesXKServiceImpl [kickMemberAll] 强制全部会员从游戏注销失败,错误代码{},错误信息{}", xkKickMemberAllDTO.getCode(), xkKickMemberAllDTO.getMsg());
|
||||
throw new BaseException(MessageUtils.message("game.members.force.logout.failed"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GamesXKServiceImpl [kickMemberAll] 强制全部会员从游戏注销失败,错误信息{}", e);
|
||||
throw new BaseException(MessageUtils.message("game.members.force.logout.failed"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 免费游戏玩家使用的纪录
|
||||
*
|
||||
* @param getFreeSpinDashflowRequestDTO 获取自由旋转dashflow请求dto
|
||||
* @return {@link List }<{@link GameFreeRecord }>
|
||||
*/
|
||||
@Override
|
||||
public List<GameFreeRecord> getFreeSpinDashflow(GetFreeSpinDashflowRequestDTO getFreeSpinDashflowRequestDTO) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消赠送免费局数
|
||||
*
|
||||
* @param cancelFreeSpinRequestDTO 取消免费旋转请求
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean cancelFreeSpin(CancelFreeSpinRequestDTO cancelFreeSpinRequestDTO) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据构建
|
||||
*
|
||||
* @param gamesDataBuildDTO 数据
|
||||
* @return {@link GameBettingDetails }
|
||||
*/
|
||||
@Override
|
||||
public GameBettingDetails dataBuild(GamesDataBuildDTO gamesDataBuildDTO) {
|
||||
//转化类
|
||||
XKBetRecordResponseDTO.DataBean.ResultBean resultBean = (XKBetRecordResponseDTO.DataBean.ResultBean) gamesDataBuildDTO.getData();
|
||||
String systemByCode = gameSecretKeyService.findSystemByCode(resultBean.getAgentId(),GamePlatforms.XK.getInfo());
|
||||
Member member = memberService.selectMemberByMemberAccount(resultBean.getAccount());
|
||||
List<XKGamesDTO.DataBean> gamesDatas = redisCache.getCacheList(CacheConstants.XK_GAMES);
|
||||
Map<Integer, XKGamesDTO.DataBean> dataDTOMap = gamesDatas.stream().collect(Collectors.toMap(XKGamesDTO.DataBean::getGameId, e -> e));
|
||||
XKGamesDTO.DataBean gamesDataDTO = dataDTOMap.get(resultBean.getGameId());
|
||||
BigDecimal payoffAmount=BigDecimal.ZERO;
|
||||
|
||||
if (GameStatus.WIN.getCode().equals(resultBean.getStatus())) {
|
||||
payoffAmount = NumberUtil.sub(resultBean.getPayoffAmount(), resultBean.getTurnover());
|
||||
} else if (GameStatus.FAIL.getCode().equals(resultBean.getStatus())){
|
||||
payoffAmount = NumberUtil.sub(resultBean.getPayoffAmount(), resultBean.getTurnover()).negate();
|
||||
}
|
||||
//数据构造
|
||||
GameBettingDetails gameBettingDetails = GameBettingDetails.builder()
|
||||
//保存我们的币种id
|
||||
.currencyCode(systemByCode)
|
||||
.memberId(member.getId())
|
||||
.gameCode(resultBean.getGameId())
|
||||
.gameType(XKGameType.findSystemByCode(resultBean.getGameCategoryId()))
|
||||
.platformCode(GamePlatforms.XK.getCode())
|
||||
.gameId(gamesDataDTO.getSystemGameId())
|
||||
.gameName(gamesDataDTO.getName())
|
||||
.gameStatus(resultBean.getStatus())
|
||||
.gameStatusType(resultBean.getType())
|
||||
.gameCurrencyCode(resultBean.getAgentId())
|
||||
.account(String.valueOf(resultBean.getAccount()))
|
||||
.wagersId(resultBean.getWagersId())
|
||||
.wagersTime(resultBean.getWagersTime())
|
||||
.betAmount(resultBean.getBetAmount().abs())
|
||||
.payoffTime(resultBean.getPayoffTime())
|
||||
.payoffAmount(payoffAmount)
|
||||
.settlementTime(resultBean.getSettlementTime())
|
||||
.turnover(resultBean.getTurnover())
|
||||
.orderNo(String.valueOf(resultBean.getRoundIndex()))
|
||||
.build();
|
||||
gameBettingDetails.setCreateBy(Constants.SYSTEM);
|
||||
gameBettingDetails.setCreateTime(DateUtils.getNowDate());
|
||||
return gameBettingDetails;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.ff.game.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.game.domain.GameBettingDetails;
|
||||
import com.ff.game.service.IGameBettingDetailsService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 会员投注细目Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/game/details")
|
||||
public class GameBettingDetailsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IGameBettingDetailsService gameBettingDetailsService;
|
||||
|
||||
/**
|
||||
* 查询会员投注细目列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:details:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(GameBettingDetails gameBettingDetails)
|
||||
{
|
||||
startPage();
|
||||
List<GameBettingDetails> list = gameBettingDetailsService.selectGameBettingDetailsList(gameBettingDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出会员投注细目列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:details:export')")
|
||||
@Log(title = "会员投注细目", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GameBettingDetails gameBettingDetails)
|
||||
{
|
||||
List<GameBettingDetails> list = gameBettingDetailsService.selectGameBettingDetailsList(gameBettingDetails);
|
||||
ExcelUtil<GameBettingDetails> util = new ExcelUtil<GameBettingDetails>(GameBettingDetails.class);
|
||||
util.exportExcel(response, list, "会员投注细目数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员投注细目详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:details:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(gameBettingDetailsService.selectGameBettingDetailsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员投注细目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:details:add')")
|
||||
@Log(title = "会员投注细目", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody GameBettingDetails gameBettingDetails)
|
||||
{
|
||||
return toAjax(gameBettingDetailsService.insertGameBettingDetails(gameBettingDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员投注细目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:details:edit')")
|
||||
@Log(title = "会员投注细目", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody GameBettingDetails gameBettingDetails)
|
||||
{
|
||||
return toAjax(gameBettingDetailsService.updateGameBettingDetails(gameBettingDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员投注细目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:details:remove')")
|
||||
@Log(title = "会员投注细目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(gameBettingDetailsService.deleteGameBettingDetailsByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.ff.game.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.game.domain.Game;
|
||||
import com.ff.game.service.IGameService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 平台子游戏管理Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/game/game")
|
||||
public class GameController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IGameService gameService;
|
||||
|
||||
/**
|
||||
* 查询平台子游戏管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:game:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Game game)
|
||||
{
|
||||
startPage();
|
||||
List<Game> list = gameService.selectGameList(game);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出平台子游戏管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:game:export')")
|
||||
@Log(title = "平台子游戏管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Game game)
|
||||
{
|
||||
List<Game> list = gameService.selectGameList(game);
|
||||
ExcelUtil<Game> util = new ExcelUtil<Game>(Game.class);
|
||||
util.exportExcel(response, list, "平台子游戏管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取平台子游戏管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:game:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(gameService.selectGameById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增平台子游戏管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:game:add')")
|
||||
@Log(title = "平台子游戏管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Game game)
|
||||
{
|
||||
return toAjax(gameService.insertGame(game));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改平台子游戏管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:game:edit')")
|
||||
@Log(title = "平台子游戏管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Game game)
|
||||
{
|
||||
return toAjax(gameService.updateGame(game));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除平台子游戏管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:game:remove')")
|
||||
@Log(title = "平台子游戏管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(gameService.deleteGameByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.ff.game.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.game.domain.GameExchangeMoney;
|
||||
import com.ff.game.service.IGameExchangeMoneyService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/game/money")
|
||||
public class GameExchangeMoneyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IGameExchangeMoneyService gameExchangeMoneyService;
|
||||
|
||||
/**
|
||||
* 查询会员金额转移记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:money:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(GameExchangeMoney gameExchangeMoney)
|
||||
{
|
||||
startPage();
|
||||
List<GameExchangeMoney> list = gameExchangeMoneyService.selectGameExchangeMoneyList(gameExchangeMoney);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出会员金额转移记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:money:export')")
|
||||
@Log(title = "会员金额转移记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GameExchangeMoney gameExchangeMoney)
|
||||
{
|
||||
List<GameExchangeMoney> list = gameExchangeMoneyService.selectGameExchangeMoneyList(gameExchangeMoney);
|
||||
ExcelUtil<GameExchangeMoney> util = new ExcelUtil<GameExchangeMoney>(GameExchangeMoney.class);
|
||||
util.exportExcel(response, list, "会员金额转移记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员金额转移记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:money:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(gameExchangeMoneyService.selectGameExchangeMoneyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员金额转移记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:money:add')")
|
||||
@Log(title = "会员金额转移记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody GameExchangeMoney gameExchangeMoney)
|
||||
{
|
||||
return toAjax(gameExchangeMoneyService.insertGameExchangeMoney(gameExchangeMoney));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员金额转移记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:money:edit')")
|
||||
@Log(title = "会员金额转移记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody GameExchangeMoney gameExchangeMoney)
|
||||
{
|
||||
return toAjax(gameExchangeMoneyService.updateGameExchangeMoney(gameExchangeMoney));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员金额转移记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:money:remove')")
|
||||
@Log(title = "会员金额转移记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(gameExchangeMoneyService.deleteGameExchangeMoneyByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.ff.game.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.game.domain.GameFreeRecord;
|
||||
import com.ff.game.service.IGameFreeRecordService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 免费赠送游戏记录Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/game/record")
|
||||
public class GameFreeRecordController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IGameFreeRecordService gameFreeRecordService;
|
||||
|
||||
/**
|
||||
* 查询免费赠送游戏记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:record:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(GameFreeRecord gameFreeRecord)
|
||||
{
|
||||
startPage();
|
||||
List<GameFreeRecord> list = gameFreeRecordService.selectGameFreeRecordList(gameFreeRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出免费赠送游戏记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:record:export')")
|
||||
@Log(title = "免费赠送游戏记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GameFreeRecord gameFreeRecord)
|
||||
{
|
||||
List<GameFreeRecord> list = gameFreeRecordService.selectGameFreeRecordList(gameFreeRecord);
|
||||
ExcelUtil<GameFreeRecord> util = new ExcelUtil<GameFreeRecord>(GameFreeRecord.class);
|
||||
util.exportExcel(response, list, "免费赠送游戏记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取免费赠送游戏记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:record:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(gameFreeRecordService.selectGameFreeRecordById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增免费赠送游戏记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:record:add')")
|
||||
@Log(title = "免费赠送游戏记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody GameFreeRecord gameFreeRecord)
|
||||
{
|
||||
return toAjax(gameFreeRecordService.insertGameFreeRecord(gameFreeRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改免费赠送游戏记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:record:edit')")
|
||||
@Log(title = "免费赠送游戏记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody GameFreeRecord gameFreeRecord)
|
||||
{
|
||||
return toAjax(gameFreeRecordService.updateGameFreeRecord(gameFreeRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除免费赠送游戏记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:record:remove')")
|
||||
@Log(title = "免费赠送游戏记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(gameFreeRecordService.deleteGameFreeRecordByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.ff.game.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.game.domain.GamePlatform;
|
||||
import com.ff.game.service.IGamePlatformService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 平台管理Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/game/platform")
|
||||
public class GamePlatformController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IGamePlatformService gamePlatformService;
|
||||
|
||||
/**
|
||||
* 查询平台管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:platform:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(GamePlatform gamePlatform)
|
||||
{
|
||||
startPage();
|
||||
List<GamePlatform> list = gamePlatformService.selectGamePlatformList(gamePlatform);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出平台管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:platform:export')")
|
||||
@Log(title = "平台管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GamePlatform gamePlatform)
|
||||
{
|
||||
List<GamePlatform> list = gamePlatformService.selectGamePlatformList(gamePlatform);
|
||||
ExcelUtil<GamePlatform> util = new ExcelUtil<GamePlatform>(GamePlatform.class);
|
||||
util.exportExcel(response, list, "平台管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取平台管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:platform:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(gamePlatformService.selectGamePlatformById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增平台管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:platform:add')")
|
||||
@Log(title = "平台管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody GamePlatform gamePlatform)
|
||||
{
|
||||
return toAjax(gamePlatformService.insertGamePlatform(gamePlatform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改平台管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:platform:edit')")
|
||||
@Log(title = "平台管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody GamePlatform gamePlatform)
|
||||
{
|
||||
return toAjax(gamePlatformService.updateGamePlatform(gamePlatform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除平台管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:platform:remove')")
|
||||
@Log(title = "平台管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(gamePlatformService.deleteGamePlatformByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.ff.game.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.game.domain.GameSecretKey;
|
||||
import com.ff.game.service.IGameSecretKeyService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 游戏平台密钥管理Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/game/key")
|
||||
public class GameSecretKeyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IGameSecretKeyService gameSecretKeyService;
|
||||
|
||||
/**
|
||||
* 查询游戏平台密钥管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:key:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(GameSecretKey gameSecretKey)
|
||||
{
|
||||
startPage();
|
||||
List<GameSecretKey> list = gameSecretKeyService.selectGameSecretKeyList(gameSecretKey);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出游戏平台密钥管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:key:export')")
|
||||
@Log(title = "游戏平台密钥管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GameSecretKey gameSecretKey)
|
||||
{
|
||||
List<GameSecretKey> list = gameSecretKeyService.selectGameSecretKeyList(gameSecretKey);
|
||||
ExcelUtil<GameSecretKey> util = new ExcelUtil<GameSecretKey>(GameSecretKey.class);
|
||||
util.exportExcel(response, list, "游戏平台密钥管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取游戏平台密钥管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:key:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(gameSecretKeyService.selectGameSecretKeyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增游戏平台密钥管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:key:add')")
|
||||
@Log(title = "游戏平台密钥管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody GameSecretKey gameSecretKey)
|
||||
{
|
||||
return toAjax(gameSecretKeyService.insertGameSecretKey(gameSecretKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改游戏平台密钥管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:key:edit')")
|
||||
@Log(title = "游戏平台密钥管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody GameSecretKey gameSecretKey)
|
||||
{
|
||||
return toAjax(gameSecretKeyService.updateGameSecretKey(gameSecretKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除游戏平台密钥管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('game:key:remove')")
|
||||
@Log(title = "游戏平台密钥管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(gameSecretKeyService.deleteGameSecretKeyByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.ff.game.domain;
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 平台子游戏管理对象 ff_game
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class Game extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Integer sortNo;
|
||||
|
||||
/** 游戏平台id */
|
||||
@Excel(name = "游戏平台id")
|
||||
private Long platformId;
|
||||
|
||||
/** 游戏第三方id */
|
||||
@Excel(name = "游戏第三方id")
|
||||
private Integer gameCode;
|
||||
|
||||
/** 第三方来源分类 */
|
||||
@Excel(name = "第三方来源分类")
|
||||
private Integer gameSourceType;
|
||||
|
||||
/** 游戏名称 */
|
||||
@Excel(name = "游戏名称")
|
||||
private String gameName;
|
||||
|
||||
/** 是否支持免费游戏 1 支持 0 不支持 */
|
||||
@Excel(name = "是否支持免费游戏 1 支持 0 不支持")
|
||||
private Boolean freespin;
|
||||
|
||||
/** 是否支持试玩 0关闭 1开启 */
|
||||
@Excel(name = "是否支持试玩 0关闭 1开启")
|
||||
private Boolean demoStatus;
|
||||
|
||||
/** 维护开关 维护状态 0关闭 1开启 */
|
||||
@Excel(name = "维护开关 维护状态 0关闭 1开启")
|
||||
private Boolean stopStatus;
|
||||
|
||||
/** 游戏开关 平台开关状态 0关闭 1开启 */
|
||||
@Excel(name = "游戏开关 平台开关状态 0关闭 1开启")
|
||||
private Boolean gameStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.ff.game.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 会员投注细目对象 ff_game_betting_details
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class GameBettingDetails extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 币种编码 */
|
||||
@Excel(name = "币种编码")
|
||||
private String currencyCode;
|
||||
|
||||
/** 会员id */
|
||||
@Excel(name = "会员id")
|
||||
private Long memberId;
|
||||
|
||||
/** 游戏id */
|
||||
@Excel(name = "游戏id ")
|
||||
private Integer gameCode;
|
||||
|
||||
/** 游戏id */
|
||||
@Excel(name = "游戏id")
|
||||
private Long gameId;
|
||||
|
||||
/** 游戏类型 ff_game_type 字典 */
|
||||
@Excel(name = "游戏类型 ff_game_type 字典")
|
||||
private Long gameType;
|
||||
|
||||
/** 游戏平台 */
|
||||
@Excel(name = "游戏平台 ")
|
||||
private String platformCode;
|
||||
|
||||
/** 游戏名称 */
|
||||
@Excel(name = "游戏名称")
|
||||
private String gameName;
|
||||
|
||||
/** 注单状态 1: 赢 2: 输 3: 平局 */
|
||||
@Excel(name = "注单状态 1: 赢 2: 输 3: 平局")
|
||||
private Integer gameStatus;
|
||||
|
||||
/** 注单类型 */
|
||||
@Excel(name = "注单类型")
|
||||
private Integer gameStatusType;
|
||||
|
||||
/** 游戏币种类型 */
|
||||
@Excel(name = "游戏币种类型")
|
||||
private String gameCurrencyCode;
|
||||
|
||||
/** 游戏账号 */
|
||||
@Excel(name = "游戏账号")
|
||||
private String account;
|
||||
|
||||
/** 游戏注单唯一值 */
|
||||
@Excel(name = "游戏注单唯一值")
|
||||
private Long wagersId;
|
||||
|
||||
/** 投注时间 (Unix 时间戳) */
|
||||
@Excel(name = "投注时间 (Unix 时间戳)")
|
||||
private Long wagersTime;
|
||||
|
||||
/** 投注金额 */
|
||||
@Excel(name = "投注金额")
|
||||
private BigDecimal betAmount;
|
||||
|
||||
/** 派彩时间 (Unix 时间戳) */
|
||||
@Excel(name = "派彩时间 (Unix 时间戳)")
|
||||
private Long payoffTime;
|
||||
|
||||
/** 派彩金额 */
|
||||
@Excel(name = "派彩金额")
|
||||
private BigDecimal payoffAmount;
|
||||
|
||||
/** 对帐时间 (Unix 时间戳) */
|
||||
@Excel(name = "对帐时间 (Unix 时间戳)")
|
||||
private Long settlementTime;
|
||||
|
||||
/** 有效投注金额 ※注 1 */
|
||||
@Excel(name = "有效投注金额 ※注 1")
|
||||
private BigDecimal turnover;
|
||||
|
||||
/** 订单id */
|
||||
@Excel(name = "订单id")
|
||||
private String orderNo;
|
||||
|
||||
/** 结算状态 1 未结算 2已结算 3 已撤单 */
|
||||
@Excel(name = "结算状态 1 未结算 2已结算 3 已撤单")
|
||||
private Integer settlementStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.ff.game.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录对象 ff_game_exchange_money
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class GameExchangeMoney extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 币种编码 */
|
||||
@Excel(name = "币种编码")
|
||||
private String currencyCode;
|
||||
|
||||
/** 交易id */
|
||||
@Excel(name = "交易id")
|
||||
private String transactionId;
|
||||
|
||||
/** 会员id */
|
||||
@Excel(name = "会员id")
|
||||
private Long memberId;
|
||||
|
||||
/** 游戏平台 */
|
||||
@Excel(name = "游戏平台 ")
|
||||
private String platformCode;
|
||||
|
||||
/** 平台id */
|
||||
@Excel(name = "平台id")
|
||||
private Long platformId;
|
||||
|
||||
/** 操作金额 */
|
||||
@Excel(name = "操作金额")
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 租户操作额度 */
|
||||
@Excel(name = "租户操作额度")
|
||||
private BigDecimal quota;
|
||||
|
||||
/** 转账前金额(游戏币) */
|
||||
@Excel(name = " 转账前金额(游戏币)")
|
||||
private BigDecimal coinBefore;
|
||||
|
||||
/** 转账后金额(游戏币) */
|
||||
@Excel(name = "转账后金额(游戏币)")
|
||||
private BigDecimal coinAfter;
|
||||
|
||||
/** 转账前金额(指定货币) */
|
||||
@Excel(name = "转账前金额(指定货币)")
|
||||
private BigDecimal currencyBefore;
|
||||
|
||||
/** 转账后金额(指定货币) */
|
||||
@Excel(name = "转账后金额(指定货币)")
|
||||
private BigDecimal currencyAfter;
|
||||
|
||||
/** 转出类型 1游戏商转入到用户全部转出 2 用户转移到游戏商 3 游戏商转移额度到平台商 */
|
||||
@Excel(name = "转出类型 1游戏商转入到用户全部转出 2 用户转移到游戏商 3 游戏商转移额度到平台商")
|
||||
private Integer exchangeType;
|
||||
|
||||
/** 状态 1 成功 2失败 */
|
||||
@Excel(name = "状态 1 成功 2失败")
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.ff.game.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 免费赠送游戏记录对象 ff_game_free_record
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class GameFreeRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 币种编码 */
|
||||
@Excel(name = "币种编码")
|
||||
private String currencyCode;
|
||||
|
||||
/** 免费局数序号(唯一标识符) */
|
||||
@Excel(name = "免费局数序号", readConverterExp = "唯=一标识符")
|
||||
private String referenceId;
|
||||
|
||||
/** 会员id */
|
||||
@Excel(name = "会员id")
|
||||
private Long memberId;
|
||||
|
||||
/** 用户账号 */
|
||||
@Excel(name = "用户账号")
|
||||
private String memberAccount;
|
||||
|
||||
/** 游戏id */
|
||||
@Excel(name = "游戏id ")
|
||||
private Long gameId;
|
||||
|
||||
/** 免费游戏局数可使用的开始时间 */
|
||||
@Excel(name = "免费游戏局数可使用的开始时间")
|
||||
private Long sendTime;
|
||||
|
||||
/** 免费局数过期时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "免费局数过期时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Long expiredTime;
|
||||
|
||||
/** 免费局数记录更新时间 */
|
||||
@Excel(name = "免费局数记录更新时间")
|
||||
private Long freeUpdateTime;
|
||||
|
||||
/** 免费局数赠送的游戏名称 */
|
||||
@Excel(name = "免费局数赠送的游戏名称")
|
||||
private String sendGame;
|
||||
|
||||
/** 免费局数赠送的数量 */
|
||||
@Excel(name = "免费局数赠送的数量")
|
||||
private Integer sendAmount;
|
||||
|
||||
/** 已使用的免费局数数量 */
|
||||
@Excel(name = "已使用的免费局数数量")
|
||||
private Integer usedAmount;
|
||||
|
||||
/** 未使用的免费局数数量 */
|
||||
@Excel(name = "未使用的免费局数数量")
|
||||
private Integer unusedAmount;
|
||||
|
||||
/** 免费状态 1正常 0 取消 */
|
||||
@Excel(name = "免费状态 1正常 0 取消 ")
|
||||
private Integer freeStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.ff.game.domain;
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 平台管理对象 ff_game_platform
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class GamePlatform extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Integer sortNo;
|
||||
|
||||
/** 平台编码 */
|
||||
@Excel(name = "平台编码")
|
||||
private String platformCode;
|
||||
|
||||
/** 平台类型 ff_game_type 字典 */
|
||||
@Excel(name = "平台类型 ff_game_platform_type 字典")
|
||||
private Long platformType;
|
||||
|
||||
/** 平台名称 */
|
||||
@Excel(name = "平台名称")
|
||||
private String platformName;
|
||||
|
||||
/** 维护开关 维护状态 1 开启 2关闭 */
|
||||
@Excel(name = "维护开关 维护状态 1 开启 2关闭")
|
||||
private Integer stopStatus;
|
||||
|
||||
/** 平台开关 平台开关状态 1 开启 2关闭 */
|
||||
@Excel(name = "平台开关 平台开关状态 1 开启 2关闭")
|
||||
private Integer platformStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.ff.game.domain;
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 游戏平台密钥管理对象 ff_game_secret_key
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
public class GameSecretKey extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 平台 */
|
||||
@Excel(name = "平台")
|
||||
private String platform;
|
||||
|
||||
/** 代码 */
|
||||
@Excel(name = "代码")
|
||||
private String code;
|
||||
|
||||
/** 密钥 */
|
||||
@Excel(name = "密钥")
|
||||
private String key;
|
||||
|
||||
/** 系统代码 */
|
||||
@Excel(name = "系统代码")
|
||||
private String systemCode;
|
||||
|
||||
/** 语言 */
|
||||
@Excel(name = "语言")
|
||||
private String lang;
|
||||
|
||||
/** 系统语种id */
|
||||
@Excel(name = "系统语种id")
|
||||
private String systemLangCode;
|
||||
|
||||
/** 信息 */
|
||||
@Excel(name = "信息")
|
||||
private String info;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.game.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.game.domain.GameBettingDetails;
|
||||
|
||||
/**
|
||||
* 会员投注细目Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface GameBettingDetailsMapper
|
||||
{
|
||||
/**
|
||||
* 查询会员投注细目
|
||||
*
|
||||
* @param id 会员投注细目主键
|
||||
* @return 会员投注细目
|
||||
*/
|
||||
GameBettingDetails selectGameBettingDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员投注细目列表
|
||||
*
|
||||
* @param gameBettingDetails 会员投注细目
|
||||
* @return 会员投注细目集合
|
||||
*/
|
||||
List<GameBettingDetails> selectGameBettingDetailsList(GameBettingDetails gameBettingDetails);
|
||||
|
||||
/**
|
||||
* 新增会员投注细目
|
||||
*
|
||||
* @param gameBettingDetails 会员投注细目
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGameBettingDetails(GameBettingDetails gameBettingDetails);
|
||||
|
||||
/**
|
||||
* 修改会员投注细目
|
||||
*
|
||||
* @param gameBettingDetails 会员投注细目
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGameBettingDetails(GameBettingDetails gameBettingDetails);
|
||||
|
||||
/**
|
||||
* 删除会员投注细目
|
||||
*
|
||||
* @param id 会员投注细目主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameBettingDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除会员投注细目
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameBettingDetailsByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.game.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.game.domain.GameExchangeMoney;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface GameExchangeMoneyMapper
|
||||
{
|
||||
/**
|
||||
* 查询会员金额转移记录
|
||||
*
|
||||
* @param id 会员金额转移记录主键
|
||||
* @return 会员金额转移记录
|
||||
*/
|
||||
GameExchangeMoney selectGameExchangeMoneyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员金额转移记录列表
|
||||
*
|
||||
* @param gameExchangeMoney 会员金额转移记录
|
||||
* @return 会员金额转移记录集合
|
||||
*/
|
||||
List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney);
|
||||
|
||||
/**
|
||||
* 新增会员金额转移记录
|
||||
*
|
||||
* @param gameExchangeMoney 会员金额转移记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
|
||||
|
||||
/**
|
||||
* 修改会员金额转移记录
|
||||
*
|
||||
* @param gameExchangeMoney 会员金额转移记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
|
||||
|
||||
/**
|
||||
* 删除会员金额转移记录
|
||||
*
|
||||
* @param id 会员金额转移记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameExchangeMoneyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除会员金额转移记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameExchangeMoneyByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.game.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.game.domain.GameFreeRecord;
|
||||
|
||||
/**
|
||||
* 免费赠送游戏记录Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface GameFreeRecordMapper
|
||||
{
|
||||
/**
|
||||
* 查询免费赠送游戏记录
|
||||
*
|
||||
* @param id 免费赠送游戏记录主键
|
||||
* @return 免费赠送游戏记录
|
||||
*/
|
||||
GameFreeRecord selectGameFreeRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询免费赠送游戏记录列表
|
||||
*
|
||||
* @param gameFreeRecord 免费赠送游戏记录
|
||||
* @return 免费赠送游戏记录集合
|
||||
*/
|
||||
List<GameFreeRecord> selectGameFreeRecordList(GameFreeRecord gameFreeRecord);
|
||||
|
||||
/**
|
||||
* 新增免费赠送游戏记录
|
||||
*
|
||||
* @param gameFreeRecord 免费赠送游戏记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGameFreeRecord(GameFreeRecord gameFreeRecord);
|
||||
|
||||
/**
|
||||
* 修改免费赠送游戏记录
|
||||
*
|
||||
* @param gameFreeRecord 免费赠送游戏记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGameFreeRecord(GameFreeRecord gameFreeRecord);
|
||||
|
||||
/**
|
||||
* 删除免费赠送游戏记录
|
||||
*
|
||||
* @param id 免费赠送游戏记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameFreeRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除免费赠送游戏记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameFreeRecordByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.ff.game.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.game.api.request.GameUniqueDTO;
|
||||
import com.ff.game.domain.Game;
|
||||
|
||||
/**
|
||||
* 平台子游戏管理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface GameMapper
|
||||
{
|
||||
/**
|
||||
* 查询平台子游戏管理
|
||||
*
|
||||
* @param id 平台子游戏管理主键
|
||||
* @return 平台子游戏管理
|
||||
*/
|
||||
Game selectGameById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台子游戏管理列表
|
||||
*
|
||||
* @param game 平台子游戏管理
|
||||
* @return 平台子游戏管理集合
|
||||
*/
|
||||
List<Game> selectGameList(Game game);
|
||||
|
||||
/**
|
||||
* 新增平台子游戏管理
|
||||
*
|
||||
* @param game 平台子游戏管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGame(Game game);
|
||||
|
||||
/**
|
||||
* 修改平台子游戏管理
|
||||
*
|
||||
* @param game 平台子游戏管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGame(Game game);
|
||||
|
||||
/**
|
||||
* 删除平台子游戏管理
|
||||
*
|
||||
* @param id 平台子游戏管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除平台子游戏管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 按平台id选择最大排序号
|
||||
*
|
||||
* @param platformId 平台id
|
||||
* @return {@link Integer }
|
||||
*/
|
||||
Integer selectMaxSortNoByPlatformId(Long platformId);
|
||||
|
||||
|
||||
/**
|
||||
* 选择游戏唯一列表
|
||||
*
|
||||
* @param gameUniqueDTO 游戏独有dto
|
||||
* @return {@link List }<{@link Game }>
|
||||
*/
|
||||
List<Game> selectGameUniqueList(GameUniqueDTO gameUniqueDTO);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.ff.game.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.game.domain.GamePlatform;
|
||||
|
||||
/**
|
||||
* 平台管理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface GamePlatformMapper
|
||||
{
|
||||
/**
|
||||
* 查询平台管理
|
||||
*
|
||||
* @param id 平台管理主键
|
||||
* @return 平台管理
|
||||
*/
|
||||
GamePlatform selectGamePlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台管理列表
|
||||
*
|
||||
* @param gamePlatform 平台管理
|
||||
* @return 平台管理集合
|
||||
*/
|
||||
List<GamePlatform> selectGamePlatformList(GamePlatform gamePlatform);
|
||||
|
||||
/**
|
||||
* 新增平台管理
|
||||
*
|
||||
* @param gamePlatform 平台管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGamePlatform(GamePlatform gamePlatform);
|
||||
|
||||
/**
|
||||
* 修改平台管理
|
||||
*
|
||||
* @param gamePlatform 平台管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGamePlatform(GamePlatform gamePlatform);
|
||||
|
||||
/**
|
||||
* 删除平台管理
|
||||
*
|
||||
* @param id 平台管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGamePlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除平台管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGamePlatformByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 选择最大排序号
|
||||
*
|
||||
* @return {@link Integer }
|
||||
*/
|
||||
Integer selectMaxSortNo();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.ff.game.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
import com.ff.game.domain.GameSecretKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 游戏平台密钥管理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface GameSecretKeyMapper
|
||||
{
|
||||
/**
|
||||
* 查询游戏平台密钥管理
|
||||
*
|
||||
* @param id 游戏平台密钥管理主键
|
||||
* @return 游戏平台密钥管理
|
||||
*/
|
||||
GameSecretKey selectGameSecretKeyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询游戏平台密钥管理列表
|
||||
*
|
||||
* @param gameSecretKey 游戏平台密钥管理
|
||||
* @return 游戏平台密钥管理集合
|
||||
*/
|
||||
List<GameSecretKey> selectGameSecretKeyList(GameSecretKey gameSecretKey);
|
||||
|
||||
/**
|
||||
* 新增游戏平台密钥管理
|
||||
*
|
||||
* @param gameSecretKey 游戏平台密钥管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGameSecretKey(GameSecretKey gameSecretKey);
|
||||
|
||||
/**
|
||||
* 修改游戏平台密钥管理
|
||||
*
|
||||
* @param gameSecretKey 游戏平台密钥管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGameSecretKey(GameSecretKey gameSecretKey);
|
||||
|
||||
/**
|
||||
* 删除游戏平台密钥管理
|
||||
*
|
||||
* @param id 游戏平台密钥管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameSecretKeyById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除游戏平台密钥管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameSecretKeyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 按代码查找系统
|
||||
*
|
||||
* @param code 代码
|
||||
* @return {@link String }
|
||||
*/
|
||||
String findSystemByCode(@Param("code") String code, @Param("platform")String platform);
|
||||
|
||||
/**
|
||||
* 通过平台和系统代码查找密钥
|
||||
*
|
||||
* @param platform 平台
|
||||
* @param systemCode 系统代码
|
||||
* @return {@link TenantSecretKey }
|
||||
*/
|
||||
GameSecretKey findSecretKeyByPlatformAndSystemCode(@Param("platform") String platform, @Param("systemCode") String systemCode);
|
||||
|
||||
/**
|
||||
* 按平台和系统查找lang代码
|
||||
*
|
||||
* @param platform 平台
|
||||
* @param systemLangCode 系统语言代码
|
||||
* @return {@link GameSecretKey }
|
||||
*/
|
||||
GameSecretKey findByPlatformAndSystemLangCode(@Param("platform") String platform, @Param("systemLangCode") String systemLangCode);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.game.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.game.domain.GameBettingDetails;
|
||||
|
||||
/**
|
||||
* 会员投注细目Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface IGameBettingDetailsService
|
||||
{
|
||||
/**
|
||||
* 查询会员投注细目
|
||||
*
|
||||
* @param id 会员投注细目主键
|
||||
* @return 会员投注细目
|
||||
*/
|
||||
GameBettingDetails selectGameBettingDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员投注细目列表
|
||||
*
|
||||
* @param gameBettingDetails 会员投注细目
|
||||
* @return 会员投注细目集合
|
||||
*/
|
||||
List<GameBettingDetails> selectGameBettingDetailsList(GameBettingDetails gameBettingDetails);
|
||||
|
||||
/**
|
||||
* 新增会员投注细目
|
||||
*
|
||||
* @param gameBettingDetails 会员投注细目
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGameBettingDetails(GameBettingDetails gameBettingDetails);
|
||||
|
||||
/**
|
||||
* 修改会员投注细目
|
||||
*
|
||||
* @param gameBettingDetails 会员投注细目
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGameBettingDetails(GameBettingDetails gameBettingDetails);
|
||||
|
||||
/**
|
||||
* 批量删除会员投注细目
|
||||
*
|
||||
* @param ids 需要删除的会员投注细目主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameBettingDetailsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除会员投注细目信息
|
||||
*
|
||||
* @param id 会员投注细目主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameBettingDetailsById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.game.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.game.domain.GameExchangeMoney;
|
||||
|
||||
/**
|
||||
* 会员金额转移记录Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface IGameExchangeMoneyService
|
||||
{
|
||||
/**
|
||||
* 查询会员金额转移记录
|
||||
*
|
||||
* @param id 会员金额转移记录主键
|
||||
* @return 会员金额转移记录
|
||||
*/
|
||||
GameExchangeMoney selectGameExchangeMoneyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询会员金额转移记录列表
|
||||
*
|
||||
* @param gameExchangeMoney 会员金额转移记录
|
||||
* @return 会员金额转移记录集合
|
||||
*/
|
||||
List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney);
|
||||
|
||||
/**
|
||||
* 新增会员金额转移记录
|
||||
*
|
||||
* @param gameExchangeMoney 会员金额转移记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
|
||||
|
||||
/**
|
||||
* 修改会员金额转移记录
|
||||
*
|
||||
* @param gameExchangeMoney 会员金额转移记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
|
||||
|
||||
/**
|
||||
* 批量删除会员金额转移记录
|
||||
*
|
||||
* @param ids 需要删除的会员金额转移记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameExchangeMoneyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除会员金额转移记录信息
|
||||
*
|
||||
* @param id 会员金额转移记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameExchangeMoneyById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.game.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.game.domain.GameFreeRecord;
|
||||
|
||||
/**
|
||||
* 免费赠送游戏记录Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface IGameFreeRecordService
|
||||
{
|
||||
/**
|
||||
* 查询免费赠送游戏记录
|
||||
*
|
||||
* @param id 免费赠送游戏记录主键
|
||||
* @return 免费赠送游戏记录
|
||||
*/
|
||||
GameFreeRecord selectGameFreeRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询免费赠送游戏记录列表
|
||||
*
|
||||
* @param gameFreeRecord 免费赠送游戏记录
|
||||
* @return 免费赠送游戏记录集合
|
||||
*/
|
||||
List<GameFreeRecord> selectGameFreeRecordList(GameFreeRecord gameFreeRecord);
|
||||
|
||||
/**
|
||||
* 新增免费赠送游戏记录
|
||||
*
|
||||
* @param gameFreeRecord 免费赠送游戏记录
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGameFreeRecord(GameFreeRecord gameFreeRecord);
|
||||
|
||||
/**
|
||||
* 修改免费赠送游戏记录
|
||||
*
|
||||
* @param gameFreeRecord 免费赠送游戏记录
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGameFreeRecord(GameFreeRecord gameFreeRecord);
|
||||
|
||||
/**
|
||||
* 批量删除免费赠送游戏记录
|
||||
*
|
||||
* @param ids 需要删除的免费赠送游戏记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameFreeRecordByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除免费赠送游戏记录信息
|
||||
*
|
||||
* @param id 免费赠送游戏记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameFreeRecordById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.ff.game.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.game.domain.GamePlatform;
|
||||
|
||||
/**
|
||||
* 平台管理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface IGamePlatformService
|
||||
{
|
||||
/**
|
||||
* 查询平台管理
|
||||
*
|
||||
* @param id 平台管理主键
|
||||
* @return 平台管理
|
||||
*/
|
||||
GamePlatform selectGamePlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台管理列表
|
||||
*
|
||||
* @param gamePlatform 平台管理
|
||||
* @return 平台管理集合
|
||||
*/
|
||||
List<GamePlatform> selectGamePlatformList(GamePlatform gamePlatform);
|
||||
|
||||
/**
|
||||
* 新增平台管理
|
||||
*
|
||||
* @param gamePlatform 平台管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGamePlatform(GamePlatform gamePlatform);
|
||||
|
||||
/**
|
||||
* 修改平台管理
|
||||
*
|
||||
* @param gamePlatform 平台管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGamePlatform(GamePlatform gamePlatform);
|
||||
|
||||
/**
|
||||
* 批量删除平台管理
|
||||
*
|
||||
* @param ids 需要删除的平台管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGamePlatformByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除平台管理信息
|
||||
*
|
||||
* @param id 平台管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGamePlatformById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 选择最大排序号
|
||||
*
|
||||
* @return {@link Integer }
|
||||
*/
|
||||
Integer selectMaxSortNo();
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.ff.game.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.common.domain.TenantSecretKey;
|
||||
import com.ff.game.domain.GameSecretKey;
|
||||
|
||||
/**
|
||||
* 游戏平台密钥管理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface IGameSecretKeyService
|
||||
{
|
||||
/**
|
||||
* 查询游戏平台密钥管理
|
||||
*
|
||||
* @param id 游戏平台密钥管理主键
|
||||
* @return 游戏平台密钥管理
|
||||
*/
|
||||
GameSecretKey selectGameSecretKeyById(Long id);
|
||||
|
||||
/**
|
||||
* 查询游戏平台密钥管理列表
|
||||
*
|
||||
* @param gameSecretKey 游戏平台密钥管理
|
||||
* @return 游戏平台密钥管理集合
|
||||
*/
|
||||
List<GameSecretKey> selectGameSecretKeyList(GameSecretKey gameSecretKey);
|
||||
|
||||
/**
|
||||
* 新增游戏平台密钥管理
|
||||
*
|
||||
* @param gameSecretKey 游戏平台密钥管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGameSecretKey(GameSecretKey gameSecretKey);
|
||||
|
||||
/**
|
||||
* 修改游戏平台密钥管理
|
||||
*
|
||||
* @param gameSecretKey 游戏平台密钥管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGameSecretKey(GameSecretKey gameSecretKey);
|
||||
|
||||
/**
|
||||
* 批量删除游戏平台密钥管理
|
||||
*
|
||||
* @param ids 需要删除的游戏平台密钥管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameSecretKeyByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除游戏平台密钥管理信息
|
||||
*
|
||||
* @param id 游戏平台密钥管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameSecretKeyById(Long id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 按代码查找系统
|
||||
*
|
||||
* @param code 代码
|
||||
* @param platform 平台
|
||||
* @return {@link String }
|
||||
*/
|
||||
String findSystemByCode( String code,String platform);
|
||||
|
||||
/**
|
||||
* 通过平台和系统代码查找密钥
|
||||
*
|
||||
* @param platform 平台
|
||||
* @param systemCode 系统代码
|
||||
* @return {@link GameSecretKey }
|
||||
*/
|
||||
GameSecretKey findSecretKeyByPlatformAndSystemCode(String platform, String systemCode);
|
||||
|
||||
|
||||
/**
|
||||
* 按平台和系统查找lang代码
|
||||
*
|
||||
* @param platform 平台
|
||||
* @param systemLangCode 系统语言代码
|
||||
* @return {@link GameSecretKey }
|
||||
*/
|
||||
GameSecretKey findByPlatformAndSystemLangCode( String platform,String systemLangCode);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.ff.game.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.game.api.request.GameUniqueDTO;
|
||||
import com.ff.game.domain.Game;
|
||||
|
||||
/**
|
||||
* 平台子游戏管理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
public interface IGameService
|
||||
{
|
||||
/**
|
||||
* 查询平台子游戏管理
|
||||
*
|
||||
* @param id 平台子游戏管理主键
|
||||
* @return 平台子游戏管理
|
||||
*/
|
||||
Game selectGameById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台子游戏管理列表
|
||||
*
|
||||
* @param game 平台子游戏管理
|
||||
* @return 平台子游戏管理集合
|
||||
*/
|
||||
List<Game> selectGameList(Game game);
|
||||
|
||||
/**
|
||||
* 新增平台子游戏管理
|
||||
*
|
||||
* @param game 平台子游戏管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertGame(Game game);
|
||||
|
||||
/**
|
||||
* 修改平台子游戏管理
|
||||
*
|
||||
* @param game 平台子游戏管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateGame(Game game);
|
||||
|
||||
/**
|
||||
* 批量删除平台子游戏管理
|
||||
*
|
||||
* @param ids 需要删除的平台子游戏管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除平台子游戏管理信息
|
||||
*
|
||||
* @param id 平台子游戏管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteGameById(Long id);
|
||||
|
||||
/**
|
||||
* 按平台id选择最大排序号
|
||||
*
|
||||
* @param platformId 平台id
|
||||
* @return {@link Integer }
|
||||
*/
|
||||
Integer selectMaxSortNoByPlatformId(Long platformId);
|
||||
|
||||
/**
|
||||
* 选择游戏唯一列表
|
||||
*
|
||||
* @param gameUniqueDTO 游戏独有dto
|
||||
* @return {@link List }<{@link Game }>
|
||||
*/
|
||||
List<Game> selectGameUniqueList(GameUniqueDTO gameUniqueDTO);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.ff.game.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.game.mapper.GameBettingDetailsMapper;
|
||||
import com.ff.game.domain.GameBettingDetails;
|
||||
import com.ff.game.service.IGameBettingDetailsService;
|
||||
|
||||
/**
|
||||
* 会员投注细目Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Service
|
||||
public class GameBettingDetailsServiceImpl implements IGameBettingDetailsService
|
||||
{
|
||||
@Autowired
|
||||
private GameBettingDetailsMapper gameBettingDetailsMapper;
|
||||
|
||||
/**
|
||||
* 查询会员投注细目
|
||||
*
|
||||
* @param id 会员投注细目主键
|
||||
* @return 会员投注细目
|
||||
*/
|
||||
@Override
|
||||
public GameBettingDetails selectGameBettingDetailsById(Long id)
|
||||
{
|
||||
return gameBettingDetailsMapper.selectGameBettingDetailsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员投注细目列表
|
||||
*
|
||||
* @param gameBettingDetails 会员投注细目
|
||||
* @return 会员投注细目
|
||||
*/
|
||||
@Override
|
||||
public List<GameBettingDetails> selectGameBettingDetailsList(GameBettingDetails gameBettingDetails)
|
||||
{
|
||||
return gameBettingDetailsMapper.selectGameBettingDetailsList(gameBettingDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员投注细目
|
||||
*
|
||||
* @param gameBettingDetails 会员投注细目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGameBettingDetails(GameBettingDetails gameBettingDetails)
|
||||
{
|
||||
gameBettingDetails.setCreateTime(DateUtils.getNowDate());
|
||||
return gameBettingDetailsMapper.insertGameBettingDetails(gameBettingDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员投注细目
|
||||
*
|
||||
* @param gameBettingDetails 会员投注细目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGameBettingDetails(GameBettingDetails gameBettingDetails)
|
||||
{
|
||||
gameBettingDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
return gameBettingDetailsMapper.updateGameBettingDetails(gameBettingDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员投注细目
|
||||
*
|
||||
* @param ids 需要删除的会员投注细目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGameBettingDetailsByIds(Long[] ids)
|
||||
{
|
||||
return gameBettingDetailsMapper.deleteGameBettingDetailsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员投注细目信息
|
||||
*
|
||||
* @param id 会员投注细目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGameBettingDetailsById(Long id)
|
||||
{
|
||||
return gameBettingDetailsMapper.deleteGameBettingDetailsById(id);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue