feat: integrate new merge_groups API from Core Team

Replace merge_trace implementation with merge_groups API

Changes:
1. src/api/index.ts:
   - Add merge_groups API definition
   - POST /api/v1/file/:file_uuid/groups/merge
   - Parameters: file_uuid, source_groups[], target_group_name

2. src/views/PeopleView.vue:
   - Rewrite executeMerge() function
   - Use group names instead of trace IDs
   - Single API call for all groups
   - Remove trace-level loop

3. src/views/PeopleView.vue:
   - Delete updateClusterAfterMerge() function
   - No longer needed with new API

Benefits:
- ✅ Atomic operation (single API call)
- ✅ Correct merge behavior (groups, not traces)
- ✅ Better performance (1 call vs N calls)
- ✅ Data consistency guaranteed

API behavior:
- Merge N groups into 1 target group
- All traces from source groups merged to target
- Source groups deleted after merge
- Returns traces_merged count

Core API: Implemented by Core Team (2026-07-25)
Status: Ready for testing
This commit is contained in:
2026-07-25 14:25:35 +08:00
parent 042bb45574
commit 8af2dc6128
2 changed files with 48 additions and 68 deletions

View File

@@ -359,6 +359,17 @@ case 'search_keyword': {
case 'merge_trace': {
return { url: `/api/v1/file/${a.file_uuid}/trace/${a.source_id}/merge/${a.target_id}`, method: 'POST' }
}
case 'merge_groups': {
return {
url: `/api/v1/file/${a.fileUuid}/groups/merge`,
method: 'POST',
body: {
file_uuid: a.fileUuid,
source_groups: a.sourceGroups,
target_group_name: a.targetGroupName
}
}
}
case 'bind_face': {
const bindBody: any = { file_uuid: a.fileUuid }
if (a.faceId) bindBody.face_id = a.faceId