瀏覽代碼

删除4dkankan-util-oss

lyhzzz 3 年之前
父節點
當前提交
c9a5bde5f7

+ 0 - 2
4dkankan-utils-fyun/src/main/java/com/fdkankan/fyun/oss/UploadToOssUtil.java

@@ -60,8 +60,6 @@ public class UploadToOssUtil {
 	@Value("${oss.sdk:4dscene}")
 	private String bucketSdk;
 
-
-
 	@Value("${oss.type:oss}")
 	private String type;
 

+ 90 - 0
4dkankan-utils-fyun/src/main/java/com/fdkankan/fyun/oss/UploadUtils.java

@@ -0,0 +1,90 @@
+//package com.fdkankan.fyun.oss;
+//
+//import com.aliyun.oss.OSSClient;
+//import com.aliyun.oss.model.ObjectMetadata;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.context.annotation.ComponentScan;
+//import org.springframework.stereotype.Component;
+//
+//import java.io.File;
+//import java.util.Map;
+//
+//@Component
+//@ComponentScan
+//public class UploadUtils {
+//    private static Logger log = LoggerFactory.getLogger(UploadUtils.class);
+//
+//    @Value("${oss.point}")
+//    private String point;
+//
+//    @Value("${oss.key}")
+//    private String key;
+//
+//    @Value("${oss.secrey}")
+//    private String secrey;
+//
+//    @Value("${oss.bucket}")
+//    private String bucket;
+//
+//    public void upload(String filePath, String key1) {
+//        OSSClient ossClient = new OSSClient(point, key, secrey);
+//        try {
+//            File file = new File(filePath);
+//            if (!file.exists()) {
+//                log.error("要上传的文件不存在:" + filePath);
+//            }
+//
+//            ObjectMetadata metadata = new ObjectMetadata();
+//            if(filePath.contains(".jpg")){
+//                metadata.setContentType("image/jpeg");
+//            }
+//            ossClient.putObject(bucket, key1, new File(filePath), metadata);
+//
+//        } catch (Exception e) {
+//            log.error(e.toString() + filePath);
+//        }
+//    }
+//
+//    public void upload2(String filePath, String key1) {
+//        OSSClient ossClient = new OSSClient(point, key, secrey);
+//        try {
+//            ObjectMetadata metadata = new ObjectMetadata();
+//            if(filePath.contains(".jpg")){
+//                metadata.setContentType("image/jpeg");
+//            }
+//            if(filePath.contains(".mp4")){
+//                metadata.setContentType("video/mp4");
+//            }
+//            if(filePath.contains(".mp3")){
+//                metadata.setContentType("audio/mp3");
+//            }
+//            ossClient.putObject(bucket, key1, new File(filePath), metadata);
+//        } catch (Exception e) {
+//            log.error(e.toString() + filePath);
+//        }
+//    }
+//
+//    //上传的数据是文件夹,参数是文件夹路径,key是上传后的文件名
+//    public void uploadMulFiles(Map<String, String> filepaths) {
+//        if (filepaths == null) {
+//            return;
+//        }
+//        Long start = System.currentTimeMillis();
+//        log.info("开始批量上传到阿里云:" + start);
+//        if (filepaths.size() > 50) {
+//            for (String filePath : filepaths.keySet()) {
+//                // log.info("文件:"+key);
+//                upload2(filePath, filepaths.get(filePath));
+//            }
+//        } else {
+//            for (String filePath : filepaths.keySet()) {
+//                log.info("文件:" + filePath + "到阿里云:" + filepaths.get(filePath));
+//                upload(filePath, filepaths.get(filePath));
+//            }
+//        }
+//        log.info("批量上传阿里云完毕:" + (System.currentTimeMillis() - start));
+//    }
+//
+//}

+ 0 - 24
4dkankan-utils-fyun/src/main/java/com/fdkankan/fyun/qiniu/QiniuUtil.java

@@ -23,30 +23,6 @@ public class QiniuUtil {
     public static String bucket = "scene3d";
     public static String remoteUrl = "https://4dkanzhan.4dkankan.com/";
 
-    public static void main(String[] args) throws IOException {
-//        crop4K("4k.jpg", "http://www.baidu.com");
-//        thumb("test111.jpg", "128", "128", "http://www.baidu.com");
-
-        /*try{
-            File f = new File("D:/usr/local/szggkfzlg/upload/20190125181036.png");
-            FileInputStream fi = new FileInputStream(f);
-            try{
-                BufferedImage sourceImg =ImageIO.read(fi);//判断图片是否损坏
-                int picWidth= sourceImg.getWidth(); //确保图片是正确的(正确的图片可以取得宽度)
-            }catch (Exception e) {
-                // TODO: handle exception
-                fi.close();//关闭IO流才能操作图片
-            }finally{
-                fi.close();//最后一定要关闭IO流
-            }
-        }catch (Exception e  ) {
-            // TODO: handle exception
-            System.out.println(e.toString());
-        }*/
-
-        getVideoFrame("a.mp4", "png", "6.010", null, null, null, "a_framw.png", "http://www.baidu.com");
-    }
-
     /**
      * 视频帧缩略图接口(vframe)用于从视频流中截取指定时刻的单帧画面并按指定大小缩放成图片
      * @param key 文件名  a.mp4