风险
风险(Risk)是项目维度的 issue tracker。比 Action Item 重,比 Task 轻。
数据模型
interface Risk {
id: string;
projectId: string;
title: string;
description: string | null;
severity: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
status: "OPEN" | "MITIGATING" | "RESOLVED";
ownerId: string | null;
createdAt: string;
updatedAt: string;
}
Endpoints
列出风险
GET /openapi/v1/resource/risk/list?projectId=...&status=...
projectId 是可选过滤;省略时返回工作区所有风险。status 是可选过滤。
创建风险
POST /openapi/v1/resource/risk/create
Body:
{
"projectId": "cms5brzya0009zp13m0hmf79x",
"title": "上线后没观察 metrics",
"description": "上线 2 小时后才发现 latency 飙升",
"severity": "HIGH",
"ownerId": "cms5brzxe0000zp13yno59cbq"
}
更新风险
PATCH /openapi/v1/resource/risk/update
Body:
{
"riskId": "cms...",
"status": "MITIGATING"
}
合法的状态转移:
| 从 | 到 |
|---|---|
OPEN | MITIGATING / RESOLVED |
MITIGATING | RESOLVED / OPEN(退回) |
RESOLVED | 终态;可以重新打开为 OPEN |
Scope
- 读:
risks:read - 写:
risks:write