后台查询Asin文档更新

This commit is contained in:
super
2026-04-24 15:14:14 +08:00
parent 326f78705d
commit 0caf62c3d2
34 changed files with 798 additions and 540 deletions
@@ -37,6 +37,19 @@ public class OssStorageService {
}
}
public UploadedResult uploadResultFileWithFreshDownloadUrl(File file, String moduleType) {
String objectKey = String.format("result/%s/%s/%s", moduleType.toLowerCase(), UUID.randomUUID(), file.getName());
OSS ossClient = buildClient();
try {
ossClient.putObject(ossProperties.getBucket(), objectKey, file);
Date expiration = new Date(System.currentTimeMillis() + 3600_000L);
URL url = ossClient.generatePresignedUrl(ossProperties.getBucket(), objectKey, expiration);
return new UploadedResult(objectKey, url.toString());
} finally {
ossClient.shutdown();
}
}
public String uploadText(String objectKey, String content) {
if (objectKey == null || objectKey.isBlank()) {
throw new IllegalArgumentException("objectKey must not be blank");
@@ -160,4 +173,7 @@ public class OssStorageService {
ossProperties.getAccessKeySecret()
);
}
public record UploadedResult(String objectKey, String downloadUrl) {
}
}