Bitzsoft.Integrations.ProjectManagement.Tapd
1.0.4
dotnet add package Bitzsoft.Integrations.ProjectManagement.Tapd --version 1.0.4
NuGet\Install-Package Bitzsoft.Integrations.ProjectManagement.Tapd -Version 1.0.4
<PackageReference Include="Bitzsoft.Integrations.ProjectManagement.Tapd" Version="1.0.4" />
<PackageVersion Include="Bitzsoft.Integrations.ProjectManagement.Tapd" Version="1.0.4" />
<PackageReference Include="Bitzsoft.Integrations.ProjectManagement.Tapd" />
paket add Bitzsoft.Integrations.ProjectManagement.Tapd --version 1.0.4
#r "nuget: Bitzsoft.Integrations.ProjectManagement.Tapd, 1.0.4"
#:package Bitzsoft.Integrations.ProjectManagement.Tapd@1.0.4
#addin nuget:?package=Bitzsoft.Integrations.ProjectManagement.Tapd&version=1.0.4
#tool nuget:?package=Bitzsoft.Integrations.ProjectManagement.Tapd&version=1.0.4
Bitzsoft.Integrations.ProjectManagement.Tapd
腾讯敏捷协作平台 TAPD OpenAPI 项目与工单连接器实现。遵循项目管理通用抽象规范,实现 IProjectManagementService 接口与专属的 ITapdProjectManagementService 扩展接口。
功能特性
- 通用契约对齐:实现
IProjectManagementService抽象规范,统一映射 TAPD 项目空间(Workspace)、需求(Stories)、缺陷(Bugs)与子任务(Tasks)。 - 灵活鉴权模型:原生支持 HTTP Basic 鉴权(
ApiUser+ApiPassword)以及 OAuth2AccessToken(Bearer)鉴权模式。 - 三态敏捷工作流支持:提供需求(Stories)、缺陷(Bugs)、子任务(Tasks)全生命周期操作,支持不同实体专有数据结构与属性。
- 状态字典双向映射:内置 TAPD 各实体工作流状态字典(规划中、开发中、测试中、已解决、已验证、已关闭、已拒绝等)与统一
TaskStatus状态枚举的双向映射。 - 状态流转与流转动作:支持精准流转需求(
ChangeStoryStatusAsync)、缺陷(ChangeBugStatusAsync)与子任务(ChangeTaskStatusAsync)的工作流状态。 - 事项评论互动:支持在指定事项(需求、缺陷、任务)下发布讨论评论(
AddCommentAsync)。 - 企业私有化支持:支持指定私有部署网关地址(
BaseUrl)与自签名 SSL 证书信任(AllowInsecureCertificates)。 - 工业级弹性韧性:集成 Polly 标准韧性管道(429/503 指数退避重试与熔断保护)及全量出站请求审计日志(
RequestLogging)。
安装
dotnet add package Bitzsoft.Integrations.ProjectManagement.Tapd
<PackageReference Include="Bitzsoft.Integrations.ProjectManagement.Tapd" Version="1.0.0" />
配置
在 appsettings.json 中配置 TAPD 连接器参数:
{
"ProjectManagement": {
"Tapd": {
"BaseUrl": "https://api.tapd.cn",
"ApiUser": "your-api-user",
"ApiPassword": "your-api-password",
"AccessToken": "optional-oauth-access-token",
"CompanyId": "your-company-id",
"DefaultWorkspaceId": "1000001",
"AllowInsecureCertificates": false,
"UserAgent": "Bitzsoft-Tapd/1.0"
}
}
}
配置项说明
| 配置键 | 类型 | 默认值 | 说明 |
|---|---|---|---|
BaseUrl |
string |
https://api.tapd.cn |
TAPD OpenAPI 网关基地址,公有云官方默认网关,亦支持私有部署网关。 |
ApiUser |
string? |
null |
TAPD API User 账号(用于 HTTP Basic 鉴权,可在 TAPD 个人中心 → 访问与权限中生成)。 |
ApiPassword |
string? |
null |
TAPD API Password / Secret 密钥(用于 HTTP Basic 鉴权)。 |
AccessToken |
string? |
null |
OAuth2 访问令牌(可选,若提供则优先使用 Bearer 鉴权)。 |
CompanyId |
string? |
null |
企业/公司标识 (Company ID,可选)。 |
DefaultWorkspaceId |
string? |
null |
默认关联的项目空间标识 (Workspace ID),业务请求未指定时作为缺省值。 |
AllowInsecureCertificates |
bool |
false |
是否信任自签名 SSL 证书(适用于私有部署测试环境)。 |
UserAgent |
string? |
null |
自定义 HTTP User-Agent 标头。 |
注册服务
支持通过配置源绑定或委托方式进行依赖注入注册:
using Microsoft.Extensions.DependencyInjection;
// 方式 1:通过 IConfiguration 绑定注册(推荐,默认读取 ProjectManagement:Tapd)
services.AddBitzsoftTapdProjectManagement(configuration);
// 自定义配置节路径:
// services.AddBitzsoftTapdProjectManagement(configuration, "Integrations:Tapd");
// 方式 2:通过委托手动配置注册
services.AddBitzsoftTapdProjectManagement(options =>
{
options.BaseUrl = "https://api.tapd.cn";
options.ApiUser = "your-api-user";
options.ApiPassword = "your-api-password";
options.DefaultWorkspaceId = "1000001";
options.AllowInsecureCertificates = false;
});
使用示例(通用 IProjectManagementService)
以下代码演示如何在业务类中通过依赖注入使用通用的 IProjectManagementService 契约操作 TAPD 工作项:
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Bitzsoft.Integrations.ProjectManagement;
using Bitzsoft.Integrations.ProjectManagement.Dtos;
using TaskStatus = Bitzsoft.Integrations.ProjectManagement.Dtos.TaskStatus;
namespace YourNamespace;
public class TapdTaskAppService
{
private readonly IProjectManagementService _pmService;
public TapdTaskAppService(IProjectManagementService pmService)
{
_pmService = pmService;
}
public async Task<PmTask> CreateStoryAsync(
string workspaceId,
string title,
string description,
string? owner = null,
DateTimeOffset? dueDate = null,
CancellationToken cancellationToken = default)
{
var request = new CreateTaskRequest
{
ProjectId = workspaceId,
Name = title,
Description = description,
AssigneeId = owner,
DueDate = dueDate,
Priority = TaskPriority.High
};
return await _pmService.CreateTaskAsync(request, cancellationToken);
}
public async Task<PmTask> GetTaskDetailAsync(
string taskId,
CancellationToken cancellationToken = default)
{
return await _pmService.GetTaskAsync(taskId, cancellationToken);
}
public async Task<List<PmTask>> ListWorkspaceTasksAsync(
string workspaceId,
CancellationToken cancellationToken = default)
{
var request = new ListTasksRequest
{
ProjectId = workspaceId,
Status = TaskStatus.InProgress,
PageIndex = 1,
PageSize = 30
};
return await _pmService.ListTasksAsync(request, cancellationToken);
}
public async Task<PmResult> CompleteTaskAsync(
string taskId,
CancellationToken cancellationToken = default)
{
return await _pmService.CompleteTaskAsync(taskId, cancellationToken);
}
}
专有扩展能力(ITapdProjectManagementService)
当业务需要针对 TAPD 的需求(Stories)、缺陷(Bugs)与子任务(Tasks)三态进行差异化精准操作、执行细粒度状态机流转或追加评论时,可直接注入专属接口 ITapdProjectManagementService:
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Bitzsoft.Integrations.ProjectManagement.Tapd;
using Bitzsoft.Integrations.ProjectManagement.Tapd.Dtos;
namespace YourNamespace;
public class TapdAdvancedWorkflowService
{
private readonly ITapdProjectManagementService _tapdService;
public TapdAdvancedWorkflowService(ITapdProjectManagementService tapdService)
{
_tapdService = tapdService;
}
public async Task<TapdStory> CreateStoryWithWorkflowAsync(
string workspaceId,
string storyName,
string description,
string owner,
CancellationToken cancellationToken = default)
{
var request = new TapdCreateStoryRequest
{
WorkspaceId = workspaceId,
Name = storyName,
Description = description,
Owner = owner,
Priority = "High"
};
return await _tapdService.CreateStoryAsync(request, cancellationToken);
}
public async Task<TapdBug> ReportBugAsync(
string workspaceId,
string title,
string description,
string currentOwner,
CancellationToken cancellationToken = default)
{
var request = new TapdCreateBugRequest
{
WorkspaceId = workspaceId,
Title = title,
Description = description,
CurrentOwner = currentOwner,
Priority = "urgent",
Severity = "fatal"
};
return await _tapdService.CreateBugAsync(request, cancellationToken);
}
public async Task<bool> AdvanceBugWorkflowAsync(
string workspaceId,
string bugId,
string nextStatus,
string comment,
string author,
CancellationToken cancellationToken = default)
{
var statusChanged = await _tapdService.ChangeBugStatusAsync(
workspaceId,
bugId,
nextStatus,
cancellationToken);
if (statusChanged && !string.IsNullOrWhiteSpace(comment))
{
await _tapdService.AddCommentAsync(
workspaceId,
"bug",
bugId,
comment,
author,
cancellationToken);
}
return statusChanged;
}
public async Task<List<TapdStory>> GetActiveStoriesAsync(
string workspaceId,
CancellationToken cancellationToken = default)
{
return await _tapdService.ListStoriesAsync(
workspaceId,
pageIndex: 1,
pageSize: 50,
status: "developing",
cancellationToken: cancellationToken);
}
}
依赖
| 包 | 说明 |
|---|---|
| Bitzsoft.Integrations.ProjectManagement | 项目管理服务统一抽象层 |
| Bitzsoft.Integrations.Core | 公共基座与供应商解析机制 |
| Bitzsoft.Integrations.Compatibility | 多目标框架兼容性工具集 |
| Bitzsoft.Integrations.RequestLogging | 出站请求审计与耗时追踪日志 |
相关包
| 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.Compatibility (>= 1.0.4)
- Bitzsoft.Integrations.Core (>= 1.0.4)
- Bitzsoft.Integrations.ProjectManagement (>= 1.0.4)
- Bitzsoft.Integrations.RequestLogging (>= 1.0.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Http.Resilience (>= 10.7.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
-
net5.0
- Bitzsoft.Integrations.Compatibility (>= 1.0.4)
- Bitzsoft.Integrations.Core (>= 1.0.4)
- Bitzsoft.Integrations.ProjectManagement (>= 1.0.4)
- Bitzsoft.Integrations.RequestLogging (>= 1.0.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 5.0.0)
- Microsoft.Extensions.Http (>= 5.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 5.0.0)
-
net8.0
- Bitzsoft.Integrations.Compatibility (>= 1.0.4)
- Bitzsoft.Integrations.Core (>= 1.0.4)
- Bitzsoft.Integrations.ProjectManagement (>= 1.0.4)
- Bitzsoft.Integrations.RequestLogging (>= 1.0.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Http.Resilience (>= 10.7.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.ProjectManagement.Tapd:
| Package | Downloads |
|---|---|
|
Bitzsoft.Integrations.ProjectManagement.All
项目管理服务聚合包 — 包含全部供应商实现(Asana / Teambition / Monday / Trello / ONES / PingCode / Yunxiao / GitHub / GitLab / Gitee / JiraCloud / JiraDataCenter / AzureDevOps / Tapd) |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.4 | 139 | 9/23/2026 |