save_lecture_frag
Save lecture fragments to the backend with upsert by subject, book, and owner. Replace image placeholders with OSS URLs and reject unmatched fragments unless allow_toc_fail is set.
Instructions
片段 IR → :9090 upsert 入库(唯一入库口,UK=subjectId+bookId+owner 幂等覆盖)。需先 login。
图回填:image_map={rid:ossUrl} 把 content 里 〖图:rId〗占位换成 OSS 地址;无 ossUrl 的 image 节点会被剔除 并在 unresolved_images 里报告(不静默丢)。对齐闸:任何 UNMATCHED 片段默认拒绝入库(除非 allow_toc_fail)。 参数: ir_path : convert_lecture_docx 产出的 IR 文件路径(与 frags 二选一,优先) frags : 片段 IR 列表 [{subjectId,title,contentJson,status?}](与 ir_path 二选一) book_id : 教辅套 id(ir_path 里带则以其为准) image_map : {rId: ossUrl}(upload_image 的产物) owner : 归属 uid;省略=登录者(admin 登录省略即官方库覆盖) allow_toc_fail : True 才允许含未匹配 KG 的片段入库(BE 仍会因 subjectId 不存在而单条失败) 返回: BE saveFrags 响应 {ok, owner, results:[{subjectId,action}], stats} + {unresolved_images, view_url?}。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frags | No | ||
| owner | No | ||
| book_id | No | CC7S | |
| ir_path | No | ||
| image_map | No | ||
| allow_toc_fail | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||