feat(ai-cam): 实现AI相机免费照片赠送逻辑

- 新增统计免费关联记录数的Mapper方法
- 在AppAiCamServiceImpl中注入ScenicRepository依赖
- 删除旧关系前查询已有免费记录避免重复赠送
- 根据景区配置获取免费照片数量
- 随机选择免费照片并标记为免费状态
- 保留已存在的免费照片记录
- 更新日志记录以区分普通和免费照片数量
This commit is contained in:
2025-12-17 20:47:21 +08:00
parent 144c338972
commit 8e0990832b
3 changed files with 54 additions and 2 deletions

View File

@@ -165,4 +165,12 @@ public interface SourceMapper {
* @return 删除的记录数
*/
int deleteRelationsByFaceIdAndType(Long faceId, Integer type);
/**
* 统计指定faceId和type的免费关联记录数
* @param faceId 人脸ID
* @param type 素材类型
* @return 免费记录数
*/
int countFreeRelationsByFaceIdAndType(Long faceId, Integer type);
}