package com.njcn;

import com.njcn.oss.constant.OssPath;
import com.njcn.oss.utils.FileStorageUtil;
import lombok.SneakyThrows;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.File;
import java.io.FileInputStream;
import java.util.UUID;

/**
 * @author hongawen
 * @version 1.0.0
 * @date 2021年12月14日 12:55
 */
public class OssTest extends BaseJunitTest{

    @Autowired
    private FileStorageUtil fileStorageUtil;

    @SneakyThrows
    @Test
    public void test(){
        File file = new File("C:\\Users\\DELL\\Desktop\\6FEC92B75A104D1295715A661A2CC196.docx");
        String s = fileStorageUtil.uploadStream(new FileInputStream(file), OssPath.ALGORITHM, UUID.randomUUID() + ".docx");
        System.out.println("hello");

    }

}
