Bitzsoft.Integrations.CloudDrive.All 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Bitzsoft.Integrations.CloudDrive.All --version 1.0.1
                    
NuGet\Install-Package Bitzsoft.Integrations.CloudDrive.All -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bitzsoft.Integrations.CloudDrive.All" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.CloudDrive.All" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.CloudDrive.All" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitzsoft.Integrations.CloudDrive.All --version 1.0.1
                    
#r "nuget: Bitzsoft.Integrations.CloudDrive.All, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bitzsoft.Integrations.CloudDrive.All@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitzsoft.Integrations.CloudDrive.All&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.CloudDrive.All&version=1.0.1
                    
Install as a Cake Tool

Bitzsoft.Integrations.CloudDrive.All

企业网盘服务聚合包 -- 一次安装包含全部供应商实现,一行代码自动注册配置中启用的供应商。

功能特性

  • 一键安装:包含全部企业网盘供应商实现,无需逐个引用
  • 按需注册:自动扫描 CloudDrive 配置节,仅注册配置中存在的供应商,未配置的不加载
  • 多供应商共存:支持同时注册多个供应商(通过命名 HttpClient 隔离各自请求管道)
  • 统一抽象:全部供应商实现同一套 ICloudDriveProvider 接口

包含的供应商

配置节 供应商 协议 / 认证 能力概要
Nutstore 坚果云 WebDAV + NSDAV(应用专用密码) 文件/文件夹/搜索/共享/文件夹权限;删除分享与历史版本不支持
Microsoft365 OneDrive / SharePoint Graph API(OAuth 客户端凭据流) 完整实现(含版本管理)
Gokuai 够快云库 开放平台 API(无需认证) 文件/文件夹/搜索/共享;权限/版本不支持
AnyShare 爱数 AnyShare RESTful API(Bearer Token) 文件上传/下载/列表;私有化部署按需扩展
Baidu 百度网盘 开放平台 API(OAuth 2.0) 文件/文件夹/搜索;共享需企业审批,权限/版本不支持
Aliyun 阿里云网盘 PDS PDS v2 API(OAuth 2.0) 文件/文件夹/搜索/共享(含秒传);权限/版本不支持

安装

.NET CLI

dotnet add package Bitzsoft.Integrations.CloudDrive.All

PackageReference

<PackageReference Include="Bitzsoft.Integrations.CloudDrive.All" Version="1.0.0" />

配置

appsettings.json

每个供应商使用独立的配置节,按需填写。仅配置节存在的供应商会被注册。

{
  "CloudDrive": {
    "Nutstore": {
      "AuthEmail": "your@email.com",
      "AuthPassword": "your_app_password"
    },
    "Microsoft365": {
      "TenantId": "your-tenant-id",
      "ClientId": "your-client-id",
      "ClientSecret": "your-client-secret",
      "DriveId": "your-drive-id"
    },
    "Gokuai": {
      "OrgClientId": "your_org_client_id"
    },
    "AnyShare": {
      "ApiToken": "your_api_token",
      "BaseUrl": "https://your-anyshare-instance.example.com"
    },
    "Baidu": {
      "AccessToken": "your_access_token",
      "RefreshToken": "your_refresh_token",
      "AppKey": "your_app_key",
      "SecretKey": "your_secret_key",
      "AppName": "your_app_name"
    },
    "Aliyun": {
      "RefreshToken": "your_refresh_token",
      "ClientId": "your_client_id",
      "ClientSecret": "your_client_secret",
      "DomainId": "your_domain_id",
      "DriveId": "your_drive_id"
    }
  }
}
配置节 对应方法 必填项
Nutstore AddBitzsoftNutstoreCloudDrive AuthEmail / AuthPassword
Microsoft365 AddBitzsoftMicrosoft365CloudDrive TenantId / ClientId / ClientSecret / DriveId
Gokuai AddBitzsoftGokuaiCloudDrive OrgClientId
AnyShare AddBitzsoftAnyShareCloudDrive ApiToken / BaseUrl
Baidu AddBitzsoftBaiduCloudDrive AccessToken / AppName
Aliyun AddBitzsoftAliyunCloudDrive RefreshToken / ClientId / ClientSecret / DomainId / DriveId

各供应商的完整配置项与默认值见「相关包」中对应供应商的 README。

注册服务

从 IConfiguration 绑定(推荐)

using Bitzsoft.Integrations.CloudDrive.All;

builder.Services.AddBitzsoftCloudDriveAll(builder.Configuration);

默认读取 CloudDrive 配置节。也可指定其他节名:

builder.Services.AddBitzsoftCloudDriveAll(builder.Configuration, "MyCloudDrive");

聚合包仅提供 IConfiguration 绑定这一个重载;如需逐个委托配置,请直接引用对应供应商包。

使用示例

多供应商场景注入 IIntegrationProviderResolver<ICloudDriveProvider>,按稳定 ID (aliyun / anyshare / baidu / gokuai / microsoft365 / nutstore)解析。直接注入 ICloudDriveProvider 只用于单 Provider 兼容场景。

using Bitzsoft.Integrations.CloudDrive.Interfaces;
using Bitzsoft.Integrations.CloudDrive.Models;
using Bitzsoft.Integrations.Core;

public class MyService
{
    private readonly IIntegrationProviderResolver<ICloudDriveProvider> _providers;

    public MyService(IIntegrationProviderResolver<ICloudDriveProvider> providers)
        => _providers = providers;

    public async Task RunAsync()
    {
        var drive = _providers.GetRequired("microsoft365");
        await using var stream = File.OpenRead("report.pdf");
        var result = await drive.UploadAsync(new UploadFileRequest
        {
            FolderId = "root",
            FileName = "report.pdf",
            Content = stream
        });

        var files = await drive.ListFilesAsync("root");
        Console.WriteLine($"共 {files.Items.Count} 个文件");
    }
}

核心类型一览

类型 说明
AddBitzsoftCloudDriveAll 聚合注册扩展方法(扫描配置节按需注册)
IIntegrationProviderResolver<ICloudDriveProvider> 按 Provider ID 路由网盘能力
ICloudDriveProvider 企业网盘服务统一抽象接口(来自 CloudDrive 抽象层)
各供应商 XxxCloudDriveProvider 具体供应商实现

请求审计

聚合包中的每个供应商内置 Bitzsoft.Integrations.RequestLogging 出站请求记录管道,默认 NullRequestLogStore 不持久化。宿主注册 IRequestLogStore 实现后,全部供应商的出站请求会自动落库。

// 宿主注册持久化实现后,所有供应商的出站请求自动落库
services.AddRequestLogging<MyRequestLogStore>(opts =>
{
    opts.MaxInMemoryBodyBytes = 64 * 1024; // 只控制内存/加密临时文件切换,不截断正文
    opts.SensitiveFields.Add("mySecret");
});
services.AddBitzsoftCloudDriveAll(builder.Configuration);

依赖

包 说明
Bitzsoft.Integrations.CloudDrive 企业网盘抽象层
Bitzsoft.Integrations.CloudDrive.Nutstore 坚果云实现
Bitzsoft.Integrations.CloudDrive.Microsoft365 Microsoft 365 实现
Bitzsoft.Integrations.CloudDrive.Gokuai 够快云库实现
Bitzsoft.Integrations.CloudDrive.AnyShare 爱数 AnyShare 实现
Bitzsoft.Integrations.CloudDrive.Baidu 百度网盘实现
Bitzsoft.Integrations.CloudDrive.Aliyun 阿里云网盘 PDS 实现
Bitzsoft.Integrations.Compatibility 基础工具库

相关包

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 97 9/23/2026
1.0.3 92 9/22/2026
1.0.2 113 8/29/2026
1.0.1 130 8/3/2026
1.0.0 122 8/2/2026
1.0.0-alpha.10 73 7/26/2026
1.0.0-alpha.9 89 7/12/2026
1.0.0-alpha.8 75 7/1/2026
1.0.0-alpha.7 89 6/16/2026
1.0.0-alpha.6 80 6/16/2026
1.0.0-alpha.5 79 6/14/2026
1.0.0-alpha.4 74 7/1/2026
1.0.0-alpha.3 79 6/7/2026