|
|
@ -1,12 +1,12 @@
|
|
|
|
package com.ruoyi.file.service;
|
|
|
|
package com.ruoyi.file.service;
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import com.github.tobato.fastdfs.domain.fdfs.StorePath;
|
|
|
|
import com.github.tobato.fastdfs.domain.fdfs.StorePath;
|
|
|
|
import com.github.tobato.fastdfs.service.FastFileStorageClient;
|
|
|
|
import com.github.tobato.fastdfs.service.FastFileStorageClient;
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.utils.file.FileTypeUtils;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* FastDFS 文件存储
|
|
|
|
* FastDFS 文件存储
|
|
|
@ -36,7 +36,7 @@ public class FastDfsSysFileServiceImpl implements ISysFileService
|
|
|
|
public String uploadFile(MultipartFile file) throws Exception
|
|
|
|
public String uploadFile(MultipartFile file) throws Exception
|
|
|
|
{
|
|
|
|
{
|
|
|
|
StorePath storePath = storageClient.uploadFile(file.getInputStream(), file.getSize(),
|
|
|
|
StorePath storePath = storageClient.uploadFile(file.getInputStream(), file.getSize(),
|
|
|
|
FilenameUtils.getExtension(file.getOriginalFilename()), null);
|
|
|
|
FileTypeUtils.getExtension(file), null);
|
|
|
|
return domain + "/" + storePath.getFullPath();
|
|
|
|
return domain + "/" + storePath.getFullPath();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|