feat(source): 添加缩略图字段支持

- 在SourceEntity中新增thumbUrl字段用于存储缩略图地址- 在ZTSourceDataService中设置缩略图URL并优化裁剪配置逻辑
- 更新SourceMapper.xml中的SQL语句以支持缩略图字段的插入和更新
- 移除不必要的URL查询条件以提高查询灵活性
This commit is contained in:
2025-10-20 10:05:22 +08:00
parent 2b79302874
commit 8eed685373
3 changed files with 11 additions and 5 deletions

View File

@@ -41,6 +41,10 @@ public class SourceEntity {
* 视频文件存储地址
*/
private String videoUrl;
/**
* 缩略图存储地址
*/
private String thumbUrl;
/**
* 是否被购买 0未购买 1已购买
*/

View File

@@ -56,6 +56,7 @@ public class ZTSourceDataService {
DeviceConfigManager configManager = deviceRepository.getDeviceConfigManager(sourceEntity.getDeviceId());
if (configManager != null) {
if (Strings.isNotBlank(configManager.getString("crop_config"))) {
// 如果有裁剪配置,主URL使用缩略图,同时保持缩略图字段
sourceEntity.setUrl(message.getThumbnailUrl());
}
}
@@ -114,6 +115,7 @@ public class ZTSourceDataService {
entity.setScenicId(message.getScenicId());
entity.setDeviceId(message.getDeviceId());
entity.setUrl(message.getSourceUrl()); // 使用sourceUrl,不使用缩略图
entity.setThumbUrl(message.getThumbnailUrl()); // 设置缩略图URL
entity.setType(2); // 照片类型
// 人脸样本ID处理