fix(p0): 前端API路径全量迁移到 /templates/{templateId}/editor #666

Merged
auto-approve-bot merged 1 commits from fix/p0-template-editor-api-migration into develop 2026-07-21 08:08:48 +08:00
Owner

变更说明

剪辑计划架构整合 Phase 3 — 前端API路径全量迁移,不打补丁一次改干净。

改动内容

  1. 文件重命名editPlans.tstemplateEditor.ts
  2. 路径迁移:18个带ID的端点从 /template-editors/{planId}/ 迁到 /templates/{templateId}/editor/
  3. 列表/创建接口:迁到 /templates/drafts
  4. 变量名统一:函数参数 planIdtemplateId
  5. 全量引用更新:12个业务文件 + 5个测试文件 + 1个e2e的import路径全部更新

涉及端点(20个)

类型 旧路径 新路径
列表 GET /template-editors GET /templates/drafts
创建 POST /template-editors POST /templates/drafts
详情 GET /template-editors/{id} GET /templates/{id}/editor
更新 PUT /template-editors/{id} PUT /templates/{id}/editor
删除 DELETE /template-editors/{id} DELETE /templates/{id}/editor
生成 POST /template-editors/{id}/generate POST /templates/{id}/editor/generate
生成状态 GET /template-editors/{id}/generation-status GET /templates/{id}/editor/generation-status
生成记录 GET /template-editors/{id}/generations GET /templates/{id}/editor/generations
取消生成 POST /template-editors/{id}/cancel POST /templates/{id}/editor/cancel
AI推荐 POST /template-editors/{id}/ai-recommend POST /templates/{id}/editor/ai-recommend
封面生成 POST /template-editors/{id}/generate-cover POST /templates/{id}/editor/generate-cover
复制 POST /template-editors/{id}/copy POST /templates/{id}/editor/copy
片段列表 GET /template-editors/{id}/clips GET /templates/{id}/editor/clips
片段CRUD /template-editors/{id}/clips/* /templates/{id}/editor/clips/*
片段重排 POST /template-editors/{id}/clips/reorder POST /templates/{id}/editor/clips/reorder
批量删除 POST /template-editors/{id}/clips/batch-delete POST /templates/{id}/editor/clips/batch-delete
素材导入 POST /template-editors/{id}/clips/from-assets POST /templates/{id}/editor/clips/from-assets

待后端确认

  • /templates/drafts 列表和创建接口路径是否正确
  • 生成相关接口(generate/generation-status/generations/cancel)是否全部在 /templates/{id}/editor/

文件统计

19 files changed, +62/-62

### 变更说明 **剪辑计划架构整合 Phase 3 — 前端API路径全量迁移,不打补丁一次改干净。** ### 改动内容 1. **文件重命名**:`editPlans.ts` → `templateEditor.ts` 2. **路径迁移**:18个带ID的端点从 `/template-editors/{planId}/` 迁到 `/templates/{templateId}/editor/` 3. **列表/创建接口**:迁到 `/templates/drafts` 4. **变量名统一**:函数参数 `planId` → `templateId` 5. **全量引用更新**:12个业务文件 + 5个测试文件 + 1个e2e的import路径全部更新 ### 涉及端点(20个) | 类型 | 旧路径 | 新路径 | |------|--------|--------| | 列表 | GET /template-editors | GET /templates/drafts | | 创建 | POST /template-editors | POST /templates/drafts | | 详情 | GET /template-editors/{id} | GET /templates/{id}/editor | | 更新 | PUT /template-editors/{id} | PUT /templates/{id}/editor | | 删除 | DELETE /template-editors/{id} | DELETE /templates/{id}/editor | | 生成 | POST /template-editors/{id}/generate | POST /templates/{id}/editor/generate | | 生成状态 | GET /template-editors/{id}/generation-status | GET /templates/{id}/editor/generation-status | | 生成记录 | GET /template-editors/{id}/generations | GET /templates/{id}/editor/generations | | 取消生成 | POST /template-editors/{id}/cancel | POST /templates/{id}/editor/cancel | | AI推荐 | POST /template-editors/{id}/ai-recommend | POST /templates/{id}/editor/ai-recommend | | 封面生成 | POST /template-editors/{id}/generate-cover | POST /templates/{id}/editor/generate-cover | | 复制 | POST /template-editors/{id}/copy | POST /templates/{id}/editor/copy | | 片段列表 | GET /template-editors/{id}/clips | GET /templates/{id}/editor/clips | | 片段CRUD | /template-editors/{id}/clips/* | /templates/{id}/editor/clips/* | | 片段重排 | POST /template-editors/{id}/clips/reorder | POST /templates/{id}/editor/clips/reorder | | 批量删除 | POST /template-editors/{id}/clips/batch-delete | POST /templates/{id}/editor/clips/batch-delete | | 素材导入 | POST /template-editors/{id}/clips/from-assets | POST /templates/{id}/editor/clips/from-assets | ### 待后端确认 - `/templates/drafts` 列表和创建接口路径是否正确 - 生成相关接口(generate/generation-status/generations/cancel)是否全部在 `/templates/{id}/editor/` 下 ### 文件统计 19 files changed, +62/-62

🚀 预览环境已部署

项目 详情
PR号 #666
预览链接 https://pr-666.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #666 | | 预览链接 | [https://pr-666.preview.xiaoxiajianji.com](https://pr-666.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
xiaoxia force-pushed fix/p0-template-editor-api-migration from 30c9d90cd1 to 8e2004f361 2026-07-21 07:45:36 +08:00 Compare
auto-approve-bot approved these changes 2026-07-21 07:47:08 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot approved these changes 2026-07-21 07:47:09 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
Collaborator

Auto merge skipped after multiple 405 errors: PR may have conflicts or unresolved checks. Please review manually. This is not a CI failure.

Auto merge skipped after multiple 405 errors: PR may have conflicts or unresolved checks. Please review manually. This is not a CI failure.
xiaoxia added 1 commit 2026-07-21 08:05:58 +08:00
fix(p0): 前端API路径全量迁移到 /templates/{templateId}/editor
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 29s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m43s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m48s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m53s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 2m49s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 41s
AI Code Review / AI Code Review (pull_request) Successful in 5m53s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 6m21s
c0ea098459
- editPlans.ts 改名为 templateEditor.ts
- 18个带ID的端点从 /template-editors/{planId}/ 迁移到 /templates/{templateId}/editor/
- 列表/创建接口迁移到 /templates/drafts
- 函数参数 planId 统一改名为 templateId
- 更新12个业务文件 + 5个测试文件 + 1个e2e的import路径
- 共19个文件,路径全部迁完无残留
xiaoxia force-pushed fix/p0-template-editor-api-migration from 8e2004f361 to c0ea098459 2026-07-21 08:05:58 +08:00 Compare
auto-approve-bot merged commit 15c635b553 into develop 2026-07-21 08:08:48 +08:00
auto-approve-bot deleted branch fix/p0-template-editor-api-migration 2026-07-21 08:08:48 +08:00

🗑️ 预览环境已清理

PR #666 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #666 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Collaborator

代码审查结果 - PR #666

⚠️ 问题(0个需要修改)

💡 建议(1个可选)

  1. apps/web/src/test/api/editPlans.test.ts 文件名:建议将测试文件名 editPlans.test.ts 重命名为 templateEditor.test.ts,以保持与源文件 templateEditor.ts 命名的一致性,便于后续维护。
  2. apps/web/src/api/templateEditor.ts 函数命名:文件名已变更为 templateEditor,且 API 路径已迁移至 /templates/...,但内部函数名(如 getEditPlan)仍保留 EditPlan 前缀。虽然不影响功能,但建议后续统一命名风格(例如改为 getTemplateEditorgetDraftTemplate),以降低理解成本。

格式检查通过 | 逻辑审查通过 | 性能良好


🤖 由 AI 代码审查机器人自动生成 | 2026-07-21 08:11:07 | 模型:

## 代码审查结果 - PR #666 ### ⚠️ 问题(0个需要修改) 无 ### 💡 建议(1个可选) 1. **apps/web/src/test/api/editPlans.test.ts 文件名**:建议将测试文件名 `editPlans.test.ts` 重命名为 `templateEditor.test.ts`,以保持与源文件 `templateEditor.ts` 命名的一致性,便于后续维护。 2. **apps/web/src/api/templateEditor.ts 函数命名**:文件名已变更为 `templateEditor`,且 API 路径已迁移至 `/templates/...`,但内部函数名(如 `getEditPlan`)仍保留 `EditPlan` 前缀。虽然不影响功能,但建议后续统一命名风格(例如改为 `getTemplateEditor` 或 `getDraftTemplate`),以降低理解成本。 --- ✅ 格式检查通过 | ✅ 逻辑审查通过 | ✅ 性能良好 --- <sub>🤖 由 AI 代码审查机器人自动生成 | 2026-07-21 08:11:07 | 模型: </sub> <!-- AI_CODE_REVIEW_AUTO_COMMENT -->
Sign in to join this conversation.