MasterData API
由
scripts/generate-api-docs.ts自动生成 —— 请勿手改 共 7 个端点
GET /master/{entityType}
按类型列出实体(已合并的别名不出现)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
entityType | path | string | ✅ |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
GET /master/{entityType}/{code}
按编码读取(自动解析合并)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
entityType | path | string | ✅ | |
code | path | string | ✅ |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
PUT /master/{entityType}/{code}
按编码 upsert(不存在则建,存在则版本 +1)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
entityType | path | string | ✅ | |
code | path | string | ✅ |
请求体
json
{
"$ref": "#/components/schemas/UpsertMasterEntityDto"
}响应
| 状态码 | 说明 |
|---|---|
| 200 |
GET /master/{entityType}/{code}/history
版本历史(只追加)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
entityType | path | string | ✅ | |
code | path | string | ✅ |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
GET /master/aliases
生效中的合并记录(审计/运维)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
entityType | query | string | — |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
POST /master/merge
合并两个实体(别名表 + 读侧解析,不改历史)
请求体
json
{
"$ref": "#/components/schemas/MergeMasterDto"
}响应
| 状态码 | 说明 |
|---|---|
| 201 |
POST /master/unmerge
回滚一次合并(不删记录,标 reverted)
请求体
json
{
"$ref": "#/components/schemas/UnmergeMasterDto"
}响应
| 状态码 | 说明 |
|---|---|
| 201 |