添加游戏设置接口
This commit is contained in:
parent
a02e6a82c2
commit
5d63401d93
|
|
@ -1,4 +1,10 @@
|
|||
### 20241126
|
||||
### 20241222
|
||||
1. 添加用户游戏数据接口
|
||||
2. 游戏详情接口去除用户是否已收藏字段
|
||||
3. 增加手柄操作接口
|
||||
4. 添加游戏设置接口
|
||||
|
||||
### 20241126
|
||||
1. 增加玩游戏等接口
|
||||
|
||||
### 20241119
|
||||
|
|
|
|||
|
|
@ -179,4 +179,16 @@ public class PlayGameController : CloudGamingControllerBase
|
|||
PlayGameBLL playGameBLL = new PlayGameBLL(ServiceProvider, JYApi);
|
||||
return await playGameBLL.CreateSimpleHandler(userId, gameId, sn);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取游戏设置
|
||||
/// </summary>
|
||||
/// <param name="gameId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public async Task<GameSettingDto> GameSetting([FromQuery] string gameId)
|
||||
{
|
||||
PlayGameBLL playGameBLL = new PlayGameBLL(ServiceProvider, JYApi);
|
||||
return await playGameBLL.GameSetting(gameId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ namespace CloudGaming.Code.AppExtend
|
|||
newAppConfig.UserAgreement = appConfig.UserAgreement;
|
||||
newAppConfig.LanguageRequestUrl = appConfig.LanguageRequestUrl;
|
||||
newAppConfig.CacheRequestUrls = appConfig.CacheRequestUrls;
|
||||
newAppConfig.Site = appConfig.Site;
|
||||
return newAppConfig;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -629,13 +629,13 @@ public class PlayGameBLL : CloudGamingBase
|
|||
}
|
||||
throw jyResponseData.ToMessageBox();
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建简单的控制器
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="gameId"></param>
|
||||
/// <param name="sn"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// 创建简单的控制器
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="gameId"></param>
|
||||
/// <param name="sn"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<BaseResponse<dynamic>> CreateSimpleHandler(int userId, string gameId, string sn)
|
||||
{
|
||||
PlayGameUserInfo gameInfoCache = await PlayGameExtend.GetPlayGameUserInfoOrNull(this, userId, gameId);
|
||||
|
|
@ -654,4 +654,30 @@ public class PlayGameBLL : CloudGamingBase
|
|||
|
||||
return new BaseResponse<dynamic>(ResponseCode.Success, "", dic.Data);
|
||||
}
|
||||
|
||||
public async Task<GameSettingDto> GameSetting(string gameId)
|
||||
{
|
||||
if (_UserId == 0)
|
||||
{
|
||||
throw MessageBox.ErrorShow("未登录");
|
||||
}
|
||||
var gameCache = Cache.GameEntityCache;
|
||||
var gameInfo = gameCache[gameId];
|
||||
if (gameInfo == null)
|
||||
{
|
||||
throw MessageBox.ErrorShow("游戏不存在");
|
||||
}
|
||||
// 获取用户和游戏信息
|
||||
var userInfo = UserInfo;
|
||||
PlayGameUserInfo gameInfoCache = await PlayGameExtend.GetPlayGameUserInfoOrNull(this, _UserId, gameId);
|
||||
if (gameInfoCache == null)
|
||||
{
|
||||
throw MessageBox.ErrorShow("未找到游玩信息");
|
||||
}
|
||||
GameSettingDto gameSettingDto = new GameSettingDto()
|
||||
{
|
||||
HandleQrCode = $"{AppConfig.Site.Web}/qrcode/{AppConfig.Identifier}/{_UserId}/{gameId}.png"
|
||||
};
|
||||
return gameSettingDto;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,11 @@ namespace CloudGaming.AppConfigModel
|
|||
/// 清除缓存接口
|
||||
/// </summary>
|
||||
public List<string> CacheRequestUrls { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 网站配置
|
||||
/// </summary>
|
||||
public SiteConfig Site { get; set; }
|
||||
/// <summary>
|
||||
/// 获取数据库连接字符串
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace CloudGaming.AppConfigModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 网站配置
|
||||
/// </summary>
|
||||
public class SiteConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// api
|
||||
/// </summary>
|
||||
public string Api { get; set; }
|
||||
/// <summary>
|
||||
/// web地址
|
||||
/// </summary>
|
||||
public string Web { get; set; }
|
||||
/// <summary>
|
||||
/// 支付
|
||||
/// </summary>
|
||||
public string Pay { get; set; }
|
||||
/// <summary>
|
||||
/// 扩展
|
||||
/// </summary>
|
||||
public string Ext { get; set; }
|
||||
/// <summary>
|
||||
/// 后台
|
||||
/// </summary>
|
||||
public string Admin { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudGaming.DtoModel.Game;
|
||||
/// <summary>
|
||||
/// 游戏设置
|
||||
/// </summary>
|
||||
public class GameSettingDto
|
||||
{
|
||||
/// <summary>
|
||||
/// h5手柄二维码
|
||||
/// </summary>
|
||||
public string HandleQrCode { get; set; }
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user