Teambition(钉钉旗下)基于 Teambition Open API,实现 IProjectManagementService 统一接口。
包信息
| 项 | 值 |
|---|---|
| NuGet 包 | Bitzsoft.Integrations.ProjectManagement.Teambition |
| 实现接口 | IProjectManagementService |
| Provider ID | teambition |
| 鉴权方式 | AppKey + AppSecret 换 access_token,以 query 参数注入业务请求 |
| 默认 BaseUrl | https://open.teambition.com/api |
| 区域 | CN |
凭据在 Teambition 开放平台创建应用后获取。本包内置 token 换取与刷新流程。
配置字段
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
AppKey | string | 是 | — | 应用 Key |
AppSecret | string | 是 | — | 应用密钥 |
BaseUrl | string | 否 | https://open.teambition.com/api | Teambition Open API 基地址 |
HttpClientName | string | 否 | ProjectManagementTeambition | 业务 HttpClient 命名 |
TokenHttpClientName | string | 否 | ProjectManagementTeambitionToken | 令牌刷新专用 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 自动刷新。