feat(puzzle): 实现拼图自动填充规则引擎及相关功能

- 新增拼图填充规则管理Controller、DTO、Entity等核心类
- 实现条件评估策略模式,支持多种匹配规则
- 实现数据源解析策略模式,支持多种数据来源
- 新增拼图元素自动填充引擎,支持优先级匹配和动态填充
- 在SourceMapper中增加设备统计和查询相关方法
- 在PuzzleGenerateRequest中新增faceId字段用于触发自动填充
- 完善相关枚举类和工具类,提升系统可维护性和扩展性
This commit is contained in:
2025-11-19 11:10:23 +08:00
parent de421cf0d5
commit 778afaaa83
43 changed files with 4019 additions and 3 deletions

View File

@@ -107,4 +107,28 @@ public interface SourceMapper {
int addFromZTSource(SourceEntity source);
SourceEntity getBySampleIdAndType(Long faceSampleId, Integer type);
/**
* 统计faceId关联的不同设备数量
* @param faceId 人脸ID
* @return 设备数量
*/
Integer countDistinctDevicesByFaceId(Long faceId);
/**
* 根据faceId和设备索引获取source
* @param faceId 人脸ID
* @param deviceIndex 设备索引(从0开始)
* @param type 素材类型(1-视频,2-图片)
* @param sortStrategy 排序策略
* @return source实体
*/
SourceEntity getSourceByFaceAndDeviceIndex(Long faceId, Integer deviceIndex, Integer type, String sortStrategy);
/**
* 获取faceId关联的所有设备ID列表
* @param faceId 人脸ID
* @return 设备ID列表
*/
List<Long> getDeviceIdsByFaceId(Long faceId);
}