Skip to content
Bitzsoft.Integrationsbitzsoft.integrations

Reference

Trello

Bitzsoft.Integrations.ProjectManagement.Trello 包参考——API Key+Token(query 参数)鉴权、IProjectManagementService 配置与使用示例。

Last updated

Trello 基于 Trello REST API,实现 IProjectManagementService 统一接口。

包信息

NuGet 包Bitzsoft.Integrations.ProjectManagement.Trello
实现接口IProjectManagementService
Provider IDtrello
鉴权方式API Key + Token,以 query 参数注入(?key={apiKey}&token={apiToken}
默认 BaseUrlhttps://api.trello.com/1
区域Global

凭据在 Trello 授权平台创建应用并授权后获取。

配置字段

字段类型必填默认值说明
ApiKeystringAPI Key
ApiTokenstringAPI Token(用户授权后获取)
BaseUrlstringhttps://api.trello.com/1Trello REST API 基地址
HttpClientNamestringProjectManagementTrello业务 HttpClient 命名

配置 JSON 示例

{
"ProjectManagement": {
"Trello": {
"ApiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ApiToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"BaseUrl": "https://api.trello.com/1"
}
}
}

DI 注册

// 从配置节注册(默认节名 ProjectManagement:Trello)
services.AddTrelloProjectManagement(configuration);
// 或用回调单独配置
services.AddTrelloProjectManagement(options =>
{
options.ApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
options.ApiToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
});

使用示例

public class CardService
{
private readonly IProjectManagementService _pm;
public CardService(IProjectManagementService pm) => _pm = pm;
public Task<PmTask> CreateCardAsync(string boardId, string name)
=> _pm.CreateTaskAsync(new CreateTaskRequest { ProjectId = boardId, Name = name });
public Task<PmTask> GetCardAsync(string cardId)
=> _pm.GetTaskAsync(cardId);
}

依赖

说明
Bitzsoft.Integrations.ProjectManagement项目管理服务抽象层
Bitzsoft.Integrations.Core公共基座

已知限制

  • 项目概念映射为 Trello Board,任务映射为 Card。
  • 鉴权走 query 参数而非请求头。

100%

滚轮或按钮缩放 · 放大后拖动画面 · 双击切换 100% / 200%