Bitzsoft.Integrations.ProjectManagement
1.0.4
dotnet add package Bitzsoft.Integrations.ProjectManagement --version 1.0.4
NuGet\Install-Package Bitzsoft.Integrations.ProjectManagement -Version 1.0.4
<PackageReference Include="Bitzsoft.Integrations.ProjectManagement" Version="1.0.4" />
<PackageVersion Include="Bitzsoft.Integrations.ProjectManagement" Version="1.0.4" />
<PackageReference Include="Bitzsoft.Integrations.ProjectManagement" />
paket add Bitzsoft.Integrations.ProjectManagement --version 1.0.4
#r "nuget: Bitzsoft.Integrations.ProjectManagement, 1.0.4"
#:package Bitzsoft.Integrations.ProjectManagement@1.0.4
#addin nuget:?package=Bitzsoft.Integrations.ProjectManagement&version=1.0.4
#tool nuget:?package=Bitzsoft.Integrations.ProjectManagement&version=1.0.4
Bitzsoft.Integrations.ProjectManagement
项目管理抽象层 — 统一接口定义、基础模型与结果包装。
屏蔽 Asana、Teambition、Jira Cloud、Jira Data Center、Azure DevOps、TAPD、GitHub、GitLab、Gitee、Monday、Trello、ONES、PingCode、阿里云效等供应商差异,提供一致的项目查询与任务创建、查询、更新、完成、列表查询 API。
功能特性
- 统一供应商接口
IProjectManagementService:8 个异步方法覆盖项目与任务全生命周期 - 统一结果包装:
PmResult携带成功标志与错误信息 - 统一异常
ProjectManagementException:封装供应商标识、错误码与请求 ID - 不可变模型设计:集合返回
List<T>,属性使用init保证只读
安装
dotnet add package Bitzsoft.Integrations.ProjectManagement
<PackageReference Include="Bitzsoft.Integrations.ProjectManagement" Version="1.0.0" />
接口
IProjectManagementService
统一的项目管理供应商接口。
| 方法 | 返回类型 | 说明 |
|---|---|---|
ProviderName |
string |
供应商标识(如 Asana、Teambition、JiraCloud) |
CreateProjectAsync |
Task<PmProject> |
创建项目,返回项目信息 |
ListProjectsAsync |
Task<List<PmProject>> |
查询项目列表 |
CreateTaskAsync |
Task<PmTask> |
创建任务,返回任务信息 |
GetTaskAsync |
Task<PmTask> |
查询单个任务 |
UpdateTaskAsync |
Task<PmResult> |
更新任务信息 |
CompleteTaskAsync |
Task<PmResult> |
完成任务 |
ListTasksAsync |
Task<List<PmTask>> |
分页查询任务列表 |
说明:部分供应商(如 Jira Cloud、Jira Data Center 等)的项目创建需管理员级 API,其连接器重点聚焦于任务(Issue / Work Item)全生命周期管理(创建、详情获取、信息更新、工作流状态跃迁与列表检索)。
核心模型
| 类 | 关键字段 | 说明 |
|---|---|---|
CreateProjectRequest |
Name、Description、DueDate |
创建项目请求 |
CreateTaskRequest |
ProjectId、Name、Description、AssigneeId、DueDate、Priority |
创建任务请求 |
UpdateTaskRequest |
TaskId、Name、Description、AssigneeId、DueDate、Priority |
更新任务请求 |
ListTasksRequest |
ProjectId、Status、AssigneeId、PageIndex、PageSize |
任务列表查询参数 |
PmProject |
ProjectId、Name、Description、Status、OwnerId、CreatedAt、DueDate |
项目信息 |
PmTask |
TaskId、ProjectId、Name、Description、Status、AssigneeId、DueDate、Priority、Tags |
任务信息 |
PmResult |
Success、ErrorMessage |
操作结果 |
ProjectManagementException |
— | 统一异常(继承 IntegrationException) |
枚举
| 枚举 | 说明 |
|---|---|
TaskStatus |
任务状态:Todo / InProgress / Completed / Cancelled |
TaskPriority |
任务优先级:Low / Medium / High |
ProjectStatus |
项目状态:Active / OnHold / Completed / Archived |
使用示例
抽象层本身只定义接口与模型,具体实现由各供应商包提供。以下示例假设已注册某个供应商实现:
using System;
using System.Threading;
using System.Threading.Tasks;
using Bitzsoft.Integrations.ProjectManagement;
using Bitzsoft.Integrations.ProjectManagement.Dtos;
using TaskStatus = Bitzsoft.Integrations.ProjectManagement.Dtos.TaskStatus;
public class TaskBoardService
{
private readonly IProjectManagementService _pm;
public TaskBoardService(IProjectManagementService pm)
{
_pm = pm;
}
public async Task<string> PlanTaskAsync(string projectId, string name, string assigneeId, CancellationToken cancellationToken = default)
{
var task = await _pm.CreateTaskAsync(new CreateTaskRequest
{
ProjectId = projectId,
Name = name,
AssigneeId = assigneeId,
DueDate = DateTimeOffset.UtcNow.AddDays(7),
Priority = TaskPriority.Medium
}, cancellationToken);
return task.TaskId;
}
public Task<PmResult> CloseTaskAsync(string taskId, CancellationToken cancellationToken = default)
=> _pm.CompleteTaskAsync(taskId, cancellationToken);
}
多供应商解析
同一应用注册多个供应商时,通过 IIntegrationProviderResolver<IProjectManagementService> 按供应商 ID 解析:
using Bitzsoft.Integrations.Core;
using Bitzsoft.Integrations.ProjectManagement;
using Microsoft.Extensions.DependencyInjection;
var resolver = serviceProvider.GetRequiredService<IIntegrationProviderResolver<IProjectManagementService>>();
var asana = resolver.GetRequired("asana");
var task = await asana.CreateTaskAsync(request);
依赖
- Bitzsoft.Integrations.Core:公共基座(
IntegrationException、IIntegrationProviderResolver<T>)
相关包
| 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.Core (>= 1.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
-
net5.0
- Bitzsoft.Integrations.Core (>= 1.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 5.0.0)
- Microsoft.Extensions.Options (>= 5.0.0)
-
net8.0
- Bitzsoft.Integrations.Core (>= 1.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
NuGet packages (15)
Showing the top 5 NuGet packages that depend on Bitzsoft.Integrations.ProjectManagement:
| Package | Downloads |
|---|---|
|
Bitzsoft.Integrations.ProjectManagement.Monday
monday.com 项目管理实现 — API Key Bearer 鉴权 + GraphQL,实现 IProjectManagementService 统一接口,支持项目创建/列表与任务 CRUD/完成/列表 |
|
|
Bitzsoft.Integrations.ProjectManagement.Ones
ONES 项目管理实现 — 用户 token 登录认证 Bearer 鉴权 + HttpClient,实现 IProjectManagementService 统一接口,支持项目创建/列表与任务 CRUD/完成/列表 |
|
|
Bitzsoft.Integrations.ProjectManagement.Asana
Asana 项目管理实现 — Personal Access Token Bearer 鉴权 + HttpClient,实现 IProjectManagementService 统一接口,支持项目创建/列表与任务 CRUD/完成/列表 |
|
|
Bitzsoft.Integrations.ProjectManagement.Teambition
Teambition(钉钉旗下)项目管理实现 — AppKey + AppSecret 换 access_token(query 注入)鉴权 + HttpClient,实现 IProjectManagementService 统一接口,支持项目创建/列表与任务 CRUD/完成/列表 |
|
|
Bitzsoft.Integrations.ProjectManagement.Trello
Trello 项目管理实现 — API Key + Token query 参数鉴权 + HttpClient,实现 IProjectManagementService 统一接口,支持项目创建/列表与任务 CRUD/完成/列表 |
GitHub repositories
This package is not used by any popular GitHub repositories.