feat: 实现素材匹配功能 v0.1.19

- 新增素材匹配服务 (MaterialMatchingService)
  - 支持AI分类匹配、随机匹配等规则
  - 实现模特限制逻辑(每个模特素材只能使用一次)
  - 时长匹配优化(相差越小越好)
  - 详细的匹配统计和失败原因分析

- 新增Tauri API命令
  - execute_material_matching: 执行素材匹配
  - get_project_material_stats_for_matching: 获取项目素材统计
  - validate_template_binding_for_matching: 验证模板绑定

- 新增前端组件和服务
  - MaterialMatchingResultDialog: 匹配结果对话框
  - MaterialMatchingService: 前端服务层
  - 完整的TypeScript类型定义

- UI集成
  - 在模板绑定列表添加匹配素材按钮
  - 集成到项目详情页面
  - 支持完整的匹配流程和结果展示

- 核心匹配规则
  - 只使用已AI分类的MaterialSegment
  - 每个素材只能使用一次
  - 模特限制:优先同一模特,失败后尝试其他模特
  - 视频时长必须大于模板需求,相差越小匹配度越高

- 测试覆盖
  - 后端服务单元测试
  - 覆盖正常匹配、失败场景、边界情况
This commit is contained in:
imeepos
2025-07-15 14:56:10 +08:00
parent 96b420e149
commit bab1dfc5fd
13 changed files with 1815 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ pub mod draft_parser_tests;
pub mod cloud_upload_service_tests;
pub mod template_service_tests;
pub mod template_integration_tests;
pub mod material_matching_service_tests;
// 测试工具函数
pub mod test_utils {