华为云obs;

This commit is contained in:
王奎兴
2025-12-26 14:19:38 +08:00
parent 4c560ef88c
commit 3ea4bb8170
@@ -332,11 +332,21 @@ public class MenuApi extends BaseController {
"attachment; filename=\"" + filename + "\"") "attachment; filename=\"" + filename + "\"")
.contentType(MediaType.APPLICATION_OCTET_STREAM) .contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(outputStream -> { .body(outputStream -> {
//ObsClient obsClient = null; ObsClient obsClient1 = null;
try { try {
//obsClient = new ObsClient(accessKey, secretKey, endpoint); System.out.println(
"AccessKey:" + obsProperties.getAccessKey() +
"SecretKey:" + obsProperties.getSecretKey()
+ "Endpoint:" + obsProperties.getEndpoint()
);
logger.error(
"AccessKey:" + obsProperties.getAccessKey() +
"SecretKey:" + obsProperties.getSecretKey()
+ "Endpoint:" + obsProperties.getEndpoint()
);
obsClient1 = new ObsClient(obsProperties.getAccessKey(), obsProperties.getSecretKey(), obsProperties.getEndpoint());
GetObjectRequest request = new GetObjectRequest(bucketName, objectKey); GetObjectRequest request = new GetObjectRequest(bucketName, objectKey);
ObsObject obsObject = obsClient.getObject(request); ObsObject obsObject = obsClient1.getObject(request);
try (InputStream inputStream = obsObject.getObjectContent()) { try (InputStream inputStream = obsObject.getObjectContent()) {
byte[] buffer = new byte[8192]; byte[] buffer = new byte[8192];