|
@@ -2,6 +2,8 @@ package com.keao.edu.user.service;
|
|
|
|
|
|
import com.keao.edu.common.entity.UploadReturnBean;
|
|
|
import com.keao.edu.common.exception.BizException;
|
|
|
+import com.keao.edu.thirdparty.storage.StoragePluginContext;
|
|
|
+import com.keao.edu.thirdparty.storage.provider.QiniuKodoStoragePlugin;
|
|
|
import com.keao.edu.util.upload.UploadUtil;
|
|
|
import com.keao.edu.thirdparty.storage.StoragePlugin;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
@@ -23,7 +25,7 @@ import java.io.InputStream;
|
|
|
public class UploadFileService {
|
|
|
|
|
|
@Autowired
|
|
|
- private StoragePlugin storagePlugin;
|
|
|
+ private StoragePluginContext storagePluginContext;
|
|
|
|
|
|
/** 最大上传大小,单位kb */
|
|
|
@Value("${common.upload.maxSize:153600}")
|
|
@@ -65,7 +67,7 @@ public class UploadFileService {
|
|
|
return uploadReturn;
|
|
|
}
|
|
|
|
|
|
- String url = storagePlugin.uploadFile(staticFloder + folder, file);
|
|
|
+ String url = storagePluginContext.uploadFile(QiniuKodoStoragePlugin.PLUGIN_NAME,staticFloder + folder, file);
|
|
|
|
|
|
FileUtils.deleteQuietly(file);
|
|
|
|