文件服务增加通过配置控制文件存储方式的配置
This commit is contained in:
parent
f9c6e66731
commit
72ba3c8daf
|
|
@ -4,6 +4,7 @@ import com.ruoyi.common.core.utils.StringUtils;
|
|||
import com.ruoyi.common.core.utils.file.FileUtils;
|
||||
import com.ruoyi.file.utils.FileUploadUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
|
@ -16,8 +17,8 @@ import java.io.ByteArrayOutputStream;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Primary
|
||||
@Service
|
||||
@ConditionalOnProperty(name = "file.storage", havingValue = "local", matchIfMissing = true)
|
||||
public class LocalSysFileServiceImpl implements ISysFileService {
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import io.minio.MinioClient;
|
|||
import io.minio.PutObjectArgs;
|
||||
import io.minio.RemoveObjectArgs;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
|
@ -21,6 +22,7 @@ import java.io.InputStream;
|
|||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
@ConditionalOnProperty(name = "file.storage", havingValue = "minio")
|
||||
public class MinioSysFileServiceImpl implements ISysFileService {
|
||||
@Autowired
|
||||
private MinioConfig minioConfig;
|
||||
|
|
|
|||
Loading…
Reference in New Issue