Bitzsoft.Integrations.CloudDrive.AnyShare 1.0.0-alpha.10

This is a prerelease version of Bitzsoft.Integrations.CloudDrive.AnyShare.
dotnet add package Bitzsoft.Integrations.CloudDrive.AnyShare --version 1.0.0-alpha.10
                    
NuGet\Install-Package Bitzsoft.Integrations.CloudDrive.AnyShare -Version 1.0.0-alpha.10
                    
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.AnyShare" Version="1.0.0-alpha.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.CloudDrive.AnyShare" Version="1.0.0-alpha.10" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.CloudDrive.AnyShare" />
                    
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.AnyShare --version 1.0.0-alpha.10
                    
#r "nuget: Bitzsoft.Integrations.CloudDrive.AnyShare, 1.0.0-alpha.10"
                    
#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.AnyShare@1.0.0-alpha.10
                    
#: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.AnyShare&version=1.0.0-alpha.10&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.CloudDrive.AnyShare&version=1.0.0-alpha.10&prerelease
                    
Install as a Cake Tool

Bitzsoft.Integrations.CloudDrive.AnyShare

爱数 AnyShare 企业内容管理平台服务实现,面向私有化部署场景提供标准接入结构。

功能特性

  • 基于爱数 AnyShare RESTful API,提供标准接入结构
  • Bearer Token 认证:通过 API 访问令牌接入
  • 私有化部署友好:BaseUrl 由企业按实际部署地址配置,无公共默认值
  • 核心文件能力:文件上传、下载与列表查询已实现
  • 可扩展:搜索、分享、权限等接口可按企业部署版本继续扩展

安装

.NET CLI

dotnet add package Bitzsoft.Integrations.CloudDrive.AnyShare

PackageReference

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

配置

appsettings.json

{
  "CloudDrive": {
    "AnyShare": {
      "ApiToken": "你的 API 令牌",
      "BaseUrl": "https://your-anyshare-instance.example.com",
      "HttpClientName": "AnyShareCloudDrive"
    }
  }
}
配置项 必填 默认值 说明
ApiToken -- 爱数 AnyShare API 访问令牌
BaseUrl -- 私有化部署地址,需根据实际部署配置
HttpClientName AnyShareCloudDrive 命名 HttpClient 名称

注册服务

从 IConfiguration 绑定(推荐)

using Bitzsoft.Integrations.CloudDrive.AnyShare;

builder.Services.AddBitzsoftAnyShareCloudDrive(
    builder.Configuration.GetSection("CloudDrive:AnyShare"));

委托配置

builder.Services.AddBitzsoftAnyShareCloudDrive(options =>
{
    options.ApiToken = "your_api_token";
    options.BaseUrl = "https://your-anyshare-instance.example.com";
});

使用示例

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

public class MyService
{
    private readonly ICloudDriveProvider _drive;

    public MyService(ICloudDriveProvider drive) => _drive = drive;

    public async Task UploadAndListAsync()
    {
        // 上传文件
        await using var stream = File.OpenRead("report.pdf");
        var upload = await _drive.UploadAsync(new UploadFileRequest
        {
            FolderId = "space_id_or_path",
            FileName = "report.pdf",
            Content = stream,
            ContentType = "application/pdf"
        });

        // 列出文件列表
        var files = await _drive.ListFilesAsync("space_id_or_path");
        foreach (var file in files.Items)
        {
            Console.WriteLine($"{file.Name} ({file.Size} bytes)");
        }

        // 下载文件
        var download = await _drive.DownloadAsync(upload.FileInfo.Id);
    }
}

核心类型一览

类型 说明
AnyShareCloudDriveProvider 爱数 AnyShare 实现(ProviderName = "AnyShare"
AnyShareOptions 配置选项(ApiToken / BaseUrl / HttpClientName
ICloudDriveProvider 企业网盘服务统一抽象接口
UploadFileRequest / UploadFileResult 上传请求与结果
ListFilesResult 文件列表结果(Items / NextPageToken / TotalCount)

实现状态

方法 状态 说明
UploadAsync 已实现 根据部署端点和授权范围对接上传接口
DownloadAsync 已实现 根据文件标识获取下载内容
ListFilesAsync 已实现 查询目录或空间下的文件列表
DeleteFileAsync 不支持 调用抛出 NotSupportedException
MoveFileAsync 不支持 调用抛出 NotSupportedException
CopyFileAsync 不支持 调用抛出 NotSupportedException
GetFileInfoAsync 不支持 调用抛出 NotSupportedException
CreateFolderAsync 不支持 调用抛出 NotSupportedException
DeleteFolderAsync 不支持 调用抛出 NotSupportedException
SearchAsync 及共享/权限/版本接口 不支持 可按企业部署版本扩展

请求审计

内置 Bitzsoft.Integrations.RequestLogging 出站请求记录管道,默认 NullRequestLogStore 不持久化。

// ① 默认:启用记录管道但不持久化(日志丢弃)
services.AddBitzsoftAnyShareCloudDrive(options => { /* ... */ });

// ② 持久化:宿主注册 IRequestLogStore 实现后,所有出站请求自动落库
services.AddRequestLogging<MyRequestLogStore>(opts =>
{
    opts.MaxInMemoryBodyBytes = 64 * 1024; // 仅控制内存/加密临时文件切换,不截断正文
    opts.SensitiveFields.Add("mySecret"); // 额外脱敏字段
});
services.AddBitzsoftAnyShareCloudDrive(options => { /* ... */ });

注意事项

  • AnyShare 为私有化部署产品,不同企业版本的接口路径和权限模型可能存在差异
  • 当前实现覆盖文件上传、下载、列表三项基础能力,其余接口按企业部署版本扩展
  • 建议以企业授权文档确认接口路径、返回字段和权限范围

依赖

说明
Bitzsoft.Integrations.CloudDrive 企业网盘抽象层
Bitzsoft.Integrations.RequestLogging 出站请求记录管道
Bitzsoft.Integrations.Compatibility 基础工具库
Microsoft.Extensions.Http IHttpClientFactory(连接池)
Microsoft.Extensions.Options.ConfigurationExtensions 配置节点绑定

相关包

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 (1)

Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.CloudDrive.AnyShare:

Package Downloads
Bitzsoft.Integrations.CloudDrive.All

企业网盘服务聚合包 — 包含所有供应商实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.10 19 7/26/2026
1.0.0-alpha.9 63 7/12/2026
1.0.0-alpha.8 56 7/1/2026
1.0.0-alpha.7 69 6/16/2026
1.0.0-alpha.6 61 6/16/2026
1.0.0-alpha.5 60 6/14/2026
1.0.0-alpha.4 52 7/1/2026
1.0.0-alpha.3 64 6/7/2026