Skip to content
Bitzsoft.Integrationsbitzsoft.integrations

Reference

Teambition

Bitzsoft.Integrations.ProjectManagement.Teambition 包参考——AppKey+AppSecret 换 access_token(query 注入)鉴权、IProjectManagementService 配置与使用示例。

Last updated

Teambition(钉钉旗下)基于 Teambition Open API,实现 IProjectManagementService 统一接口。

包信息

NuGet 包Bitzsoft.Integrations.ProjectManagement.Teambition
实现接口IProjectManagementService
Provider IDteambition
鉴权方式AppKey + AppSecret 换 access_token,以 query 参数注入业务请求
默认 BaseUrlhttps://open.teambition.com/api
区域CN

凭据在 Teambition 开放平台创建应用后获取。本包内置 token 换取与刷新流程。

配置字段

字段类型必填默认值说明
AppKeystring应用 Key
AppSecretstring应用密钥
BaseUrlstringhttps://open.teambition.com/apiTeambition Open API 基地址
HttpClientNamestringProjectManagementTeambition业务 HttpClient 命名
TokenHttpClientNamestringProjectManagementTeambitionToken令牌刷新专用 HttpClient 命名

配置 JSON 示例

{
"ProjectManagement": {
"Teambition": {
"AppKey": "xxxxxxxxxxxx",
"AppSecret": "xxxxxxxxxxxxxxxxxxxxxxxx",
"BaseUrl": "https://open.teambition.com/api"
}
}
}

DI 注册

// 从配置节注册(默认节名 ProjectManagement:Teambition)
services.AddTeambitionProjectManagement(configuration);
// 或用回调单独配置
services.AddTeambitionProjectManagement(options =>
{
options.AppKey = "xxxxxxxxxxxx";
options.AppSecret = "xxxxxxxxxxxxxxxxxxxxxxxx";
});

使用示例

public class ProjectService
{
private readonly IProjectManagementService _pm;
public ProjectService(IProjectManagementService pm) => _pm = pm;
public Task<List<PmProject>> ListAsync() => _pm.ListProjectsAsync();
public Task<PmTask> CreateTaskAsync(string projectId, string name)
=> _pm.CreateTaskAsync(new CreateTaskRequest { ProjectId = projectId, Name = name });
}

依赖

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

已知限制

  • access_token 有效期有限,本包通过独立的 token HttpClient 自动刷新。

100%

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