715 lines
41 KiB
Markdown
715 lines
41 KiB
Markdown
# API 参考
|
||
|
||
> AIBridge 全部接口方法索引,按模块分组。
|
||
|
||
## 认证模块 - AuthAPI
|
||
|
||
**类名:** `AuthAPI`
|
||
**模块文件:** `aibridge.modules.auth`
|
||
**依赖:** 也可通过 `JNPFClient` 直接调用(`client.login()` 等)
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `login(account, password)` | POST | `/api/oauth/Login` | 登录获取 Token |
|
||
| `logout()` | POST | `/api/oauth/Logout` | 退出登录 |
|
||
| `get_user_info(system_code, is_backend)` | GET | `/api/oauth/CurrentUser` | 获取当前用户信息 |
|
||
| `get_login_config()` | GET | `/api/oauth/getLoginConfig` | 获取登录配置 |
|
||
| `get_config(account)` | GET | `/api/oauth/getConfig/{account}` | 获取系统默认配置 |
|
||
| `get_ticket()` | GET | `/api/oauth/getTicket` | 获取登录票据 |
|
||
| `get_ticket_status(ticket)` | GET | `/api/oauth/getTicketStatus/{ticket}` | 获取票据登录状态 |
|
||
| `unlock(data)` | POST | `/api/oauth/LockScreen` | 锁屏解锁 |
|
||
| `socials_login(params)` | POST | `/api/oauth/Login/socials` | 第三方登录回调 |
|
||
| `get_code_certificate()` | GET | `/api/oauth/codeCertificate` | 扫码登录获取凭证 |
|
||
| `get_code_certificate_status(ticket)` | GET | `/api/oauth/codeCertificateStatus/{ticket}` | 凭证状态 |
|
||
| `update_password_message()` | POST | `/api/oauth/updatePasswordMessage` | 修改密码信息发送 |
|
||
|
||
## 菜单管理 - MenuAPI
|
||
|
||
**类名:** `MenuAPI`
|
||
**URL 前缀:** `/api/system/Menu`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(data)` | GET | `/api/system/Menu/ModuleBySystem` | 获取菜单列表 |
|
||
| `get_selector(data, id)` | GET | `/api/system/Menu/Selector/{id}` | 上级菜单下拉框 |
|
||
| `get_selector_all(data)` | GET | `/api/system/Menu/Selector/All` | 菜单列表(下拉框,仅 system 子节点) |
|
||
| `get_all_menus()` | - | `data_model.query(base_module)` | ★ 获取所有菜单(按 system_id 过滤,扁平列表) |
|
||
| `get_user_menu_tree()` | - | `/api/oauth/CurrentUser` | ★ 获取用户可见菜单树(多级嵌套结构) |
|
||
| `get_children(parent_id)` | - | - | 获取指定菜单的子菜单(递归查找) |
|
||
| `get_selector_filter(data, id)` | GET | `/api/system/Menu/SelectorFilter/{id}` | 上级菜单下拉框(发布过滤) |
|
||
| `get_selector_form(data)` | GET | `/api/system/Menu/Selector/Form` | 菜单表单选择器 |
|
||
| `get_system_menu()` | GET | `/api/system/Menu/getSystemMenu` | 菜单表单树 |
|
||
| `get_menu_list_form_type(data)` | GET | `/api/system/Menu/Selector/Page` | 特定类型菜单(带分页) |
|
||
| `create(data)` | POST | `/api/system/Menu` | 新建菜单 |
|
||
| `update(data)` | PUT | `/api/system/Menu/{id}` | 修改菜单 |
|
||
| `get_info(menu_id)` | GET | `/api/system/Menu/{menu_id}` | 菜单详情 |
|
||
| `delete(menu_id)` | DELETE | `/api/system/Menu/{menu_id}` | 删除菜单(不推荐) |
|
||
| `soft_delete(menu_id)` | PUT | `/api/system/Menu/{menu_id}` | 软删除:parentId=-100、停用、改名改编码(避免冲突) |
|
||
| `move_to_deleted(menu_ids)` | PUT | - | 批量软删除 |
|
||
| `export(menu_id)` | GET | `/api/system/Menu/{menu_id}/Actions/Export` | 导出菜单数据 |
|
||
| `get_permission_group(data)` | GET | `/api/system/Menu/getPermissionGroup/{id}` | 查看权限组 |
|
||
| `get_permission_info(data)` | GET | `/api/system/Menu/getPermission/{id}/{permissionId}` | 获取权限 |
|
||
| `create_directory_menu(...)` | POST | `/api/system/Menu` | 创建目录菜单(type=1)✅ |
|
||
| `create_form_menu(...)` | POST | `/api/system/Menu` | 创建功能菜单(type=3)✅ 自动修复 |
|
||
| `create_page_menu(...)` | POST | `/api/system/Menu` | 创建Vue页面菜单(type=2)✅ |
|
||
| `create_app_directory_menu(...)` | POST | `/api/system/Menu` | 创建移动端目录菜单(category=App) |
|
||
| `create_app_form_menu(...)` | POST | `/api/system/Menu` | 创建移动端功能菜单(category=App) |
|
||
| `create_app_form_menu_with_parent(...)` | POST | `/api/system/Menu` | 创建移动端菜单,自动创建父目录 |
|
||
| `update_parent(menu_id, new_parent_id)` | PUT | `/api/system/Menu/{menu_id}` | 修改菜单父级 |
|
||
| `batch_update_parent(menu_ids, new_parent_id)` | PUT | - | 批量修改菜单父级 |
|
||
| `get_id_by_en_code(en_code)` | GET | - | 通过enCode查询菜单ID |
|
||
| `get_id_by_name(full_name)` | GET | - | 通过名称查询菜单ID |
|
||
|
||
## 用户管理 - UserAPI
|
||
|
||
**类名:** `UserAPI`
|
||
**URL 前缀:** `/api/permission/Users`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(params)` | GET | `/api/permission/Users` | 用户列表(分页) |
|
||
| `get_selector(data)` | GET | `/api/permission/Users/Selector` | 用户下拉框 |
|
||
| `create(data)` | POST | `/api/permission/Users` | 新建用户 |
|
||
| `update(data)` | PUT | `/api/permission/Users/{id}` | 修改用户 |
|
||
| `get_info(user_id)` | GET | `/api/permission/Users/{user_id}` | 用户信息 |
|
||
| `delete(user_id)` | DELETE | `/api/permission/Users/{user_id}` | 删除用户 |
|
||
| `batch_delete(data)` | POST | `/api/permission/Users/BatchDelete` | 批量删除 |
|
||
| `reset_password(user_id, data)` | POST | `/api/permission/Users/{id}/Actions/ResetPassword` | 重置密码 |
|
||
| `batch_update_state(data)` | POST | `/api/permission/Users/BatchUpdateState` | 批量更新状态 |
|
||
| `unlock(user_id)` | PUT | `/api/permission/Users/{id}/Actions/unlock` | 解除锁定 |
|
||
| `get_user_info_list(ids)` | POST | `/api/permission/Users/getUserList` | 批量获取用户信息 |
|
||
| `export_excel(data)` | GET | `/api/permission/Users/ExportData` | 导出 Excel |
|
||
| `template_download()` | GET | `/api/permission/Users/TemplateDownload` | 导入模板下载 |
|
||
| `import_data(data)` | POST | `/api/permission/Users/ImportData` | 导入用户 |
|
||
| `import_preview(data)` | GET | `/api/permission/Users/ImportPreview` | 导入预览 |
|
||
| `export_exception_data(data)` | POST | `/api/permission/Users/ExportExceptionData` | 导出错误数据 |
|
||
| `get_selected_list(ids)` | POST | `/api/permission/Users/getSelectedList` | 获取选中用户信息 |
|
||
| `get_work_by_user(data)` | GET | `/api/permission/Users/getWorkByUser` | 离职交接数据 |
|
||
| `work_handover(data)` | POST | `/api/permission/Users/workHandover` | 工作交接 |
|
||
| `get_receive_user_list(data)` | GET | `/api/permission/Users/ReceiveUserList` | 同部门/岗位/公司用户 |
|
||
| `get_same_pos_user(data)` | GET | `/api/permission/Users/{id}/SelectorByUserPosId` | 相同岗位用户 |
|
||
| `get_user_position(user_id)` | GET | `/api/permission/Users/{user_id}/GetPosition` | 获取用户岗位 |
|
||
| `set_user_position(data)` | POST | `/api/permission/Users/{id}/SetPosition` | 设置用户岗位 |
|
||
| `batch_set_user_position(data)` | POST | `/api/permission/Users/SetPositionBatch` | 批量设置岗位 |
|
||
| `get_auth_group(data)` | GET | `/api/permission/Users/getAllPermission` | 权限分组 |
|
||
| `get_auth_list(data)` | GET | `/api/permission/Users/Authorize` | 用户查看权限 |
|
||
|
||
## 组织管理 - OrganizeAPI
|
||
|
||
**类名:** `OrganizeAPI`
|
||
**URL 前缀:** `/api/permission/Organize`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_async_list(data)` | GET | `/api/permission/Organize/AsyncList/{parentId}` | 组织列表(异步加载) |
|
||
| `get_list(data)` | GET | `/api/permission/Organize` | 组织列表 |
|
||
| `create(data)` | POST | `/api/permission/Organize` | 新建组织 |
|
||
| `update(data)` | PUT | `/api/permission/Organize/{id}` | 修改组织 |
|
||
| `get_info(org_id)` | GET | `/api/permission/Organize/{org_id}` | 组织信息 |
|
||
| `delete(org_id)` | DELETE | `/api/permission/Organize/{org_id}` | 删除组织 |
|
||
| `get_selector(data)` | GET | `/api/permission/Organize/Selector` | 组织下拉框 |
|
||
| `get_selected_list(ids)` | POST | `/api/permission/Organize/SelectedList` | 选中组织信息 |
|
||
| `get_organize_condition(ids)` | POST | `/api/permission/Organize/OrganizeCondition` | 通过ID获取组织列表 |
|
||
| `get_org_and_pos_selector(data)` | GET | `/api/permission/Organize/AsyncPosList` | 组织和岗位下拉框 |
|
||
| `export_excel(data)` | GET | `/api/permission/Organize/ExportData` | 导出 Excel |
|
||
| `template_download()` | GET | `/api/permission/Organize/TemplateDownload` | 导入模板 |
|
||
| `import_data(data)` | POST | `/api/permission/Organize/ImportData` | 导入 |
|
||
| `import_preview(data)` | GET | `/api/permission/Organize/ImportPreview` | 导入预览 |
|
||
| `export_exception_data(data)` | POST | `/api/permission/Organize/ExportExceptionData` | 导出错误数据 |
|
||
|
||
## 角色管理 - RoleAPI
|
||
|
||
**类名:** `RoleAPI`
|
||
**URL 前缀:** `/api/permission/Role`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(data)` | GET | `/api/permission/Role` | 角色列表 |
|
||
| `get_selector(type_, is_system)` | GET | `/api/permission/Role/Selector` | 角色下拉框 |
|
||
| `create(data)` | POST | `/api/permission/Role` | 新建角色 |
|
||
| `update(data)` | PUT | `/api/permission/Role/{id}` | 修改角色 |
|
||
| `get_info(role_id)` | GET | `/api/permission/Role/{role_id}` | 角色信息 |
|
||
| `delete(role_id)` | DELETE | `/api/permission/Role/{role_id}` | 删除角色 |
|
||
| `get_role_by_condition(data)` | POST | `/api/permission/Role/RoleCondition` | 选中角色信息 |
|
||
| `create_role_relation(data)` | POST | `/api/permission/RoleRelation` | 创建角色关联 |
|
||
| `delete_role_relation(relation_id)` | DELETE | `/api/permission/RoleRelation/{id}` | 删除角色关联 |
|
||
| `get_role_relation_list(data)` | GET | `/api/permission/RoleRelation` | 角色关联列表 |
|
||
|
||
## 岗位管理 - PositionAPI
|
||
|
||
**类名:** `PositionAPI`
|
||
**URL 前缀:** `/api/permission/Position`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(data)` | GET | `/api/permission/Position` | 岗位列表 |
|
||
| `get_selector(data)` | GET | `/api/permission/Position/Selector` | 岗位下拉框 |
|
||
| `create(data)` | POST | `/api/permission/Position` | 新建岗位 |
|
||
| `update(data)` | PUT | `/api/permission/Position/{id}` | 修改岗位 |
|
||
| `get_info(pos_id)` | GET | `/api/permission/Position/{pos_id}` | 岗位信息 |
|
||
| `delete(pos_id)` | DELETE | `/api/permission/Position/{pos_id}` | 删除岗位 |
|
||
|
||
## 数据字典 - DictionaryAPI
|
||
|
||
**类名:** `DictionaryAPI`
|
||
**分类前缀:** `/api/system/DictionaryType`
|
||
**数据前缀:** `/api/system/DictionaryData`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| **分类管理** | | | |
|
||
| `get_type_list()` | GET | `/api/system/DictionaryType` | 字典分类列表 |
|
||
| `get_type_selector(id)` | GET | `/api/system/DictionaryType/Selector/{id}` | 分类下拉框 |
|
||
| `create_type(data)` | POST | `/api/system/DictionaryType` | 添加分类 |
|
||
| `update_type(data)` | PUT | `/api/system/DictionaryType/{id}` | 修改分类 |
|
||
| `get_type_info(type_id)` | GET | `/api/system/DictionaryType/{type_id}` | 分类信息 |
|
||
| `delete_type(type_id)` | DELETE | `/api/system/DictionaryType/{type_id}` | 删除分类 |
|
||
| **字典数据** | | | |
|
||
| `get_data_list(type_id, params)` | GET | `/api/system/DictionaryData/{type_id}` | 数据列表 |
|
||
| `get_all()` | GET | `/api/system/DictionaryData/All` | 全部字典数据 |
|
||
| `get_data_type_selector(type_id, is_tree, id)` | GET | `/api/system/DictionaryData/{type_id}/Selector/{id}` | 分类下拉框 |
|
||
| `get_data_selector(type_id)` | GET | `/api/system/DictionaryData/{type_id}/Data/Selector` | 数据下拉框 |
|
||
| `create_data(data)` | POST | `/api/system/DictionaryData` | 添加字典数据 |
|
||
| `update_data(data)` | PUT | `/api/system/DictionaryData/{id}` | 修改字典数据 |
|
||
| `get_data_info(data_id)` | GET | `/api/system/DictionaryData/{data_id}/Info` | 字典数据信息 |
|
||
| `delete_data(data_id)` | DELETE | `/api/system/DictionaryData/{data_id}` | 删除字典数据 |
|
||
| `export_data(type_id)` | GET | `/api/system/DictionaryData/{type_id}/Actions/Export` | 导出数据 |
|
||
|
||
## 可视化开发 - VisualDevAPI
|
||
|
||
**类名:** `VisualDevAPI`
|
||
**核心前缀:** `/api/visualdev/Base`
|
||
**数据操作前缀:** `/api/visualdev/OnlineDev`
|
||
**代码生成前缀:** `/api/visualdev/Generater`
|
||
|
||
### 功能 CRUD
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(data)` | GET | `/api/visualdev/Base` | 功能列表 |
|
||
| `get_form_list(data)` | GET | `/api/visualdev/Base/list` | 功能列表(集成助手) |
|
||
| `create(data)` | POST | `/api/visualdev/Base` | 新建功能 |
|
||
| `update(data)` | PUT | `/api/visualdev/Base/{id}` | 修改功能 |
|
||
| `get_info(func_id)` | GET | `/api/visualdev/Base/{func_id}` | 功能详情 |
|
||
| `delete(func_id)` | DELETE | `/api/visualdev/Base/{func_id}` | 删除功能 |
|
||
| `soft_delete(func_id)` | PUT | `/api/visualdev/Base/{func_id}` | 软删除:改名改编码、sortCode沉底(避免冲突) |
|
||
| `copy(func_id)` | POST | `/api/visualdev/Base/{id}/Actions/Copy` | 复制功能 |
|
||
| `release(func_id)` | POST | `/api/visualdev/Base/{id}/Actions/Release` | **发布功能** |
|
||
| `get_release_menu(func_id)` | GET | `/api/visualdev/Base/{id}/getReleaseMenu` | 已发布菜单 |
|
||
| `create_menu(func_id, data)` | POST | `/api/visualdev/Base/{id}/Actions/Module` | 生成菜单 |
|
||
| `get_form_data_fields(func_id, filter_type)` | GET | `/api/visualdev/Base/{id}/FormDataFields` | 表单主表属性列表 |
|
||
| `get_field_data_select(data)` | GET | `/api/visualdev/Base/{modelId}/FieldDataSelect` | 表单数据下拉框 |
|
||
| `get_selector(data)` | GET | `/api/visualdev/Base/Selector` | 功能下拉框 |
|
||
| `get_column_list(data)` | GET | `/api/visualdev/Base/getColumnList` | 列表字段 |
|
||
| `get_list_by_system(data)` | GET | `/api/visualdev/Base/getListBySystem` | 跨应用菜单 |
|
||
| `get_id_by_en_code(en_code)` | GET | `/api/visualdev/Base/Id/{enCode}` | 通过enCode查询功能ID |
|
||
|
||
### OnlineDev 数据操作
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_config(model_id, data)` | GET | `/api/visualdev/OnlineDev/{id}/Config` | 列表配置 JSON |
|
||
| `get_config_by_menu_id(data)` | GET | `/api/visualdev/OnlineDev/Config` | 通过菜单获取配置 |
|
||
| `get_form_data(model_id)` | GET | `/api/visualdev/OnlineDev/{id}/FormData` | 表单配置 JSON |
|
||
| `get_model_list(model_id, data)` | POST | `/api/visualdev/OnlineDev/{id}/List` | 数据列表 |
|
||
| `create_model(model_id, data)` | POST | `/api/visualdev/OnlineDev/{id}` | 新建数据 |
|
||
| `update_model(model_id, data)` | PUT | `/api/visualdev/OnlineDev/{id}/{recordId}` | 修改数据 |
|
||
| `get_model_info(model_id, record_id, menu_id)` | GET | `/api/visualdev/OnlineDev/{id}/{recordId}` | 数据详情 |
|
||
| `delete_model(model_id, record_id)` | DELETE | `/api/visualdev/OnlineDev/{id}/{recordId}` | 删除数据 |
|
||
| `batch_delete_model(model_id, data)` | POST | `/api/visualdev/OnlineDev/batchDelete/{id}` | 批量删除 |
|
||
| `get_data_change(model_id, data)` | POST | `/api/visualdev/OnlineDev/{id}/DataChange` | 数据变更对比 |
|
||
| `export_model_data(model_id, data)` | POST | `/api/visualdev/OnlineDev/{id}/Actions/ExportData` | 导出数据 |
|
||
| `get_template(model_id)` | GET | `/api/visualdev/OnlineDev/{id}/Template` | 下载导入模板 |
|
||
| `export_data(model_id)` | POST | `/api/visualdev/OnlineDev/{id}/Actions/Export` | 导出模板 |
|
||
| `launch_flow(model_id, data)` | POST | `/api/visualdev/OnlineDev/{id}/actionLaunchFlow` | 发起流程 |
|
||
| `get_relation_query(data)` | POST | `/api/visualdev/OnlineDev/RelationQuery` | 关联查询 |
|
||
|
||
### 个人视图
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_view_list(data)` | GET | `/api/visualdev/personal` | 视图列表 |
|
||
| `create_view(data)` | POST | `/api/visualdev/personal` | 新建视图 |
|
||
| `update_view(data)` | PUT | `/api/visualdev/personal/{id}` | 修改视图 |
|
||
| `delete_view(view_id, menu_id)` | DELETE | `/api/visualdev/personal/{id}?menuId=xxx` | 删除视图 |
|
||
| `set_default_view(view_id, menu_id)` | PUT | `/api/visualdev/personal/{id}/setDefault?menuId=xxx` | 设置默认视图 |
|
||
|
||
### 代码生成
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `download_code(func_id, data)` | POST | `/api/visualdev/Generater/{id}/Actions/DownloadCode` | 下载代码 |
|
||
| `code_preview(func_id, data)` | POST | `/api/visualdev/Generater/{id}/Actions/CodePreview` | 代码预览 |
|
||
| `get_alias_info(func_id)` | GET | `/api/visualdev/Generater/{id}/Alias/Info` | 命名规范 |
|
||
| `save_alias(func_id, data)` | POST | `/api/visualdev/Generater/{id}/Alias/Save` | 更新命名规范 |
|
||
|
||
### AI / OCR / 跨应用
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_ai_info(data)` | POST | `/api/visualdev/ai/form` | AI 表单生成 |
|
||
| `get_ocr_data(data)` | POST | `/api/visualdev/ocr` | OCR 识别 |
|
||
| `get_share_list()` | GET | `/api/visualdev/share` | 跨应用表单列表 |
|
||
| `get_share_info(ids)` | POST | `/api/visualdev/share/SelectedList` | 跨应用表单详情 |
|
||
| `save_share(data)` | POST | `/api/visualdev/share/save` | 保存跨应用回显 |
|
||
| `get_share_selector()` | GET | `/api/visualdev/share/Selector` | 功能下拉框(含跨应用) |
|
||
|
||
## 代码生成器 - CodeGenerator
|
||
|
||
**类名:** `CodeGenerator`
|
||
**模块文件:** `aibridge.utils.code_generator`
|
||
**说明:** JNPF VisualDev 代码生成与命名修复封装,自动处理 JNPF 类名前缀 bug。
|
||
|
||
### 生成与修复
|
||
|
||
| 方法 | 说明 |
|
||
|------|------|
|
||
| `generate(func_id, module_name, **kwargs)` | 生成前后端代码,返回 `{success, frontend_path, backend_path}` |
|
||
| `fix_class_names(backend_path, old_class_prefix, new_class_prefix, frontend_path)` | 修复类名前缀,返回 `{backend: [(old, new), ...], frontend: int}` |
|
||
|
||
> `fix_class_names()` 的 `old_class_prefix` 可不传,会自动从 `formData.tableName` 计算(如 `ais_aisproject` → `Ais_aisproject`)。
|
||
|
||
### 使用示例
|
||
|
||
```python
|
||
from aibridge import JNPFClient, JNPFConfig
|
||
from aibridge.utils.code_generator import CodeGenerator
|
||
|
||
config = JNPFConfig()
|
||
client = JNPFClient.from_config(config)
|
||
client.login()
|
||
|
||
gen = CodeGenerator(client, config)
|
||
|
||
# 1. 生成代码
|
||
result = gen.generate(
|
||
func_id="808986025610185477",
|
||
module_name="Project", # 纯业务名 PascalCase
|
||
enable_flow=0,
|
||
tables='0',
|
||
form_type='2',
|
||
)
|
||
frontend_path = result['frontend_path']
|
||
backend_path = result['backend_path']
|
||
|
||
# 2. 自动修复类名前缀(old_prefix 可省略)
|
||
fix_result = gen.fix_class_names(backend_path, None, "Project", frontend_path)
|
||
# fix_result = {'backend': [('Ais_aisprojectEntity', 'ProjectEntity'), ...], 'frontend': 1}
|
||
```
|
||
|
||
### 运行脚本
|
||
|
||
推荐使用 `aibridge/utils/run-codegen.py`,一键完成代码生成 + 类名修复 + 菜单挂载:
|
||
|
||
```bash
|
||
python3 aibridge/utils/run-codegen.py <func_id> <module_name> [menu_title]
|
||
# 示例:
|
||
python3 aibridge/utils/run-codegen.py 808986025610185477 Project 项目管理
|
||
```
|
||
|
||
## OnlineDev 便捷模块 - OnlineDevAPI
|
||
|
||
**类名:** `OnlineDevAPI`
|
||
**URL 前缀:** `/api/visualdev/OnlineDev`
|
||
**说明:** 面向数据 CRUD 的便捷封装,参数更简洁。
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_config(model_id, **kwargs)` | GET | `/api/visualdev/OnlineDev/{id}/Config` | 列表配置 |
|
||
| `get_form_data(model_id)` | GET | `/api/visualdev/OnlineDev/{id}/FormData` | 表单配置 |
|
||
| `list(model_id, data)` | POST | `/api/visualdev/OnlineDev/{id}/List` | 数据列表 |
|
||
| `create(model_id, data)` | POST | `/api/visualdev/OnlineDev/{id}` | 新建记录 |
|
||
| `update(model_id, record_id, data)` | PUT | `/api/visualdev/OnlineDev/{id}/{recordId}` | 更新记录 |
|
||
| `get(model_id, record_id, menu_id)` | GET | `/api/visualdev/OnlineDev/{id}/{recordId}` | 记录详情 |
|
||
| `delete(model_id, record_id)` | DELETE | `/api/visualdev/OnlineDev/{id}/{recordId}` | 删除记录 |
|
||
| `batch_delete(model_id, ids)` | POST | `/api/visualdev/OnlineDev/batchDelete/{id}` | 批量删除 |
|
||
| `export_data(model_id, data)` | POST | `/api/visualdev/OnlineDev/{id}/Actions/ExportData` | 导出数据 |
|
||
| `import_template(model_id)` | GET | `/api/visualdev/OnlineDev/{id}/Template` | 导入模板 |
|
||
|
||
## 工作流 - WorkflowAPI
|
||
|
||
**类名:** `WorkflowAPI`
|
||
**详细文档:** [工作流指南](workflow/README.md)
|
||
|
||
### 流程任务
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_launch_list(data)` | GET | `/api/workflow/task` | 发起列表 |
|
||
| `get_task_info(task_id, data)` | GET | `/api/workflow/task/{id}` | 审批详情 |
|
||
| `create(data)` | POST | `/api/workflow/task` | 新建发起 |
|
||
| `update(data)` | PUT | `/api/workflow/task/{id}` | 更新发起 |
|
||
| `delete(task_id)` | DELETE | `/api/workflow/task/{id}` | 删除发起 |
|
||
| `launch_recall(task_id, data)` | PUT | `/api/workflow/task/Recall/{id}` | 撤回 |
|
||
| `revoke(task_id, data)` | PUT | `/api/workflow/task/Revoke/{id}` | 撤销 |
|
||
| `press(task_id)` | POST | `/api/workflow/task/Press/{id}` | 催办 |
|
||
| `get_event_log(task_id)` | GET | `/api/workflow/task/{id}/EventLog` | 事件日志 |
|
||
| `get_task_user_list(data)` | GET | `/api/workflow/task/TaskUserList/{taskId}` | 相关人员 |
|
||
| `get_sub_flow_info(node_code, flow_id)` | GET | `/api/workflow/task/SubFlowInfo` | 子流程 |
|
||
| `get_start_form_info(task_id)` | GET | `/api/workflow/task/ViewStartForm/{id}` | 发起表单 |
|
||
| `retry_outside(node_id)` | GET | `/api/workflow/task/Hooks/Retry/{id}` | 外部节点重试 |
|
||
|
||
### 审批操作
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_before_list(category, data)` | GET | `/api/workflow/operator/List/{category}` | 待审核列表 |
|
||
| `audit(operator_id, data)` | POST | `/api/workflow/operator/Audit/{id}` | 审核(同意/拒绝) |
|
||
| `sign(operator_id)` | POST | `/api/workflow/operator/Sign` | 签收 |
|
||
| `cancel_sign(operator_id)` | POST | `/api/workflow/operator/Sign` | 退签 |
|
||
| `batch_sign(data)` | POST | `/api/workflow/operator/Sign` | 批量签收/退签 |
|
||
| `handle(operator_id)` | POST | `/api/workflow/operator/Transact` | 开始办理 |
|
||
| `batch_handle(data)` | POST | `/api/workflow/operator/Transact` | 批量办理 |
|
||
| `save_audit(operator_id, data)` | POST | `/api/workflow/operator/SaveAudit/{id}` | 暂存审批 |
|
||
| `assist(operator_id, data)` | POST | `/api/workflow/operator/Assist/{id}` | 协办 |
|
||
| `audit_recall(operator_id, data)` | POST | `/api/workflow/operator/Recall/{id}` | 撤回审核 |
|
||
| `transfer(operator_id, data)` | POST | `/api/workflow/operator/Transfer/{id}` | 转审 |
|
||
| `back(operator_id, data)` | POST | `/api/workflow/operator/SendBack/{id}` | 退回审核 |
|
||
| `get_back_node_list(operator_id)` | GET | `/api/workflow/operator/SendBackNodeList/{id}` | 退回节点列表 |
|
||
| `free_approver(operator_id, data)` | POST | `/api/workflow/operator/AddSign/{id}` | 加签 |
|
||
| `reduce_approver(operator_id, data)` | POST | `/api/workflow/operator/ReduceApprover/{id}` | 减签 |
|
||
| `get_candidate_user(data)` | POST | `/api/workflow/operator/CandidateUser/{id}` | 候选人列表 |
|
||
| `get_candidates(operator_id, data)` | POST | `/api/workflow/operator/CandidateNode/{id}` | 是否有候选人 |
|
||
| `batch_operation(data)` | POST | `/api/workflow/operator/BatchOperation` | 批量审批 |
|
||
| `get_record_list(task_id, node_id)` | GET | `/api/workflow/operator/RecordList` | 经办列表 |
|
||
| `get_circulate_list(task_id, node_id)` | GET | `/api/workflow/operator/CirculateList` | 抄送人员 |
|
||
|
||
### 流程模板
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_template_list(data)` | GET | `/api/workflow/template` | 模板列表 |
|
||
| `get_flow_list(form_id)` | GET | `/api/workflow/template/{form_id}/FlowList` | 表单流程列表 |
|
||
| `create_template(data)` | POST | `/api/workflow/template` | 新建模板 |
|
||
| `update_template(data)` | PUT | `/api/workflow/template/{id}` | 修改模板 |
|
||
| `get_template_info(template_id)` | GET | `/api/workflow/template/{id}` | 模板信息 |
|
||
| `delete_template(template_id)` | DELETE | `/api/workflow/template/{id}` | 删除模板 |
|
||
| `copy_template(template_id)` | POST | `/api/workflow/template/{id}/Actions/Copy` | 复制模板 |
|
||
| `export_template(template_id)` | GET | `/api/workflow/template/{id}/Actions/Export` | 导出模板 |
|
||
| `save_flow(data)` | POST | `/api/workflow/template/Save` | 保存流程设计 |
|
||
| `get_flow_info(template_id)` | GET | `/api/workflow/template/Info/{id}` | 流程设计详情 |
|
||
| `get_version_list(template_id)` | GET | `/api/workflow/template/Version/{id}` | 版本列表 |
|
||
| `copy_version(version_id)` | POST | `/api/workflow/template/Version/{id}/Actions/Copy` | 复制版本 |
|
||
| `get_flow_form_info(template_id)` | GET | `/api/workflow/template/{id}/FormInfo` | 流程表单(小ID) |
|
||
| `get_flow_start_form_info(template_id)` | GET | `/api/workflow/template/StartForm/{id}` | 流程表单(大ID) |
|
||
| `get_tree_list(form_type)` | GET | `/api/workflow/template/TreeList` | 流程列表(树形) |
|
||
|
||
### Webhook
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_webhook_url(data)` | GET | `/api/workflow/Hooks/getUrl` | 获取 Webhook URL |
|
||
| `get_webhook_params(random_str)` | GET | `/api/workflow/Hooks/getParams/{str}` | 获取 Webhook 字段 |
|
||
| `webhook_start(flow_id, random_str)` | GET | `/api/workflow/Hooks/{flowId}/start/{str}` | 开启 Webhook |
|
||
|
||
### 委托与监控
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_delegate_list(data)` | GET | `/api/workflow/FlowDelegate` | 委托列表 |
|
||
| `get_monitor_list(data)` | GET | `/api/workflow/FlowMonitor` | 监控列表 |
|
||
|
||
### 便捷方法
|
||
|
||
| 方法 | 说明 | 返回 |
|
||
|------|------|------|
|
||
| `create_simple_flow(full_name, en_code, form_id, approver_user_ids, ...)` | 一键创建流程模板并发布 | `{"template_id": ..., "version_id": ...}` |
|
||
| `launch_task(flow_version_id, form_data, urgent, draft)` | 快捷发起流程(formData 直接传 dict) | `APIResponse` |
|
||
| `approve(operator_id, opinion)` | 快捷审批通过(自动带 status=1) | `APIResponse` |
|
||
| `reject(operator_id, opinion)` | 快捷审批拒绝(自动带 status=2) | `APIResponse` |
|
||
| `get_pending_tasks(page, page_size)` | 获取待审批列表 | `list[dict]` |
|
||
| `build_simple_flow_xml()` | 获取简单流程默认 BPMN XML(URL 编码) | `str` |
|
||
| `build_simple_flow_nodes(form_id, ...)` | 构建简单流程 flowNodes 配置 | `dict` |
|
||
|
||
> **注意**:`create_template()` 必须包含 `flowXml/flowNodes/flowConfig`,否则后端 NPE 导致 templateJson 未创建。`create_simple_flow()` 已内置处理。
|
||
|
||
## 数据库表管理 - DataModelAPI
|
||
|
||
**类名:** `DataModelAPI`
|
||
**模块文件:** `aibridge.modules.data_model`
|
||
**URL 前缀:** `/api/system/DataModel`
|
||
**前端参考:** `api/systemData/dataModel.ts`
|
||
**说明:** 数据库表和字段的 CRUD 操作,支持通过 DataSource 管理数据库连接。优先使用此模块操作数据库,而非直接执行 SQL。
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_table_list(link_id, data)` | GET | `/api/system/DataModel/{link_id}/Tables` | 获取数据库表列表 |
|
||
| `get_table_list_all(link_id, data)` | GET | `/api/system/DataModel/{link_id}/TableAll` | 获取表列表(含视图) |
|
||
| `preview_table(link_id, table, data)` | GET | `/api/system/DataModel/{link_id}/Table/{table}/Preview` | 预览表数据 |
|
||
| `get_table_info(link_id, table)` | GET | `/api/system/DataModel/{link_id}/Table/{table}` | 获取表详情(含字段列表) |
|
||
| `create_table(link_id, data)` | POST | `/api/system/DataModel/{link_id}/Table` | 新建数据库表 |
|
||
| `update_table(link_id, data)` | PUT | `/api/system/DataModel/{link_id}/Table` | 修改数据库表 |
|
||
| `delete_table(link_id, table)` | DELETE | `/api/system/DataModel/{link_id}/Table/{table}` | 删除数据库表 |
|
||
| `get_field_list(link_id, table, field_type)` | GET | `/api/system/DataModel/{link_id}/Tables/{table}/Fields` | 获取表字段列表 |
|
||
| `add_fields(link_id, data)` | PUT | `/api/system/DataModel/{link_id}/addFields` | 新增字段 |
|
||
| `export_table(link_id, table)` | GET | `/api/system/DataModel/{link_id}/Table/{table}/Actions/Export` | 导出表结构 |
|
||
|
||
> **注意**:`link_id="0"` 表示主数据库,非 0 值表示业务数据源(通过 db_link_id 指定)。
|
||
|
||
## 数据接口 - DataInterfaceAPI
|
||
|
||
**类名:** `DataInterfaceAPI`
|
||
**模块文件:** `aibridge.modules.data_interface`
|
||
**URL 前缀:** `/api/system/DataInterface`
|
||
**前端参考:** `api/systemData/dataInterface.ts`
|
||
**后端实现:** `DataInterfaceServiceImpl.java`
|
||
**Swagger:** http://127.0.0.1:30000/doc.html#/home(仅本地可用)
|
||
|
||
### 基础 CRUD
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(data)` | GET | `/api/system/DataInterface` | 接口列表(**必须传 category**) |
|
||
| `get_selector()` | GET | `/api/system/DataInterface/Selector` | 接口下拉框 |
|
||
| `create(data)` | POST | `/api/system/DataInterface` | 新建接口 |
|
||
| `update(data)` | PUT | `/api/system/DataInterface/{id}` | 修改接口 |
|
||
| `get_info(di_id)` | GET | `/api/system/DataInterface/{di_id}` | 接口信息 |
|
||
| `delete(di_id)` | DELETE | `/api/system/DataInterface/{di_id}` | 删除接口 |
|
||
| `copy(di_id)` | POST | `/api/system/DataInterface/{di_id}/Actions/Copy` | 复制接口 |
|
||
|
||
### 执行与预览
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `preview(di_id, data)` | POST | `/api/system/DataInterface/{id}/Actions/Preview` | **预览/执行** |
|
||
| `execute(di_id, params)` | - | 调用 preview | **简化执行**(dict 自动转 paramList) |
|
||
| `get_param(di_id)` | GET | `/api/system/DataInterface/GetParam/{id}` | 接口参数 |
|
||
| `export_data(di_id)` | GET | `/api/system/DataInterface/{id}/Actions/Export` | 导出数据 |
|
||
| `get_log(di_id, data)` | GET | `/api/system/DataInterfaceLog/{id}` | 调用日志 |
|
||
| `get_data_select(data)` | POST | `/api/system/DataInterface/{id}/Actions/List` | 接口数据列表 |
|
||
| `get_data_info_by_ids(di_id, data)` | POST | `/api/system/DataInterface/{id}/Actions/InfoByIds` | 批量详情 |
|
||
| `get_fields(di_id, data)` | POST | `/api/system/DataInterface/{id}/Actions/GetFields` | 接口字段 |
|
||
| `get_selector_list(data)` | GET | `/api/system/DataInterface/getList` | 接口列表(工作流用) |
|
||
|
||
### Payload 构建器(静态方法,无需 client)
|
||
|
||
| 方法 | 说明 |
|
||
|------|------|
|
||
| `build_payload(...)` | 构建标准 SQL 接口 payload(含 isPostPosition=0) |
|
||
| `build_select_payload(...)` | 构建 SELECT payload(支持 hasPage 分页) |
|
||
| `build_insert_payload(...)` | 构建 INSERT payload(自动生成 SQL) |
|
||
| `build_update_payload(...)` | 构建 UPDATE payload(自动生成 SQL) |
|
||
| `build_delete_payload(...)` | 构建 DELETE payload(自动生成 SQL) |
|
||
|
||
### 一键创建接口(封装 create + ID 查找)
|
||
|
||
| 方法 | 说明 |
|
||
|------|------|
|
||
| `create_sql_interface(...)` | 创建 SQL 接口并返回 ID |
|
||
| `create_select_interface(...)` | 创建 SELECT 接口(支持分页) |
|
||
| `create_insert_interface(...)` | 创建 INSERT 接口 |
|
||
| `create_update_interface(...)` | 创建 UPDATE 接口 |
|
||
| `create_delete_interface(...)` | 创建 DELETE 接口 |
|
||
|
||
### 三种接口类型
|
||
|
||
| type | 名称 | 说明 |
|
||
|------|------|------|
|
||
| 1 | SQL操作 | 执行 SQL(增删改查) |
|
||
| 2 | 静态数据 | 返回固定 JSON(图表、选项) |
|
||
| 3 | API操作 | 调用 HTTP 接口,独有异常验证 |
|
||
|
||
**dataExceptionJson**(仅 type=3):JS 脚本返回 true 继续、false 重试(最多3次)。错误码 SYS121/122/123。
|
||
**dataJsJson**(所有类型):最终返回前的 JS 数据处理脚本。
|
||
|
||
### 使用示例
|
||
|
||
```python
|
||
from aibridge.modules.data_interface import DataInterfaceAPI
|
||
|
||
di = DataInterfaceAPI(client)
|
||
|
||
# 创建查询接口(一步到位,返回 ID)
|
||
query_id = di.create_sql_interface(
|
||
full_name="按编码查询",
|
||
en_code="query_by_code",
|
||
sql="SELECT f_id, f_full_name FROM base_visual_dev WHERE f_en_code = {code} AND f_delete_mark = 0",
|
||
parameters=[{"field": "code", "fieldName": "编码", "dataType": "varchar", "required": 1, "sourceType": 1}],
|
||
category="806502782600217349",
|
||
action=3,
|
||
)
|
||
|
||
# 执行查询(简化参数传递)
|
||
rows = di.execute(query_id, {"code": "ABC001"})
|
||
for row in rows:
|
||
print(row["f_id"], row["f_full_name"])
|
||
|
||
# 创建新增接口(使用系统变量 @snowFlakeID)
|
||
insert_id = di.create_sql_interface(
|
||
full_name="新增记录",
|
||
en_code="insert_record",
|
||
sql="INSERT INTO base_visual_dev (f_id, f_full_name, f_en_code, f_type, f_enabled_mark, f_tenant_id, f_delete_mark) VALUES (@snowFlakeID, {name}, {code}, {type}, 1, '0', 0)",
|
||
parameters=[
|
||
{"field": "name", "fieldName": "名称", "dataType": "varchar", "required": 1, "sourceType": 1},
|
||
{"field": "code", "fieldName": "编码", "dataType": "varchar", "required": 1, "sourceType": 1},
|
||
{"field": "type", "fieldName": "类型", "dataType": "varchar", "required": 0, "sourceType": 1},
|
||
],
|
||
category="806502782600217349",
|
||
action=1,
|
||
)
|
||
di.execute(insert_id, {"name": "测试", "code": "TEST001", "type": "1"})
|
||
|
||
# 清理
|
||
di.safe_delete(query_id)
|
||
di.safe_delete(insert_id)
|
||
```
|
||
|
||
### 注意事项
|
||
|
||
- `get_list()` **必须传 category 参数**,否则返回空列表
|
||
- 创建 payload 中 **isPostPosition 必须为 0**(否则 Preview NPE)
|
||
- SQL 中的 `{参数名}` 会被替换为 `?`,**不能包含 `{}` 空字面量**
|
||
- action=1(增删改)返回 data=[],这是正常行为
|
||
- 多租户环境下 `dbLinkId=0` 连接主库,部分表可能不在主库中(参见 troubleshooting.md)
|
||
|
||
## 门户管理 - PortalAPI
|
||
|
||
**类名:** `PortalAPI`
|
||
**核心前缀:** `/api/visualdev/Portal`
|
||
**管理前缀:** `/api/system/PortalManage`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(data)` | GET | `/api/visualdev/Portal` | 门户列表 |
|
||
| `get_info(portal_id)` | GET | `/api/visualdev/Portal/{id}` | 门户信息 |
|
||
| `create(data)` | POST | `/api/visualdev/Portal` | 新建门户 |
|
||
| `update(data)` | PUT | `/api/visualdev/Portal/{id}` | 修改门户 |
|
||
| `delete(portal_id)` | DELETE | `/api/visualdev/Portal/{id}` | 删除门户 |
|
||
| `copy(portal_id)` | POST | `/api/visualdev/Portal/{id}/Actions/Copy` | 复制门户 |
|
||
| `export_portal(portal_id)` | POST | `/api/visualdev/Portal/{id}/Actions/Export` | 导出门户 |
|
||
| `get_selector(type_, system_id)` | GET | `/api/visualdev/Portal/Selector` | 门户下拉框 |
|
||
| `release(portal_id, data)` | PUT | `/api/visualdev/Portal/Actions/release/{id}` | 发布门户 |
|
||
| `get_manage_list(data)` | GET | `/api/system/PortalManage/list/{systemId}` | 门户管理列表 |
|
||
| `get_manage_info(manage_id)` | GET | `/api/system/PortalManage/{id}` | 门户管理详情 |
|
||
|
||
## 消息公告 - MessageAPI
|
||
|
||
**类名:** `MessageAPI`
|
||
**公告前缀:** `/api/message/Notice`
|
||
**消息前缀:** `/api/message`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_notice_list(data)` | POST | `/api/message/Notice/List` | 公告列表 |
|
||
| `create_notice(data)` | POST | `/api/message/Notice` | 新建公告 |
|
||
| `update_notice(data)` | PUT | `/api/message/Notice/{id}` | 修改公告 |
|
||
| `get_notice_info(notice_id)` | GET | `/api/message/Notice/{id}` | 公告详情 |
|
||
| `delete_notice(notice_id)` | DELETE | `/api/message/Notice/{id}` | 删除公告 |
|
||
| `release_notice(notice_id)` | PUT | `/api/message/Notice/{id}/Actions/Release` | 发布公告 |
|
||
| `get_message_list(data)` | GET | `/api/message` | 消息列表 |
|
||
| `read_all(data)` | POST | `/api/message/Actions/ReadAll` | 全部已读 |
|
||
| `read_info(msg_id)` | GET | `/api/message/ReadInfo/{id}` | 查看消息 |
|
||
| `delete_message(data)` | DELETE | `/api/message/Record` | 删除消息 |
|
||
|
||
## 数据源 - DataSourceAPI
|
||
|
||
**类名:** `DataSourceAPI`
|
||
**连接前缀:** `/api/system/DataSource`
|
||
**同步前缀:** `/api/system/DataSync`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(data)` | GET | `/api/system/DataSource` | 连接列表 |
|
||
| `get_selector(type_)` | GET | `/api/system/DataSource/Selector` | 连接下拉框 |
|
||
| `create(data)` | POST | `/api/system/DataSource` | 新建连接 |
|
||
| `update(data)` | PUT | `/api/system/DataSource/{id}` | 修改连接 |
|
||
| `get_info(ds_id)` | GET | `/api/system/DataSource/{id}` | 连接信息 |
|
||
| `delete(ds_id)` | DELETE | `/api/system/DataSource/{id}` | 删除连接 |
|
||
| `test_connection(data)` | POST | `/api/system/DataSource/Actions/Test` | 测试连接 |
|
||
| `data_sync(data)` | POST | `/api/system/DataSync` | 同步校验 |
|
||
| `execute(data)` | POST | `/api/system/DataSync/Actions/Execute` | 同步数据 |
|
||
| `batch_execute(data)` | POST | `/api/system/DataSync/Actions/batchExecute` | 批量同步 |
|
||
| `check_db_link(data)` | POST | `/api/system/DataSync/Actions/checkDbLink` | 校验连接 |
|
||
|
||
### 扩展方法(ssw-common)
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `create_db_link(full_name, service_name, db_type="MySQL", description="")` | POST | `/api/common/dblinkExt/create` | 创建数据源(使用系统默认配置) |
|
||
| `get_db_link_id(en_code)` | GET | `/api/common/dblinkExt/id/{en_code}` | 获取数据源ID |
|
||
| `test_connection_ext(db_type, host, port, user_name, password, service_name)` | POST | `/api/common/dblinkExt/test` | 测试数据库连接 |
|
||
| `create_database(db_name, db_type="MySQL")` | POST | `/api/common/dblinkExt/createDatabase` | 创建数据库(使用系统默认配置) |
|
||
|
||
## 打印模板 - PrintDevAPI
|
||
|
||
**类名:** `PrintDevAPI`
|
||
**URL 前缀:** `/api/system/printDev`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(data)` | GET | `/api/system/printDev` | 模板列表 |
|
||
| `get_selector()` | GET | `/api/system/printDev/Selector` | 模板下拉框 |
|
||
| `create(data)` | POST | `/api/system/printDev` | 新建模板 |
|
||
| `update(data)` | PUT | `/api/system/printDev/{id}` | 修改模板 |
|
||
| `get_info(pd_id)` | GET | `/api/system/printDev/{id}` | 模板信息 |
|
||
| `delete(pd_id)` | DELETE | `/api/system/printDev/{id}` | 删除模板 |
|
||
| `copy(pd_id)` | POST | `/api/system/printDev/{id}/Actions/Copy` | 复制模板 |
|
||
| `get_preview(pd_id)` | GET | `/api/system/printDev/{id}/Actions/Preview` | 打印预览 |
|
||
| `save_version(data)` | POST | `/api/system/printDev/Save` | 修改设计 |
|
||
| `get_version_info(version_id)` | GET | `/api/system/printDev/Info/{id}` | 设计详情 |
|
||
| `get_version_list(pd_id)` | GET | `/api/system/printDev/Version/{id}` | 版本列表 |
|
||
|
||
## Univer 报表 - ReportAPI
|
||
|
||
**类名:** `ReportAPI`
|
||
**URL 前缀:** `/api/Report`
|
||
**注意:** 使用 `use_report_client=True`(报表独立服务)
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_list(data)` | GET | `/api/Report` | 报表列表 |
|
||
| `create(data)` | POST | `/api/Report` | 新建报表 |
|
||
| `update(data)` | PUT | `/api/Report/{id}` | 修改报表 |
|
||
| `get_info(report_id)` | GET | `/api/Report/{id}` | 报表信息 |
|
||
| `delete(report_id)` | DELETE | `/api/Report/{id}` | 删除报表 |
|
||
| `copy(report_id)` | POST | `/api/Report/{id}/Actions/Copy` | 复制报表 |
|
||
| `get_data(data)` | POST | `/api/Report/Data` | 获取数据 |
|
||
| `save_version(data)` | POST | `/api/Report/Save` | 修改设计 |
|
||
| `get_version_list(report_id)` | GET | `/api/Report/Version/{id}` | 版本列表 |
|
||
| `get_selector()` | GET | `/api/Report/Selector` | 报表下拉框 |
|
||
| `get_preview_design(report_id, data)` | POST | `/api/Report/data/{id}/preview` | 预览设计 |
|
||
|
||
## 系统配置 - SysConfigAPI
|
||
|
||
**类名:** `SysConfigAPI`
|
||
**URL 前缀:** `/api/system/SysConfig`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_config()` | GET | `/api/system/SysConfig` | 获取配置 |
|
||
| `update(data)` | PUT | `/api/system/SysConfig` | 更新配置 |
|
||
| `test_qy(data, type_)` | POST | `/api/system/SysConfig/{type}/testQyWebChatConnect` | 测试企微 |
|
||
| `test_ding(data)` | POST | `/api/system/SysConfig/testDingTalkConnect` | 测试钉钉 |
|
||
| `get_admin_list()` | GET | `/api/system/SysConfig/getAdminList` | 系统管理员 |
|
||
| `set_admin_list(data)` | PUT | `/api/system/SysConfig/setAdminList` | 设置管理员 |
|
||
| `get_socials_config()` | GET | `/api/system/SysConfig/socials` | 第三方配置 |
|
||
| `syn_organize_to_ding(type_, dept_id)` | GET | `/api/system/SynThirdInfo/synAllOrganizeSysToDing` | 同步组织到钉钉 |
|
||
| `syn_user_to_ding(type_, dept_id)` | GET | `/api/system/SynThirdInfo/synAllUserSysToDing` | 同步用户到钉钉 |
|
||
| `syn_organize_to_qy(type_, dept_id)` | GET | `/api/system/SynThirdInfo/synAllOrganizeSysToQy` | 同步组织到企微 |
|
||
| `syn_user_to_qy(type_, dept_id)` | GET | `/api/system/SynThirdInfo/synAllUserSysToQy` | 同步用户到企微 |
|
||
|
||
## 文件管理 - FileAPI
|
||
|
||
**类名:** `FileAPI`
|
||
**文档前缀:** `/api/file/Document`
|
||
|
||
| 方法 | HTTP | URL | 说明 |
|
||
|------|------|-----|------|
|
||
| `get_download_url(file_type, file_name)` | GET | `/api/file/Download/{type}/{name}` | 下载链接 |
|
||
| `get_pack_download_url(file_type, data)` | POST | `/api/file/PackDownload/{type}` | 打包下载 |
|
||
| `preview(data)` | GET | `/api/file/Uploader/Preview` | 预览文件 |
|
||
| `chunk_merge(data)` | POST | `/api/file/merge` | 分片组装 |
|
||
| `get_all_list(data)` | GET | `/api/file/Document` | 文档列表 |
|
||
| `create_folder(data)` | POST | `/api/file/Document` | 添加文件夹 |
|
||
| `update(data)` | PUT | `/api/file/Document/{id}` | 修改文件名 |
|
||
| `batch_delete(ids)` | POST | `/api/file/Document/BatchDelete` | 批量删除 |
|
||
| `get_folder_tree(ids)` | POST | `/api/file/Document/FolderTree` | 文件夹树 |
|
||
| `get_info(doc_id)` | GET | `/api/file/Document/{id}` | 文件信息 |
|
||
| `move_to(to_id, ids)` | PUT | `/api/file/Document/Actions/MoveTo/{id}` | 批量移动 |
|
||
| `create_share(ids, user_ids)` | POST | `/api/file/Document/Actions/Share` | 批量分享 |
|
||
| `get_share_out_list(data)` | GET | `/api/file/Document/Share` | 我的共享 |
|
||
| `get_share_tome_list(data)` | GET | `/api/file/Document/ShareTome` | 共享给我 |
|
||
| `get_trash_list(data)` | GET | `/api/file/Document/Trash` | 回收站 |
|
||
| `trash_recovery(ids)` | POST | `/api/file/Document/Trash/Actions/Recovery` | 还原 |
|
||
| `pack_download(ids)` | POST | `/api/file/Document/PackDownload` | 批量下载 |
|