feat(image): 启用边缘端水印处理并优化徕卡模板布局算法

- 将边缘端处理默认启用状态从false改为true
- 将边缘端处理超时时间从30秒调整为10秒
- 将徕卡水印模板的固定像素配置转换为基于1920x1080的百分比配置
- 新增多种百分比常量包括底部区域、Logo大小、边距、字体大小等
- 实现动态计算实际像素值的方法替代固定数值
- 在PrinterServiceImpl中注入WatermarkEdgeService依赖
- 配置水印处理流程启用边缘服务和存储适配器
This commit is contained in:
2026-01-16 18:53:31 +08:00
parent 830dd17071
commit 4fac129c3a
5 changed files with 90 additions and 50 deletions

View File

@@ -60,11 +60,11 @@ public class WatermarkConfig {
* 是否启用边缘端处理
*/
@Builder.Default
private final boolean edgeEnabled = false;
private final boolean edgeEnabled = true;
/**
* 边缘端处理超时时间(毫秒)
*/
@Builder.Default
private final long edgeTimeoutMs = 30000L;
private final long edgeTimeoutMs = 10_000L;
}

View File

@@ -190,8 +190,8 @@ public class WatermarkStage extends AbstractPipelineStage<PhotoProcessContext> {
// 构建水印信息用于边缘端处理
WatermarkInfo info = buildWatermarkInfo(context, currentFile, watermarkedFile, type);
// 调用边缘端服务处理
return edgeService.processWatermarkFromFile(info, type, storageAdapter);
// 调用边缘端服务处理,传递 processId 作为 recordId
return edgeService.processWatermarkFromFile(info, type, storageAdapter, context.getProcessId());
} catch (Exception e) {
log.error("边缘端水印处理异常: type={}, error={}", type.getType(), e.getMessage(), e);