using CloudGaming.DtoModel;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudGaming.Code.Config
{
    /// <summary>
    /// 
    /// </summary>
    public class AppConfigBLL : CloudGamingBase
    {
        public AppConfigBLL(IServiceProvider serviceProvider) : base(serviceProvider)
        {
        }

        /// <summary>
        /// 获取app启动配置
        /// </summary>
        /// <returns></returns>
        public async Task<AppConfigDto> GetAppConfig()
        {
            var x = AppRequestInfo.VersionNum;
            AppConfigDto appConfigDto = new AppConfigDto()
            {
                IsAuthRealName = true
            };
            appConfigDto.IsChecking = IsChecking;
            appConfigDto.SignKey = AppConfig.TenantId.ToString("N");
            appConfigDto.NightCardTips = $"22点30分至次日7点畅玩无消耗";
            appConfigDto.ChannelId = AppConfig.GameConfig.ChannelId;
            appConfigDto.BsUrl = AppConfig.GameConfig.BsUrl.TrimEnd('/') + "/";
            appConfigDto.PrivacyAgreement = AppConfig.PrivacyAgreement;
            appConfigDto.UserAgreement = AppConfig.UserAgreement;
            return appConfigDto;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public bool GetAppIsChecking()
        {
            var list = Cache.AppConfigList.ToList();
            return list.GetAppIsChecking(AppRequestInfo);
        }


    }
}
