95 lines
2.7 KiB
C#
95 lines
2.7 KiB
C#
using CloudGaming.Repository.Game.Entities.Ext;
|
|
using CloudGaming.Api.Admin.ApplicationServices.Apps.Ext;
|
|
using AppConfig = CloudGaming.Code.DataBaseModel.AppConfig;
|
|
using CloudGaming.Shared.Models.PagingViews;
|
|
using CloudGaming.Core.AgileConfig;
|
|
|
|
namespace CloudGaming.Api.Admin.Controllers.Apps.Ext;
|
|
|
|
/// <summary>
|
|
/// 控制器
|
|
/// </summary>
|
|
[ApiResultFilter]
|
|
[Route("api/v1/admin/Game/[controller]/[action]")]
|
|
[ControllerDescriptor(MenuId = "请设置菜单Id 系统菜单表中查找,如果不设置不受权限保护!", DisplayName = "")]
|
|
public class AppConfigController(IServiceProvider serviceProvider)
|
|
|
|
{
|
|
AppConfigService appConfigService = new AppConfigService(serviceProvider);
|
|
|
|
/// <summary>
|
|
/// 获取列表数据
|
|
/// </summary>
|
|
/// <param name="pagingSearchInput"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<PagingView> FindListAsync([FromBody] PagingSearchInput<AppConfig> pagingSearchInput)
|
|
{
|
|
|
|
return await appConfigService.FindListAsync(pagingSearchInput);
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 根据id数组删除
|
|
/// </summary>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task DeleteListAsync([FromBody] List<Guid> ids)
|
|
{
|
|
await appConfigService.DeleteListAsync(ids);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询表单数据
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("{id?}")]
|
|
public async Task<Dictionary<string, object?>> FindFormAsync(Guid? id)
|
|
{
|
|
|
|
return await appConfigService.FindFormAsync(id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存数据
|
|
/// </summary>
|
|
/// <param name="form"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task SaveFormAsync(AppConfig form)
|
|
{
|
|
await appConfigService.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] AppConfig form)
|
|
{
|
|
return appConfigService.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] AppConfig form)
|
|
{
|
|
return appConfigService.SaveFormAsync(form);
|
|
}
|
|
} |