using CloudGaming.Api.Base;
using CloudGaming.Code.Config;
using CloudGaming.DtoModel;

using HuanMeng.DotNetCore.AttributeExtend;

using Microsoft.AspNetCore.Mvc;
namespace CloudGaming.Api.Controllers;

/// <summary>
/// 
/// </summary>
public class AppController : CloudGamingControllerBase
{
    public AppController(IServiceProvider _serviceProvider) : base(_serviceProvider)
    {
    }
    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    public async Task<AppConfigDto> GetAppConfigAsync()
    {
        AppConfigBLL appConfigBLL = new AppConfigBLL(ServiceProvider);
        var appConfig = await appConfigBLL.GetAppConfig();
        return appConfig;
    }

    /// <summary>
    /// 清除本地缓存
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    public bool ClearCacheData()
    {
        AppConfigBLL appConfigBLL = new AppConfigBLL(ServiceProvider);
        var appConfig = appConfigBLL.ClearCacheData();
        return appConfig;
    }

}
