2025-09-15 15:48:54 +08:00
|
|
|
package com.cdzy.operations;
|
2025-09-15 10:36:01 +08:00
|
|
|
|
2025-10-14 11:09:22 +08:00
|
|
|
import com.cdzy.operations.utils.MinioUtil;
|
|
|
|
|
import com.cdzy.operations.utils.QRGenUtil;
|
2025-09-15 10:36:01 +08:00
|
|
|
import org.junit.jupiter.api.Test;
|
2025-10-14 11:09:22 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2025-09-15 10:36:01 +08:00
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
2025-10-14 11:09:22 +08:00
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
2025-09-15 10:36:01 +08:00
|
|
|
@SpringBootTest
|
|
|
|
|
class EbikeOperationsApplicationTests {
|
|
|
|
|
|
2025-10-14 11:09:22 +08:00
|
|
|
@Autowired
|
|
|
|
|
private MinioUtil minioUtil;
|
|
|
|
|
|
2025-09-15 10:36:01 +08:00
|
|
|
@Test
|
2025-10-14 11:09:22 +08:00
|
|
|
void contextLoads() throws Exception {
|
|
|
|
|
// List<String> allBucket = minioUtil.getAllBucket();
|
|
|
|
|
// System.out.println(allBucket.contains("bike-qr"));
|
|
|
|
|
ByteArrayInputStream byteArrayInputStream = QRGenUtil.generateQRCodeInputStearm("https://www.cdzhuojing.cn/qrcode?number=" + "060002" + "&_tbScancodeApproach_=scan", "060002");
|
|
|
|
|
minioUtil.uploadFile(byteArrayInputStream,"operations-objects","/bike-qr/test.jpg");
|
|
|
|
|
// minioUtil.deleteObject("bike-qr","test.jpg");
|
|
|
|
|
String showUrl = minioUtil.getBikeQrShowUrl("test.jpg");
|
|
|
|
|
System.out.println(showUrl);
|
2025-09-15 10:36:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|