获取角色信息
分页查询 NineData 系统中已创建的角色列表,支持获取角色 ID、名称和类型。
请求地址:/openapi/v1/role/list
请求方法:GET
请求参数
参数 | 类型 | 是否必选 | 说明 | 示例 |
---|---|---|---|---|
current | Integer | 否 | 当前页码,从 1 开始,默认 1。 | 1 |
pageSize | Integer | 否 | 每页大小,默认 10。 | 10 |
返回参数
参数 | 类型 | 说明 | 示例 |
---|---|---|---|
success | Boolean | 请求是否成功。 | true |
data | Array | 角色列表,包含如下字段:
| { "roleId": "16", "name": "系统管理员", "type": "system" } |
current | Integer | 当前页码。 | 1 |
pageSize | Integer | 每页大小。 | 10 |
total | Integer | 总记录数。 | 2 |
调用成功示例
{
"success": true,
"requestId": "Uz2t8YEJ-JPNMyCXnOLQk1DUdQKq3VFS",
"data": [{
"roleId": "16",
"name": "系统管理员",
"type": "system"
}, {
"roleId": "17",
"name": "普通成员",
"type": "custom"
}, {
"roleId": "40",
"name": "生产环境管理员",
"type": "custom"
}, {
"roleId": "41",
"name": "生产环境只读",
"type": "custom"
}, {
"roleId": "42",
"name": "开发环境管理员",
"type": "custom"
}, {
"roleId": "160",
"name": "开发角色",
"type": "custom"
}, {
"roleId": "1259",
"name": "A业务-DBA",
"type": "custom"
}, {
"roleId": "1260",
"name": "安全审计员",
"type": "custom"
}, {
"roleId": "1261",
"name": "测试角色权限",
"type": "custom"
}, {
"roleId": "1371",
"name": "测试角色_new",
"type": "custom"
}],
"current": 1,
"pageSize": 10,
"total": 16
}