public AliyunOssStorageUploadProcessor(AliyunOssStorageConfigure configure, IOss client, IFileNameGenerator fileNameGenerator, ISubdirectoryGenerator subdirectoryGenerator, IFileValidator fileValidator)
 {
     Configure             = configure;
     Client                = client;
     FileNameGenerator     = fileNameGenerator;
     SubdirectoryGenerator = subdirectoryGenerator;
     FileValidator         = fileValidator;
 }
Exemplo n.º 2
0
        public static IServiceCollection AddUploadAliyunOSS(this IServiceCollection services, Action <AliyunOssStorageConfigure> options)
        {
            services.AddUpload <AliyunOssStorageUploadProcessor>();
            var config = new AliyunOssStorageConfigure(services);

            options?.Invoke(config);
            services.AddSingleton(config);
            services.AddSingleton <IOss>(string.IsNullOrWhiteSpace(config.SecurityToken) ? new OssClient(config.Endpoint, config.AccessId, config.AccessKeySecret) : new OssClient(config.Endpoint, config.AccessId, config.AccessKeySecret, config.SecurityToken));
            services.AddSingleton <UploadConfigure>(config);
            return(services);
        }