feat(watermark): 在二维码中央添加圆形头像

- 在 WatermarkInfo 实体中添加 faceFile 字段,用于存储头像文件
- 在 LeicaWatermarkOperator 和 NormalWatermarkOperator 中实现头像添加功能
- 在 GoodsServiceImpl 中下载用户头像并传递给 watermarkInfo
This commit is contained in:
2025-08-20 23:13:38 +08:00
parent 29f142f53f
commit f981791039
4 changed files with 113 additions and 2 deletions

View File

@@ -691,6 +691,13 @@ public class GoodsServiceImpl implements GoodsService {
return defaultUrlList;
}
tmpFile.add(qrcode);
File faceFile = new File("face_"+face.getId()+".jpg");
try {
HttpUtil.downloadFile(face.getFaceUrl().replace("oss.zhentuai.com", "frametour-assets.oss-cn-shanghai-internal.aliyuncs.com"), faceFile);
tmpFile.add(faceFile);
} catch (Exception e) {
log.error("download face error", e);
}
List<GoodsUrlVO> collect = defaultUrlList.stream().peek(item -> {
Optional<SourceWatermarkEntity> any = watermarkEntityList.stream()
.filter(watermark -> watermark.getSourceId().equals(item.getGoodsId()))
@@ -723,6 +730,7 @@ public class GoodsServiceImpl implements GoodsService {
info.setQrcodeFile(qrcode);
info.setScenicLine(text);
info.setDatetime(item.getCreateTime());
info.setFaceFile(faceFile);
info.setDtFormat(scenicConfig.getWatermarkDtFormat());
info.setWatermarkedFile(watermarkedFile);
try {