using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using QYZH.InteractiveMagazine.Common.Helpers;
using QYZH.InteractiveMagazine.Infrastructure.OSS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QYZH.InteractiveMagazine.Infrastructure.SDK
{
    public static class SDKExtensions
    {
        public static void AddSDKService(this IServiceCollection services, IConfiguration configuration)
        {
            services.Configure<OSSOptions>(configuration.GetSection(OSSOptions.Section));

            DomainHelper.OssDomain = configuration.GetSection(OSSOptions.Section).Get<OSSOptions>()!.Domain;

            services.AddSingleton<OssService>();
            services.AddSingleton<OssIMMService>();
        }
    }
}
