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入参>'
与企业通讯录管理系统交互。

fx-api-cli
is the provided command line program, all operations are completed by executing
fx-api-cli
commands.
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 时:
    1. 调用
      corp.depart.user_list
      获取部门用户列表
    2. 根据用户提供的条件(如用户名、姓名等)过滤用户
    3. 匹配策略
      • 精确匹配唯一结果:直接使用
      • 模糊匹配多个结果:展示候选列表让用户选择
      • 无匹配结果:告知用户未找到
  • When a user needs to operate a user but does not provide a user ID:
    1. Call
      corp.depart.user_list
      to get the department user list
    2. Filter users according to the conditions provided by the user (such as username, name, etc.)
    3. 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

部门编号查找规则

Department Number Lookup Rules

  • 当用户需要操作部门但未提供部门编号时:
    1. 调用
      corp.depart.list
      获取部门列表
    2. 根据用户提供的条件(如部门名称)过滤部门
    3. 匹配策略
      • 精确匹配唯一结果:直接使用
      • 模糊匹配多个结果:展示候选列表让用户选择
      • 无匹配结果:告知用户未找到
  • When a user needs to operate a department but does not provide a department number:
    1. Call
      corp.depart.list
      to get the department list
    2. Filter departments according to the conditions provided by the user (such as department name)
    3. 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

角色 ID 查找规则

Role ID Lookup Rules

  • 当用户需要操作角色但未提供角色 ID 时:
    1. 调用
      corp.role.list
      获取角色列表
    2. 根据用户提供的条件(如角色名称)过滤角色
    3. 匹配策略
      • 精确匹配唯一结果:直接使用
      • 模糊匹配多个结果:展示候选列表让用户选择
      • 无匹配结果:告知用户未找到
  • When a user needs to operate a role but does not provide a role ID:
    1. Call
      corp.role.list
      to get the role list
    2. Filter roles according to the conditions provided by the user (such as role name)
    3. 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

操作确认规则

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示例
  • "帮我查询用户信息"
  • "查看用户详情"
执行流程
  1. 通过 用户 ID 查找规则 确定目标用户的
    user_id
  2. 调用
    corp.user.get
    获取用户详情
  3. 展示用户的姓名、登录名、部门等信息
User query examples:
  • "Help me query user information"
  • "View user details"
Execution process:
  1. Determine the
    user_id
    of the target user through the User ID Lookup Rules
  2. Call
    corp.user.get
    to get user details
  3. Display the user's name, login name, department and other information

创建用户

Create User

用户query示例
  • "帮我创建新用户"
  • "添加用户"
执行流程
  1. 收集用户提供的用户信息(姓名、登录名、部门等)
  2. 调用
    corp.user.create
    创建用户
  3. 展示创建结果,包括新用户的 ID
User query examples:
  • "Help me create a new user"
  • "Add user"
Execution process:
  1. Collect the user information provided by the user (name, login name, department, etc.)
  2. Call
    corp.user.create
    to create a user
  3. Display the creation result, including the ID of the new user

更新用户

Update User

用户query示例
  • "帮我更新用户信息"
  • "修改用户资料"
执行流程
  1. 通过 用户 ID 查找规则 确定目标用户的
    user_id
  2. 收集用户提供的更新内容
  3. 调用
    corp.user.update
    更新用户信息
  4. 展示更新结果
User query examples:
  • "Help me update user information"
  • "Modify user profile"
Execution process:
  1. Determine the
    user_id
    of the target user through the User ID Lookup Rules
  2. Collect the updated content provided by the user
  3. Call
    corp.user.update
    to update user information
  4. Display the update result

删除用户

Delete User

用户query示例
  • "帮我删除用户"
  • "移除用户"
执行流程
  1. 通过 用户 ID 查找规则 确定目标用户的
    user_id
  2. 向用户确认删除操作
  3. 调用
    corp.user.delete
    删除用户
  4. 展示删除结果
User query examples:
  • "Help me delete a user"
  • "Remove user"
Execution process:
  1. Determine the
    user_id
    of the target user through the User ID Lookup Rules
  2. Confirm the deletion operation with the user
  3. Call
    corp.user.delete
    to delete the user
  4. Display the deletion result

查询部门列表

Query Department List

用户query示例
  • "帮我查询部门列表"
  • "查看企业部门"
执行流程
  1. 调用
    corp.depart.list
    获取部门列表
  2. 展示每个部门的名称和编号
User query examples:
  • "Help me query the department list"
  • "View enterprise departments"
Execution process:
  1. Call
    corp.depart.list
    to get the department list
  2. Display the name and number of each department

创建部门

Create Department

用户query示例
  • "帮我创建新部门"
  • "添加部门"
执行流程
  1. 收集用户提供的部门信息(名称、父部门等)
  2. 调用
    corp.depart.create
    创建部门
  3. 展示创建结果,包括新部门的编号
User query examples:
  • "Help me create a new department"
  • "Add department"
Execution process:
  1. Collect the department information provided by the user (name, parent department, etc.)
  2. Call
    corp.depart.create
    to create a department
  3. Display the creation result, including the number of the new department

更新部门

Update Department

用户query示例
  • "帮我更新部门信息"
  • "修改部门名称"
执行流程
  1. 通过 部门编号查找规则 确定目标部门的
    dept_no
  2. 收集用户提供的更新内容
  3. 调用
    corp.depart.update
    更新部门信息
  4. 展示更新结果
User query examples:
  • "Help me update department information"
  • "Modify department name"
Execution process:
  1. Determine the
    dept_no
    of the target department through the Department Number Lookup Rules
  2. Collect the updated content provided by the user
  3. Call
    corp.depart.update
    to update department information
  4. Display the update result

删除部门

Delete Department

用户query示例
  • "帮我删除部门"
  • "移除部门"
执行流程
  1. 通过 部门编号查找规则 确定目标部门的
    dept_no
  2. 向用户确认删除操作
  3. 调用
    corp.depart.delete
    删除部门
  4. 展示删除结果
User query examples:
  • "Help me delete a department"
  • "Remove department"
Execution process:
  1. Determine the
    dept_no
    of the target department through the Department Number Lookup Rules
  2. Confirm the deletion operation with the user
  3. Call
    corp.depart.delete
    to delete the department
  4. Display the deletion result

查询角色列表

Query Role List

用户query示例
  • "帮我查询角色列表"
  • "查看企业角色"
执行流程
  1. 调用
    corp.role.list
    获取角色列表
  2. 展示每个角色的名称和 ID
User query examples:
  • "Help me query the role list"
  • "View enterprise roles"
Execution process:
  1. Call
    corp.role.list
    to get the role list
  2. Display the name and ID of each role

创建角色

Create Role

用户query示例
  • "帮我创建新角色"
  • "添加角色"
执行流程
  1. 收集用户提供的角色信息(名称、描述等)
  2. 调用
    corp.role.create
    创建角色
  3. 展示创建结果,包括新角色的 ID
User query examples:
  • "Help me create a new role"
  • "Add role"
Execution process:
  1. Collect the role information provided by the user (name, description, etc.)
  2. Call
    corp.role.create
    to create a role
  3. Display the creation result, including the ID of the new role

管理角色用户

Manage Role Users

用户query示例
  • "帮我向角色添加用户"
  • "从角色中移除用户"
执行流程
  1. 通过 角色 ID 查找规则 确定目标角色的
    role_id
  2. 收集用户提供的用户 ID 列表
  3. 根据操作类型调用
    corp.role.user_add
    corp.role.user_remove
  4. 展示操作结果

User query examples:
  • "Help me add users to the role"
  • "Remove users from the role"
Execution process:
  1. Determine the
    role_id
    of the target role through the Role ID Lookup Rules
  2. Collect the user ID list provided by the user
  3. Call
    corp.role.user_add
    or
    corp.role.user_remove
    according to the operation type
  4. 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