添加 TMC 集成跳转权限
- 接口:common/thirdparty/display/staff
- Method:POST
- 接口说明:为指定 TMC 跳转按钮批量添加或更新分配权限。
参数
请求参数
请求体为 OutingBaseRequest 包装结构,source、plat、position、button_name、staff_list 均位于 data 内。
| 字段名称 |
字段类型 |
字段描述 |
是否必填 |
长度限制 |
| bizId |
String |
业务唯一识别码 |
TRUE |
255 |
| timestamp |
Long |
时间戳 |
TRUE |
无 |
| data.source |
String |
TMC 渠道,映射到权限表 platform |
TRUE |
32 |
| data.plat |
String |
设备,枚举值:0 web、1 移动端 |
TRUE |
无 |
| data.position |
String |
位置,枚举值:main、claim_header、claim_line |
TRUE |
64 |
| data.button_name |
String |
按钮名称,对应跳转入口配置 name |
TRUE |
64 |
| data.staff_list |
Array |
权限项列表,最多 500 条 |
TRUE |
无 |
| data.staff_list[].type |
String |
名单类型,枚举值:white、black |
TRUE |
16 |
| data.staff_list[].staff_type |
String |
权限对象类型,枚举值:user、department、level |
TRUE |
64 |
| data.staff_list[].staff_code |
String |
员工号、部门编码或职级编码 |
TRUE |
无 |
| data.staff_list[].description |
String |
描述,写入 comments |
FALSE |
255 |
| data.staff_list[].child_include_flag |
String |
是否包含子级,仅 staff_type=department 有效;部门未传默认 N |
FALSE |
1 |
返回参数
| 字段名称 |
字段类型 |
字段描述 |
| resCode |
Integer |
响应状态码 |
| resMsg |
String |
返回信息描述 |
| bizId |
String |
业务唯一识别码 |
| data.validatorErrors |
Array |
Outing 侧校验或 code/id 转换失败,元素包含 code、messages |
| data.warnings |
Array |
警告信息,元素包含 code、messages |
| data.dbErrors |
Array |
Warmachine 侧数据库处理失败,元素包含 code、messages |
| data.created |
String |
新建成功数量描述 |
| data.updated |
String |
更新成功数量描述 |
业务规则
- Outing 校验公共参数、按钮定位参数、
staff_list 非空且最多 500 条。
- Outing 将
staff_code 转换为 staff_id 后调用 Warmachine;转换失败的条目不传给 Warmachine。
staff_type=user 时 staff_code 为员工号;staff_type=department 时为部门编码;staff_type=level 时为职级编码。
- Warmachine 按
company_id + plat + position + button_name 定位按钮,不使用 source 定位按钮。
- Warmachine 固定写入
action=sso,action_id 使用跳转入口配置 ID,source 写入 platform。
- 已存在同唯一键记录时执行更新,不作为数据库错误。
- 同一批次重复唯一键以最后一条为准。
- 非 department 类型即使传入
child_include_flag 也不会入库。
- 所有条目均为 Outing 侧校验或转换失败且整包级参数合法时,仍返回成功响应,失败详情在
validatorErrors,不会调用 Warmachine 写入。
请求示例
{
"bizId": "demo-save-display-staff",
"timestamp": 1786532400000,
"data": {
"source": "ctrip",
"plat": "0",
"position": "main",
"button_name": "ctrip_main",
"staff_list": [
{
"type": "white",
"staff_type": "department",
"staff_code": "D1",
"description": "TMC跳转入口权限",
"child_include_flag": "Y"
}
]
}
}
返回示例
{
"resCode": 200000,
"resMsg": "success",
"bizId": "demo-save-display-staff",
"data": {
"validatorErrors": [],
"warnings": [],
"dbErrors": [],
"created": "此次请求新建成功了1条数据",
"updated": "此次请求更新成功了0条数据"
}
}