|
@@ -1,15 +1,7 @@
|
|
-import cn.hutool.core.io.FileUtil;
|
|
|
|
-import cn.hutool.core.util.ZipUtil;
|
|
|
|
import com.fdkankan.contro.ModelingControlApplication;
|
|
import com.fdkankan.contro.ModelingControlApplication;
|
|
-import com.fdkankan.fyun.oss.UploadToOssUtil;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
import org.junit.jupiter.api.Test;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
-import java.io.File;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.Map;
|
|
|
|
-
|
|
|
|
@SpringBootTest(classes = ModelingControlApplication.class)
|
|
@SpringBootTest(classes = ModelingControlApplication.class)
|
|
class ApplicationTests {
|
|
class ApplicationTests {
|
|
|
|
|
|
@@ -17,17 +9,9 @@ class ApplicationTests {
|
|
void contextLoads() {
|
|
void contextLoads() {
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private UploadToOssUtil uploadToOssUtil;
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void test() throws Exception {
|
|
public void test() throws Exception {
|
|
- // gzip压缩
|
|
|
|
-// FileUtil.appendUtf8String(new String(ZipUtil.gzip(new File("H:\\test\\dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam"))),"H:\\test\\results\\dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
|
- FileUtil.writeBytes(ZipUtil.gzip(new File("H:\\test\\dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam")),"H:\\test\\results\\dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam");
|
|
|
|
- Map<String,String> headers = new HashMap<>();
|
|
|
|
- headers.put("Content-Encoding","gzip");
|
|
|
|
- uploadToOssUtil.uploadOssWithHeaders("H:\\test\\results\\dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam","scene_view_data/KK-t-jIprLDNOZW/images/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam",headers);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|