删除多余的依赖

This commit is contained in:
RuoYi
2020-11-25 18:22:57 +08:00
parent 1abf802a09
commit 6b36b32e39
10 changed files with 29 additions and 51 deletions

View File

@@ -29,12 +29,11 @@ public class FastDfsSysFileServiceImpl implements ISysFileService
* FastDfs文件上传接口
*
* @param file 上传的文件
* @param baseDir 相对应用的基目录
* @return 访问地址
* @throws Exception
*/
@Override
public String uploadFile(MultipartFile file, String baseDir) throws Exception
public String uploadFile(MultipartFile file) throws Exception
{
StorePath storePath = storageClient.uploadFile(file.getInputStream(), file.getSize(),
FilenameUtils.getExtension(file.getOriginalFilename()), null);

View File

@@ -13,9 +13,8 @@ public interface ISysFileService
* 文件上传接口
*
* @param file 上传的文件
* @param baseDir 相对应用的基目录
* @return 访问地址
* @throws Exception
*/
public String uploadFile(MultipartFile file, String baseDir) throws Exception;
public String uploadFile(MultipartFile file) throws Exception;
}

View File

@@ -26,6 +26,12 @@ public class LocalSysFileServiceImpl implements ISysFileService
*/
@Value("${file.domain}")
public String domain;
/**
* 上传文件存储在本地的根路径
*/
@Value("${file.path}")
private String localFilePath;
/**
* 本地文件上传接口
@@ -35,9 +41,9 @@ public class LocalSysFileServiceImpl implements ISysFileService
* @return 访问地址
* @throws Exception
*/
public String uploadFile(MultipartFile file, String baseDir) throws Exception
public String uploadFile(MultipartFile file) throws Exception
{
String name = FileUploadUtils.upload(baseDir, file);
String name = FileUploadUtils.upload(localFilePath, file);
String url = domain + localFilePrefix + name;
return url;
}