72 lines
2.0 KiB
C#
72 lines
2.0 KiB
C#
using CloudGaming.Api.Admin.ApplicationServices.Apps.Ext;
|
|
using CloudGaming.AppConfigModel;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace CloudGaming.Api.Admin.Controllers.Apps.Ext;
|
|
|
|
/// <summary>
|
|
/// 游戏配置控制器 UserConfigController
|
|
/// </summary>
|
|
[ApiResultFilter]
|
|
[Route("api/v1/admin/Game/[controller]/[action]")]
|
|
[ControllerDescriptor(MenuId = "请设置菜单Id 系统菜单表中查找,如果不设置不受权限保护!", DisplayName = "")]
|
|
public class GameConfigController(IServiceProvider serviceProvider)
|
|
|
|
{
|
|
GameConfigService gameAlipayConfig = new GameConfigService(serviceProvider);
|
|
|
|
/// <summary>
|
|
/// 查询表单数据
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public async Task<Dictionary<string, object?>> FindFormAsync()
|
|
{
|
|
|
|
return await gameAlipayConfig.FindFormAsync();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存数据
|
|
/// </summary>
|
|
/// <param name="form"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task SaveFormAsync(GameConfig form)
|
|
{
|
|
await gameAlipayConfig.SaveFormAsync(form);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加
|
|
/// </summary>
|
|
/// <param name="form"></param>
|
|
/// <returns></returns>
|
|
[RequestLimitFilter]
|
|
[ActionDescriptor(PermissionFunctionConsts.Function_Insert, DisplayName = "创建表单")]
|
|
[Microsoft.AspNetCore.Mvc.HttpPost]
|
|
[ApiCheckModel]
|
|
public virtual Task CreateAsync([FromBody] GameConfig form)
|
|
{
|
|
return gameAlipayConfig.SaveFormAsync(form);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 编辑
|
|
/// </summary>
|
|
/// <param name="form"></param>
|
|
/// <returns></returns>
|
|
[RequestLimitFilter]
|
|
[ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "编辑表单")]
|
|
[Microsoft.AspNetCore.Mvc.HttpPost]
|
|
[ApiCheckModel]
|
|
public virtual Task UpdateAsync([FromBody] GameConfig form)
|
|
{
|
|
return gameAlipayConfig.SaveFormAsync(form);
|
|
}
|
|
|
|
}
|