feat(game): 添加 PP 游戏接口相关类和方法
- 新增 PP 游戏相关的常量和配置 - 添加 PP 游戏用户信息、登录、游戏列表等接口的请求和响应类- 实现 PP 游戏服务的基本功能,包括创建用户、获取游戏列表等 - 添加地址源和客户端接口,用于与 PP游戏服务器通信main-fb
parent
d293f638bf
commit
cc17d83e16
|
@ -233,6 +233,7 @@ public class GamesDGServiceImpl implements IGamesService {
|
|||
//没有此平台就新增一个平台
|
||||
if (ObjectUtils.isEmpty(gamePlatform)) {
|
||||
gamePlatform = new GamePlatform();
|
||||
gamePlatform.setId(PLATFORM_ID);
|
||||
gamePlatform.setPlatformCode(GamePlatforms.DG.getInfo());
|
||||
gamePlatform.setPlatformType(PlatformType.CARD_GAME.getCode());
|
||||
gamePlatform.setPlatformName(GamePlatforms.DG.getInfo() + PlatformType.CARD_GAME.getName());
|
||||
|
@ -244,6 +245,7 @@ public class GamesDGServiceImpl implements IGamesService {
|
|||
//不存在这个游戏
|
||||
if (ObjectUtils.isEmpty(game)) {
|
||||
game = new Game();
|
||||
game.setId(GAME_ID);
|
||||
game.setSortNo(gameService.selectMaxSortNoByPlatformId(gamePlatform.getId()) + 1);
|
||||
game.setPlatformId(gamePlatform.getId());
|
||||
game.setGameCode("1");
|
||||
|
@ -255,6 +257,7 @@ public class GamesDGServiceImpl implements IGamesService {
|
|||
GameName gameName = gameNameService.selectGameNameById(GAME_NAME_ID);
|
||||
if (ObjectUtils.isEmpty(gameName)) {
|
||||
gameNameService.insertGameName(GameName.builder()
|
||||
.id(GAME_NAME_ID)
|
||||
.gameId(game.getId())
|
||||
.gameName(game.getGameName())
|
||||
.langCode("zh-CN")
|
||||
|
|
|
@ -245,6 +245,7 @@ public class GamesSAServiceImpl implements IGamesService {
|
|||
//没有此平台就新增一个平台
|
||||
if (ObjectUtils.isEmpty(gamePlatform)) {
|
||||
gamePlatform = new GamePlatform();
|
||||
gamePlatform.setId(PLATFORM_ID);
|
||||
gamePlatform.setPlatformCode(GamePlatforms.SA.getInfo());
|
||||
gamePlatform.setPlatformType(PlatformType.CARD_GAME.getCode());
|
||||
gamePlatform.setPlatformName(GamePlatforms.SA.getInfo() + PlatformType.CARD_GAME.getName());
|
||||
|
@ -256,6 +257,7 @@ public class GamesSAServiceImpl implements IGamesService {
|
|||
//不存在这个游戏
|
||||
if (ObjectUtils.isEmpty(game)) {
|
||||
game = new Game();
|
||||
game.setId(GAME_ID);
|
||||
game.setSortNo(gameService.selectMaxSortNoByPlatformId(gamePlatform.getId()) + 1);
|
||||
game.setPlatformId(gamePlatform.getId());
|
||||
game.setGameCode("1");
|
||||
|
@ -267,6 +269,7 @@ public class GamesSAServiceImpl implements IGamesService {
|
|||
GameName gameName = gameNameService.selectGameNameById(GAME_NAME_ID);
|
||||
if (ObjectUtils.isEmpty(gameName)) {
|
||||
gameNameService.insertGameName(GameName.builder()
|
||||
.id(GAME_NAME_ID)
|
||||
.gameId(game.getId())
|
||||
.gameName(game.getGameName())
|
||||
.langCode("zh-CN")
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ff.game.service.impl;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.game.domain.GameName;
|
||||
import com.ff.game.dto.GameDTO;
|
||||
|
@ -20,8 +21,7 @@ import cn.hutool.core.util.IdUtil;
|
|||
* @date 2025-03-13
|
||||
*/
|
||||
@Service
|
||||
public class GameNameServiceImpl implements IGameNameService
|
||||
{
|
||||
public class GameNameServiceImpl implements IGameNameService {
|
||||
@Autowired
|
||||
private GameNameMapper gameNameMapper;
|
||||
|
||||
|
@ -32,8 +32,7 @@ public class GameNameServiceImpl implements IGameNameService
|
|||
* @return 平台子游戏名称管理
|
||||
*/
|
||||
@Override
|
||||
public GameName selectGameNameById(Long id)
|
||||
{
|
||||
public GameName selectGameNameById(Long id) {
|
||||
return gameNameMapper.selectGameNameById(id);
|
||||
}
|
||||
|
||||
|
@ -44,8 +43,7 @@ public class GameNameServiceImpl implements IGameNameService
|
|||
* @return 平台子游戏名称管理
|
||||
*/
|
||||
@Override
|
||||
public List<GameName> selectGameNameList(GameName gameName)
|
||||
{
|
||||
public List<GameName> selectGameNameList(GameName gameName) {
|
||||
return gameNameMapper.selectGameNameList(gameName);
|
||||
}
|
||||
|
||||
|
@ -56,9 +54,11 @@ public class GameNameServiceImpl implements IGameNameService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGameName(GameName gameName)
|
||||
{
|
||||
gameName.setId(IdUtil.getSnowflakeNextId());
|
||||
public int insertGameName(GameName gameName) {
|
||||
if (gameName.getId() == null) {
|
||||
gameName.setId(IdUtil.getSnowflakeNextId());
|
||||
}
|
||||
|
||||
gameName.setCreateTime(DateUtils.getNowDate());
|
||||
return gameNameMapper.insertGameName(gameName);
|
||||
}
|
||||
|
@ -70,8 +70,7 @@ public class GameNameServiceImpl implements IGameNameService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGameName(GameName gameName)
|
||||
{
|
||||
public int updateGameName(GameName gameName) {
|
||||
gameName.setUpdateTime(DateUtils.getNowDate());
|
||||
return gameNameMapper.updateGameName(gameName);
|
||||
}
|
||||
|
@ -83,8 +82,7 @@ public class GameNameServiceImpl implements IGameNameService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGameNameByIds(Long[] ids)
|
||||
{
|
||||
public int deleteGameNameByIds(Long[] ids) {
|
||||
return gameNameMapper.deleteGameNameByIds(ids);
|
||||
}
|
||||
|
||||
|
@ -95,8 +93,7 @@ public class GameNameServiceImpl implements IGameNameService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGameNameById(Long id)
|
||||
{
|
||||
public int deleteGameNameById(Long id) {
|
||||
return gameNameMapper.deleteGameNameById(id);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,13 @@ import java.util.List;
|
|||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.game.mapper.GamePlatformMapper;
|
||||
import com.ff.game.domain.GamePlatform;
|
||||
import com.ff.game.service.IGamePlatformService;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* 平台管理Service业务层处理
|
||||
|
@ -17,8 +19,7 @@ import com.ff.game.service.IGamePlatformService;
|
|||
* @date 2025-02-10
|
||||
*/
|
||||
@Service
|
||||
public class GamePlatformServiceImpl implements IGamePlatformService
|
||||
{
|
||||
public class GamePlatformServiceImpl implements IGamePlatformService {
|
||||
@Autowired
|
||||
private GamePlatformMapper gamePlatformMapper;
|
||||
|
||||
|
@ -29,8 +30,7 @@ public class GamePlatformServiceImpl implements IGamePlatformService
|
|||
* @return 平台管理
|
||||
*/
|
||||
@Override
|
||||
public GamePlatform selectGamePlatformById(Long id)
|
||||
{
|
||||
public GamePlatform selectGamePlatformById(Long id) {
|
||||
return gamePlatformMapper.selectGamePlatformById(id);
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,7 @@ public class GamePlatformServiceImpl implements IGamePlatformService
|
|||
* @return 平台管理
|
||||
*/
|
||||
@Override
|
||||
public List<GamePlatform> selectGamePlatformList(GamePlatform gamePlatform)
|
||||
{
|
||||
public List<GamePlatform> selectGamePlatformList(GamePlatform gamePlatform) {
|
||||
return gamePlatformMapper.selectGamePlatformList(gamePlatform);
|
||||
}
|
||||
|
||||
|
@ -53,9 +52,10 @@ public class GamePlatformServiceImpl implements IGamePlatformService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGamePlatform(GamePlatform gamePlatform)
|
||||
{
|
||||
gamePlatform.setId(IdUtil.getSnowflakeNextId());
|
||||
public int insertGamePlatform(GamePlatform gamePlatform) {
|
||||
if (ObjectUtils.isEmpty(gamePlatform.getId())) {
|
||||
gamePlatform.setId(IdUtil.getSnowflakeNextId());
|
||||
}
|
||||
gamePlatform.setCreateTime(DateUtils.getNowDate());
|
||||
return gamePlatformMapper.insertGamePlatform(gamePlatform);
|
||||
}
|
||||
|
@ -67,8 +67,7 @@ public class GamePlatformServiceImpl implements IGamePlatformService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGamePlatform(GamePlatform gamePlatform)
|
||||
{
|
||||
public int updateGamePlatform(GamePlatform gamePlatform) {
|
||||
gamePlatform.setUpdateTime(DateUtils.getNowDate());
|
||||
return gamePlatformMapper.updateGamePlatform(gamePlatform);
|
||||
}
|
||||
|
@ -80,8 +79,7 @@ public class GamePlatformServiceImpl implements IGamePlatformService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGamePlatformByIds(Long[] ids)
|
||||
{
|
||||
public int deleteGamePlatformByIds(Long[] ids) {
|
||||
return gamePlatformMapper.deleteGamePlatformByIds(ids);
|
||||
}
|
||||
|
||||
|
@ -92,13 +90,11 @@ public class GamePlatformServiceImpl implements IGamePlatformService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGamePlatformById(Long id)
|
||||
{
|
||||
public int deleteGamePlatformById(Long id) {
|
||||
return gamePlatformMapper.deleteGamePlatformById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 选择最大排序号
|
||||
*
|
||||
|
|
|
@ -77,7 +77,9 @@ public class GameServiceImpl implements IGameService
|
|||
@Override
|
||||
public int insertGame(Game game)
|
||||
{
|
||||
game.setId(IdUtil.getSnowflakeNextId());
|
||||
if (game.getId() == null){
|
||||
game.setId(IdUtil.getSnowflakeNextId());
|
||||
}
|
||||
game.setCreateTime(DateUtils.getNowDate());
|
||||
return gameMapper.insertGame(game);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue