xiongzhu 5 anni fa
parent
commit
ed8356e5a6

+ 1 - 1
src/main/java/com/izouma/awesomeadmin/constant/AppConstant.java

@@ -6,7 +6,7 @@ package com.izouma.awesomeadmin.constant;
  * </p>
  */
 public interface AppConstant {
-    String AVATAR = "http://yuanqijjc.oss-cn-hangzhou.aliyuncs.com/yuanqijjc/images/2019-10-10-05-13-47-7yy60krz.jpg";
+    String AVATAR = "https://ks3-cn-shanghai.ksyun.com/yqjjc/yuanqijjc/images/2019-10-10-05-13-47-7yy60krz.jpg";
 
     /**
      * 商户号

+ 0 - 65
src/main/java/com/izouma/awesomeadmin/service/ImageFileService.java

@@ -1,65 +0,0 @@
-package com.izouma.awesomeadmin.service;
-
-import java.io.InputStream;
-
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Service;
-
-import com.aliyun.oss.OSSClient;
-import com.aliyun.oss.model.OSSObject;
-import com.aliyun.oss.model.ObjectMetadata;
-import com.aliyun.oss.model.PutObjectResult;
-import com.izouma.awesomeadmin.util.PropertiesFileLoader;
-
-@Service
-public class ImageFileService {
-
-    /**
-     * 日志对象
-     */
-    private static Logger logger = Logger.getLogger(ImageFileService.class);
-
-
-    public String UpLoadImage(InputStream fin, String path) {
-
-        logger.info("UpLoadImage :上传照片 开始  : fin:" + fin + "; phth: " + path);
-        // TODO Auto-generated method stub
-        String aliid = PropertiesFileLoader.getDefaultProperties("aliossid", "");
-        String alikey = PropertiesFileLoader.getDefaultProperties("aliosskey", "");
-        String aliossendpoit = PropertiesFileLoader.getDefaultProperties("aliossendpoit", "");
-        String bucketname = PropertiesFileLoader.getDefaultProperties("alibucketname", "izouma");
-        OSSClient client = new OSSClient(aliossendpoit, aliid, alikey);
-        OSSObject object = null;
-        logger.info("UpLoadImage :上传照片  : aliid:" + aliid + "; alikey: " + alikey + "; aliossendpoit : " + aliossendpoit + "; bucketname:"
-                + bucketname);
-        if (path.startsWith("/")) {
-            return "invalid path";
-        }
-        @SuppressWarnings("unused")
-        PutObjectResult result = client.putObject(bucketname, path, fin, new ObjectMetadata());
-
-        try {
-            object = client.getObject(bucketname, path);
-        } catch (Exception r) {
-            logger.error("UpLoadImage: 上传照片异常 ", r);
-        }
-        // 如果不设置content-length, 默认为chunked编码。
-        if (object != null) {
-            return "file exist";
-        }
-
-        return "success";
-    }
-
-
-    public static String GetRealImagePath(String Path) {
-
-        // TODO Auto-generated method stub
-        if (Path == null || "".equals(Path) || Path.startsWith("images")) {
-            return Path;
-        }
-        String aliossendpoit = PropertiesFileLoader.getDefaultProperties("aliImageSever", "");
-        return aliossendpoit + "/" + Path;
-    }
-
-}