using CrazyStudio.Core.Common.AliyunExt.Oss;
using CrazyStudio.Core.Common.Tools.Extensions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrazyStudio.Core.Common.Tools.Extensions
{
    public static class AliOssExtension
    {
        /// <summary>
        /// 绑定阿里云OSS关键授权信息，至全局单例
        /// </summary>
        /// <param name="services"></param>
        /// <param name="configuration"></param>
        public static void AddOss(this IServiceCollection services, IConfiguration configuration)
        {
            var aliyunOssOption = new AliyunOssOption();
            configuration.Bind("AliyunOSS", aliyunOssOption);
            services.AddSingleton(aliyunOssOption);
        }
    }
}
