处理下载为公共模块

This commit is contained in:
super
2026-06-12 13:40:29 +08:00
parent 17236265c6
commit 8672668c33
13 changed files with 62 additions and 37 deletions
@@ -1381,9 +1381,11 @@ public class CollectDataService {
return null;
}
try {
return ossStorageService.generateFreshDownloadUrl(resultFileUrl);
// bucket 对 result/ 前缀已开放公开读,使用无签名公开 URL,避免签名 1 小时过期后下载 403。
// resolveObjectKey 兼容历史存量的旧格式(带签名的完整 URL),统一还原为纯 objectKey 再拼公开 URL。
return ossStorageService.getPublicUrl(ossStorageService.resolveObjectKey(resultFileUrl));
} catch (Exception ex) {
log.warn("[collect-data] generate fresh download url failed resultId={} err={}",
log.warn("[collect-data] build public download url failed resultId={} err={}",
row.getId(), ex.getMessage());
return null;
}