fxapi-corp-management
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese企业通讯录管理技能
Enterprise Address Book Management Skill
是提供的命令行程序,所有操作通过执行fx-api-cli命令完成。fx-api-cli
通过 与企业通讯录管理系统交互。
fx-api-cli corp <接口名> '<json入参>'is the provided command line program, all operations are completed by executingfx-api-clicommands.fx-api-cli
Interact with the enterprise address book management system via .
fx-api-cli corp <interface name> '<json input parameters>'接口列表
API List
corp.user.get — 获取用户信息接口
corp.user.get — Get User Information API
bash
fx-api-cli corp user_get '{"user_id": "user_id_1"}'获取指定用户的详细信息。需要指定用户 ID。参见 API 详情。
bash
fx-api-cli corp user_get '{"user_id": "user_id_1"}'Get detailed information of the specified user. User ID is required. See API Details.
corp.user.create — 创建用户接口
corp.user.create — Create User API
bash
fx-api-cli corp user_create '{"name": "张三", "username": "zhangsan", "departments": [1]}'创建新用户。需要指定用户名、登录名和部门 ID。参见 API 详情。
bash
fx-api-cli corp user_create '{"name": "张三", "username": "zhangsan", "departments": [1]}'Create a new user. Username, login name and department ID are required. See API Details.
corp.user.update — 更新用户接口
corp.user.update — Update User API
bash
fx-api-cli corp user_update '{"user_id": "user_id_1", "name": "李四", "departments": [1, 2]}'更新指定用户的信息。需要指定用户 ID 和更新的信息。参见 API 详情。
bash
fx-api-cli corp user_update '{"user_id": "user_id_1", "name": "李四", "departments": [1, 2]}'Update information of the specified user. User ID and the information to be updated are required. See API Details.
corp.user.delete — 删除用户接口
corp.user.delete — Delete User API
bash
fx-api-cli corp user_delete '{"user_id": "user_id_1"}'删除指定用户。需要指定用户 ID。参见 API 详情。
bash
fx-api-cli corp user_delete '{"user_id": "user_id_1"}'Delete the specified user. User ID is required. See API Details.
corp.user.batch_delete — 批量删除用户接口
corp.user.batch_delete — Batch Delete Users API
bash
fx-api-cli corp user_batch_delete '{"user_id_list": ["user_id_1", "user_id_2"]}'批量删除多个用户。需要指定用户 ID 列表。参见 API 详情。
bash
fx-api-cli corp user_batch_delete '{"user_id_list": ["user_id_1", "user_id_2"]}'Delete multiple users in batch. User ID list is required. See API Details.
corp.user.import — 导入用户接口
corp.user.import — Import Users API
bash
fx-api-cli corp user_import '{"user_list": [{"name": "张三", "username": "zhangsan", "departments": [1]}, {"name": "李四", "username": "lisi", "departments": [2]}]}'批量导入用户。需要指定用户列表。参见 API 详情。
bash
fx-api-cli corp user_import '{"user_list": [{"name": "张三", "username": "zhangsan", "departments": [1]}, {"name": "李四", "username": "lisi", "departments": [2]}]}'Import users in batch. User list is required. See API Details.
corp.depart.user_list — 获取部门用户列表接口
corp.depart.user_list — Get Department User List API
bash
fx-api-cli corp depart_user_list '{"dept_no": 1}'获取指定部门的用户列表。需要指定部门编号。
bash
fx-api-cli corp depart_user_list '{"dept_no": 1}'Get user list of the specified department. Department number is required.
corp.depart.list — 获取部门列表接口
corp.depart.list — Get Department List API
bash
fx-api-cli corp depart_list '{}'获取企业的部门列表。参见 API 详情。
bash
fx-api-cli corp depart_list '{}'Get the department list of the enterprise. See API Details.
corp.depart.create — 创建部门接口
corp.depart.create — Create Department API
bash
fx-api-cli corp depart_create '{"name": "技术部", "parent_no": 0}'创建新部门。需要指定部门名称和父部门编号。参见 API 详情。
bash
fx-api-cli corp depart_create '{"name": "技术部", "parent_no": 0}'Create a new department. Department name and parent department number are required. See API Details.
corp.depart.update — 更新部门接口
corp.depart.update — Update Department API
bash
fx-api-cli corp depart_update '{"dept_no": 1, "name": "研发部", "parent_no": 0}'更新指定部门的信息。需要指定部门编号和更新的信息。参见 API 详情。
bash
fx-api-cli corp depart_update '{"dept_no": 1, "name": "研发部", "parent_no": 0}'Update information of the specified department. Department number and the information to be updated are required. See API Details.
corp.depart.delete — 删除部门接口
corp.depart.delete — Delete Department API
bash
fx-api-cli corp depart_delete '{"dept_no": 1}'删除指定部门。需要指定部门编号。参见 API 详情。
bash
fx-api-cli corp depart_delete '{"dept_no": 1}'Delete the specified department. Department number is required. See API Details.
corp.depart.get — 获取部门信息接口
corp.depart.get — Get Department Information API
bash
fx-api-cli corp depart_get '{"dept_no": 1}'获取指定部门的详细信息。需要指定部门编号。参见 API 详情。
bash
fx-api-cli corp depart_get '{"dept_no": 1}'Get detailed information of the specified department. Department number is required. See API Details.
corp.depart.import — 导入部门接口
corp.depart.import — Import Departments API
bash
fx-api-cli corp depart_import '{"dept_list": [{"name": "技术部", "parent_no": 0}, {"name": "产品部", "parent_no": 0}]}'批量导入部门。需要指定部门列表。参见 API 详情。
bash
fx-api-cli corp depart_import '{"dept_list": [{"name": "技术部", "parent_no": 0}, {"name": "产品部", "parent_no": 0}]}'Import departments in batch. Department list is required. See API Details.
corp.role.list — 获取角色列表接口
corp.role.list — Get Role List API
bash
fx-api-cli corp role_list '{}'获取企业的角色列表。
bash
fx-api-cli corp role_list '{}'Get the role list of the enterprise.
corp.role.create — 创建角色接口
corp.role.create — Create Role API
bash
fx-api-cli corp role_create '{"name": "管理员", "description": "系统管理员"}'创建新角色。需要指定角色名称和描述。
bash
fx-api-cli corp role_create '{"name": "管理员", "description": "系统管理员"}'Create a new role. Role name and description are required.
corp.role.update — 更新角色接口
corp.role.update — Update Role API
bash
fx-api-cli corp role_update '{"role_id": "role_id_1", "name": "超级管理员", "description": "系统超级管理员"}'更新指定角色的信息。需要指定角色 ID 和更新的信息。
bash
fx-api-cli corp role_update '{"role_id": "role_id_1", "name": "超级管理员", "description": "系统超级管理员"}'Update information of the specified role. Role ID and the information to be updated are required.
corp.role.delete — 删除角色接口
corp.role.delete — Delete Role API
bash
fx-api-cli corp role_delete '{"role_id": "role_id_1"}'删除指定角色。需要指定角色 ID。
bash
fx-api-cli corp role_delete '{"role_id": "role_id_1"}'Delete the specified role. Role ID is required.
corp.role.user_list — 获取角色用户列表接口
corp.role.user_list — Get Role User List API
bash
fx-api-cli corp role_user_list '{"role_id": "role_id_1"}'获取指定角色的用户列表。需要指定角色 ID。
bash
fx-api-cli corp role_user_list '{"role_id": "role_id_1"}'Get user list of the specified role. Role ID is required.
corp.role.user_add — 添加角色用户接口
corp.role.user_add — Add Role User API
bash
fx-api-cli corp role_user_add '{"role_id": "role_id_1", "user_id_list": ["user_id_1", "user_id_2"]}'向指定角色添加用户。需要指定角色 ID 和用户 ID 列表。
bash
fx-api-cli corp role_user_add '{"role_id": "role_id_1", "user_id_list": ["user_id_1", "user_id_2"]}'Add users to the specified role. Role ID and user ID list are required.
corp.role.user_remove — 移除角色用户接口
corp.role.user_remove — Remove Role User API
bash
fx-api-cli corp role_user_remove '{"role_id": "role_id_1", "user_id_list": ["user_id_1"]}'从指定角色中移除用户。需要指定角色 ID 和用户 ID 列表。
bash
fx-api-cli corp role_user_remove '{"role_id": "role_id_1", "user_id_list": ["user_id_1"]}'Remove users from the specified role. Role ID and user ID list are required.
corp.role_group.list — 获取角色组列表接口
corp.role_group.list — Get Role Group List API
bash
fx-api-cli corp role_group_list '{}'获取企业的角色组列表。
bash
fx-api-cli corp role_group_list '{}'Get the role group list of the enterprise.
corp.role_group.create — 创建角色组接口
corp.role_group.create — Create Role Group API
bash
fx-api-cli corp role_group_create '{"name": "管理组", "description": "管理相关角色组"}'创建新角色组。需要指定角色组名称和描述。
bash
fx-api-cli corp role_group_create '{"name": "管理组", "description": "管理相关角色组"}'Create a new role group. Role group name and description are required.
corp.role_group.update — 更新角色组接口
corp.role_group.update — Update Role Group API
bash
fx-api-cli corp role_group_update '{"group_id": "group_id_1", "name": "超级管理组", "description": "超级管理相关角色组"}'更新指定角色组的信息。需要指定角色组 ID 和更新的信息。
bash
fx-api-cli corp role_group_update '{"group_id": "group_id_1", "name": "超级管理组", "description": "超级管理相关角色组"}'Update information of the specified role group. Role group ID and the information to be updated are required.
corp.role_group.delete — 删除角色组接口
corp.role_group.delete — Delete Role Group API
bash
fx-api-cli corp role_group_delete '{"group_id": "group_id_1"}'删除指定角色组。需要指定角色组 ID。
bash
fx-api-cli corp role_group_delete '{"group_id": "group_id_1"}'Delete the specified role group. Role group ID is required.
corp.guest.depart_list — 获取访客部门列表接口
corp.guest.depart_list — Get Guest Department List API
bash
fx-api-cli corp guest_depart_list '{}'获取企业的访客部门列表。
bash
fx-api-cli corp guest_depart_list '{}'Get the guest department list of the enterprise.
corp.guest.user_list — 获取访客用户列表接口
corp.guest.user_list — Get Guest User List API
bash
fx-api-cli corp guest_user_list '{"dept_no": 1}'获取指定访客部门的用户列表。需要指定部门编号。
bash
fx-api-cli corp guest_user_list '{"dept_no": 1}'Get user list of the specified guest department. Department number is required.
corp.guest.user_get — 获取访客用户信息接口
corp.guest.user_get — Get Guest User Information API
bash
fx-api-cli corp guest_user_get '{"user_id": "user_id_1"}'获取指定访客用户的详细信息。需要指定用户 ID。
bash
fx-api-cli corp guest_user_get '{"user_id": "user_id_1"}'Get detailed information of the specified guest user. User ID is required.
核心规则
Core Rules
用户 ID 查找规则
User ID Lookup Rules
- 当用户需要操作用户但未提供用户 ID 时:
- 调用 获取部门用户列表
corp.depart.user_list - 根据用户提供的条件(如用户名、姓名等)过滤用户
- 匹配策略:
- 精确匹配唯一结果:直接使用
- 模糊匹配多个结果:展示候选列表让用户选择
- 无匹配结果:告知用户未找到
- 调用
- When a user needs to operate a user but does not provide a user ID:
- Call to get the department user list
corp.depart.user_list - Filter users according to the conditions provided by the user (such as username, name, etc.)
- Matching Strategy:
- Exact match with unique result: use directly
- Fuzzy match with multiple results: display candidate list for user selection
- No matching result: inform the user that no match is found
- Call
部门编号查找规则
Department Number Lookup Rules
- 当用户需要操作部门但未提供部门编号时:
- 调用 获取部门列表
corp.depart.list - 根据用户提供的条件(如部门名称)过滤部门
- 匹配策略:
- 精确匹配唯一结果:直接使用
- 模糊匹配多个结果:展示候选列表让用户选择
- 无匹配结果:告知用户未找到
- 调用
- When a user needs to operate a department but does not provide a department number:
- Call to get the department list
corp.depart.list - Filter departments according to the conditions provided by the user (such as department name)
- Matching Strategy:
- Exact match with unique result: use directly
- Fuzzy match with multiple results: display candidate list for user selection
- No matching result: inform the user that no match is found
- Call
角色 ID 查找规则
Role ID Lookup Rules
- 当用户需要操作角色但未提供角色 ID 时:
- 调用 获取角色列表
corp.role.list - 根据用户提供的条件(如角色名称)过滤角色
- 匹配策略:
- 精确匹配唯一结果:直接使用
- 模糊匹配多个结果:展示候选列表让用户选择
- 无匹配结果:告知用户未找到
- 调用
- When a user needs to operate a role but does not provide a role ID:
- Call to get the role list
corp.role.list - Filter roles according to the conditions provided by the user (such as role name)
- Matching Strategy:
- Exact match with unique result: use directly
- Fuzzy match with multiple results: display candidate list for user selection
- No matching result: inform the user that no match is found
- Call
操作确认规则
Operation Confirmation Rules
- 删除操作:执行删除用户、部门、角色等操作前必须向用户确认
- 批量操作:执行批量操作前必须向用户确认操作的数量和范围
- Delete operation: You must confirm with the user before performing operations such as deleting users, departments, roles, etc.
- Batch operation: You must confirm the quantity and scope of the operation with the user before performing batch operations
典型工作流
Typical Workflows
查询用户信息
Query User Information
用户query示例:
- "帮我查询用户信息"
- "查看用户详情"
执行流程:
- 通过 用户 ID 查找规则 确定目标用户的
user_id - 调用 获取用户详情
corp.user.get - 展示用户的姓名、登录名、部门等信息
User query examples:
- "Help me query user information"
- "View user details"
Execution process:
- Determine the of the target user through the User ID Lookup Rules
user_id - Call to get user details
corp.user.get - Display the user's name, login name, department and other information
创建用户
Create User
用户query示例:
- "帮我创建新用户"
- "添加用户"
执行流程:
- 收集用户提供的用户信息(姓名、登录名、部门等)
- 调用 创建用户
corp.user.create - 展示创建结果,包括新用户的 ID
User query examples:
- "Help me create a new user"
- "Add user"
Execution process:
- Collect the user information provided by the user (name, login name, department, etc.)
- Call to create a user
corp.user.create - Display the creation result, including the ID of the new user
更新用户
Update User
用户query示例:
- "帮我更新用户信息"
- "修改用户资料"
执行流程:
- 通过 用户 ID 查找规则 确定目标用户的
user_id - 收集用户提供的更新内容
- 调用 更新用户信息
corp.user.update - 展示更新结果
User query examples:
- "Help me update user information"
- "Modify user profile"
Execution process:
- Determine the of the target user through the User ID Lookup Rules
user_id - Collect the updated content provided by the user
- Call to update user information
corp.user.update - Display the update result
删除用户
Delete User
用户query示例:
- "帮我删除用户"
- "移除用户"
执行流程:
- 通过 用户 ID 查找规则 确定目标用户的
user_id - 向用户确认删除操作
- 调用 删除用户
corp.user.delete - 展示删除结果
User query examples:
- "Help me delete a user"
- "Remove user"
Execution process:
- Determine the of the target user through the User ID Lookup Rules
user_id - Confirm the deletion operation with the user
- Call to delete the user
corp.user.delete - Display the deletion result
查询部门列表
Query Department List
用户query示例:
- "帮我查询部门列表"
- "查看企业部门"
执行流程:
- 调用 获取部门列表
corp.depart.list - 展示每个部门的名称和编号
User query examples:
- "Help me query the department list"
- "View enterprise departments"
Execution process:
- Call to get the department list
corp.depart.list - Display the name and number of each department
创建部门
Create Department
用户query示例:
- "帮我创建新部门"
- "添加部门"
执行流程:
- 收集用户提供的部门信息(名称、父部门等)
- 调用 创建部门
corp.depart.create - 展示创建结果,包括新部门的编号
User query examples:
- "Help me create a new department"
- "Add department"
Execution process:
- Collect the department information provided by the user (name, parent department, etc.)
- Call to create a department
corp.depart.create - Display the creation result, including the number of the new department
更新部门
Update Department
用户query示例:
- "帮我更新部门信息"
- "修改部门名称"
执行流程:
- 通过 部门编号查找规则 确定目标部门的
dept_no - 收集用户提供的更新内容
- 调用 更新部门信息
corp.depart.update - 展示更新结果
User query examples:
- "Help me update department information"
- "Modify department name"
Execution process:
- Determine the of the target department through the Department Number Lookup Rules
dept_no - Collect the updated content provided by the user
- Call to update department information
corp.depart.update - Display the update result
删除部门
Delete Department
用户query示例:
- "帮我删除部门"
- "移除部门"
执行流程:
- 通过 部门编号查找规则 确定目标部门的
dept_no - 向用户确认删除操作
- 调用 删除部门
corp.depart.delete - 展示删除结果
User query examples:
- "Help me delete a department"
- "Remove department"
Execution process:
- Determine the of the target department through the Department Number Lookup Rules
dept_no - Confirm the deletion operation with the user
- Call to delete the department
corp.depart.delete - Display the deletion result
查询角色列表
Query Role List
用户query示例:
- "帮我查询角色列表"
- "查看企业角色"
执行流程:
- 调用 获取角色列表
corp.role.list - 展示每个角色的名称和 ID
User query examples:
- "Help me query the role list"
- "View enterprise roles"
Execution process:
- Call to get the role list
corp.role.list - Display the name and ID of each role
创建角色
Create Role
用户query示例:
- "帮我创建新角色"
- "添加角色"
执行流程:
- 收集用户提供的角色信息(名称、描述等)
- 调用 创建角色
corp.role.create - 展示创建结果,包括新角色的 ID
User query examples:
- "Help me create a new role"
- "Add role"
Execution process:
- Collect the role information provided by the user (name, description, etc.)
- Call to create a role
corp.role.create - Display the creation result, including the ID of the new role
管理角色用户
Manage Role Users
用户query示例:
- "帮我向角色添加用户"
- "从角色中移除用户"
执行流程:
- 通过 角色 ID 查找规则 确定目标角色的
role_id - 收集用户提供的用户 ID 列表
- 根据操作类型调用 或
corp.role.user_addcorp.role.user_remove - 展示操作结果
User query examples:
- "Help me add users to the role"
- "Remove users from the role"
Execution process:
- Determine the of the target role through the Role ID Lookup Rules
role_id - Collect the user ID list provided by the user
- Call or
corp.role.user_addaccording to the operation typecorp.role.user_remove - Display the operation result
错误处理
Error Handling
- 用户未找到:明确告知用户未找到对应用户
- 部门未找到:明确告知用户未找到对应部门
- 角色未找到:明确告知用户未找到对应角色
- 权限不足:明确告知用户无权限执行操作
- API错误:展示具体错误信息,必要时重试
- 网络问题:HTTP错误时主动重试最多3次
- User not found: Clearly inform the user that the corresponding user is not found
- Department not found: Clearly inform the user that the corresponding department is not found
- Role not found: Clearly inform the user that the corresponding role is not found
- Insufficient permissions: Clearly inform the user that there is no permission to perform the operation
- API error: Display specific error information, retry if necessary
- Network problem: Actively retry up to 3 times when HTTP error occurs