refactor(face): 调整人脸识别匹配逻辑以支持场景参数

- 修改 PrinterTvController 中 faceUpload 方法的 scene 参数值从 print 改为 tv
- 在 FaceServiceImpl 中为人脸匹配方法增加 scene 参数支持
- 更新 FaceMatchingOrchestrator 的 orchestrateMatching 方法签名以接收 scene 参数
- 在 FaceService 接口中新增带 scene 参数的 matchFaceId 方法定义
- 更新 VideoTaskGenerator 中调用 matchFaceId 方法时传入 scene 参数
This commit is contained in:
2025-12-17 23:16:48 +08:00
parent 9e6b623b0e
commit 00dd6a16a3
5 changed files with 10 additions and 5 deletions

View File

@@ -34,6 +34,7 @@ public interface FaceService {
SearchFaceRespVo matchFaceId(Long faceId);
SearchFaceRespVo matchFaceId(Long faceId, boolean isNew);
SearchFaceRespVo matchFaceId(Long faceId, boolean isNew, String scene);
ApiResponse<String> deleteFace(Long faceId);

View File

@@ -354,7 +354,7 @@ public class FaceServiceImpl implements FaceService {
}
// 正常执行人脸匹配
SearchFaceRespVo result = faceMatchingOrchestrator.orchestrateMatching(faceId, false);
SearchFaceRespVo result = faceMatchingOrchestrator.orchestrateMatching(faceId, false, null);
// 执行完成后标记,防止2秒内重复调用
faceMatchDedupService.markMatched(face.getMemberId(), face.getScenicId());
@@ -364,7 +364,11 @@ public class FaceServiceImpl implements FaceService {
@Override
public SearchFaceRespVo matchFaceId(Long faceId, boolean isNew) {
return faceMatchingOrchestrator.orchestrateMatching(faceId, isNew);
return matchFaceId(faceId, isNew, null);
}
@Override
public SearchFaceRespVo matchFaceId(Long faceId, boolean isNew, String scene) {
return faceMatchingOrchestrator.orchestrateMatching(faceId, isNew, scene);
}
/**

View File

@@ -108,7 +108,7 @@ public class FaceMatchingOrchestrator {
* @param isNew 是否新用户
* @return 人脸搜索结果
*/
public SearchFaceRespVo orchestrateMatching(Long faceId, boolean isNew) {
public SearchFaceRespVo orchestrateMatching(Long faceId, boolean isNew, String scene) {
if (faceId == null) {
throw new IllegalArgumentException("faceId 不能为空");
}