Bitzsoft.Integrations.CloudDrive.All
1.0.4
dotnet add package Bitzsoft.Integrations.CloudDrive.All --version 1.0.4
NuGet\Install-Package Bitzsoft.Integrations.CloudDrive.All -Version 1.0.4
<PackageReference Include="Bitzsoft.Integrations.CloudDrive.All" Version="1.0.4" />
<PackageVersion Include="Bitzsoft.Integrations.CloudDrive.All" Version="1.0.4" />
<PackageReference Include="Bitzsoft.Integrations.CloudDrive.All" />
paket add Bitzsoft.Integrations.CloudDrive.All --version 1.0.4
#r "nuget: Bitzsoft.Integrations.CloudDrive.All, 1.0.4"
#:package Bitzsoft.Integrations.CloudDrive.All@1.0.4
#addin nuget:?package=Bitzsoft.Integrations.CloudDrive.All&version=1.0.4
#tool nuget:?package=Bitzsoft.Integrations.CloudDrive.All&version=1.0.4
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 |
基础工具库 |
相关包
- Bitzsoft.Integrations.CloudDrive -- 抽象层
- Bitzsoft.Integrations.CloudDrive.Nutstore -- 坚果云
- Bitzsoft.Integrations.CloudDrive.Microsoft365 -- Microsoft 365 / OneDrive
- Bitzsoft.Integrations.CloudDrive.Gokuai -- 够快云库
- Bitzsoft.Integrations.CloudDrive.AnyShare -- 爱数 AnyShare
- Bitzsoft.Integrations.CloudDrive.Baidu -- 百度网盘
- Bitzsoft.Integrations.CloudDrive.Aliyun -- 阿里云网盘 PDS
- Bitzsoft.Integrations.Compatibility -- 基础工具库
| Product | Versions 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. |
-
net10.0
- Bitzsoft.Integrations.CloudDrive (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Aliyun (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.AnyShare (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Baidu (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Gokuai (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Microsoft365 (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Nutstore (>= 1.0.4)
- Bitzsoft.Integrations.Compatibility (>= 1.0.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
-
net5.0
- Bitzsoft.Integrations.CloudDrive (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Aliyun (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.AnyShare (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Baidu (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Gokuai (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Microsoft365 (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Nutstore (>= 1.0.4)
- Bitzsoft.Integrations.Compatibility (>= 1.0.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 5.0.0)
-
net8.0
- Bitzsoft.Integrations.CloudDrive (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Aliyun (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.AnyShare (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Baidu (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Gokuai (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Microsoft365 (>= 1.0.4)
- Bitzsoft.Integrations.CloudDrive.Nutstore (>= 1.0.4)
- Bitzsoft.Integrations.Compatibility (>= 1.0.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
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 |