契约锁基于契约锁合同管理开放平台 API,实现 IContractService 统一接口。
包信息
| 项 | 值 |
|---|---|
| NuGet 包 | Bitzsoft.Integrations.ContractLifecycle.Qiyuesuo |
| 实现接口 | IContractService |
| Provider ID | qiyuesuo |
| 鉴权方式 | AppToken + AppSecret MD5 签名头鉴权 |
| 默认 BaseUrl | 无(需配置,形如 https://openapi.qiyuesuo.com) |
| 区域 | CN |
配置字段
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
BaseUrl | string | 是 | — | 契约锁开放平台地址,形如 https://openapi.qiyuesuo.com |
AppToken | string | 是 | — | 应用 Token(AppToken) |
AppSecret | string | 是 | — | 应用密钥(AppSecret,用于 MD5 签名) |
HttpClientName | string | 否 | ContractLifecycleQiyuesuo | 业务 HttpClient 命名 |
配置 JSON 示例
{ "ContractLifecycle": { "Qiyuesuo": { "BaseUrl": "https://openapi.qiyuesuo.com", "AppToken": "xxxxxxxxxxxxxxxx", "AppSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } }}DI 注册
// 从配置节注册(默认节名 ContractLifecycle:Qiyuesuo)services.AddQiyuesuoContract(configuration);
// 或用回调单独配置services.AddQiyuesuoContract(options =>{ options.BaseUrl = "https://openapi.qiyuesuo.com"; options.AppToken = "xxxxxxxxxxxxxxxx"; options.AppSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";});使用示例
public class ContractService{ private readonly IContractService _contract;
public ContractService(IContractService contract) => _contract = contract;
public Task<ContractLifecycleResult> ApproveAsync(string contractId, string comment) => _contract.ApproveContractAsync(contractId, comment);
public Task<ContractLifecycleResult> RejectAsync(string contractId, string reason) => _contract.RejectContractAsync(contractId, reason);
public Task<List<ContractInfo>> ListPendingAsync() => _contract.ListContractsAsync(new ListContractsRequest { Status = "pending" });}依赖
| 包 | 说明 |
|---|---|
Bitzsoft.Integrations.ContractLifecycle | 电子合同服务抽象层 |
Bitzsoft.Integrations.Core | 公共基座 |
已知限制
- 鉴权走 MD5 签名头(基于 AppToken + AppSecret + 请求参数),与法大大的 Bearer Token 方式不同。