重命名 文件服务的 接口名称

pull/84/head
duandazhi 4 years ago
parent 60a71a3146
commit 7a5df92dfb

@ -1,12 +1,12 @@
package com.ruoyi.file.config;
import com.ruoyi.file.service.CephDfsServiceImpl;
import com.ruoyi.file.service.CephSysFileServiceImpl;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
/**
* @see CephDfsServiceImpl
* @see CephSysFileServiceImpl
* @author dazer
*/
@RefreshScope

@ -2,7 +2,7 @@ package com.ruoyi.file.config;
import com.github.tobato.fastdfs.FdfsClientConstants;
import com.github.tobato.fastdfs.domain.conn.PooledConnectionFactory;
import com.ruoyi.file.service.FastDfsServiceImpl;
import com.ruoyi.file.service.FastSysFileServiceImpl;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration;
/**
* fastdfs
* @author dazer
* @see FastDfsServiceImpl
* @see FastSysFileServiceImpl
* FastDFS {@link PooledConnectionFactory}
*
* 使: DockerFastDFS https://www.cnblogs.com/cao-lei/p/13470695.html

@ -1,6 +1,6 @@
package com.ruoyi.file.config;
import com.ruoyi.file.service.MinioDfsServiceImpl;
import com.ruoyi.file.service.MinioSysFileServiceImpl;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
* Minio
*
* @author ruoyi
* @see MinioDfsServiceImpl
* @see MinioSysFileServiceImpl
*/
@RefreshScope
@Component

@ -2,7 +2,7 @@ package com.ruoyi.file.config;
import com.qiniu.storage.Region;
import com.qiniu.storage.UploadManager;
import com.ruoyi.file.service.QiniuDfsServiceImpl;
import com.ruoyi.file.service.QiniuSysFileServiceImpl;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
@ -14,7 +14,7 @@ import org.springframework.context.annotation.Configuration;
* @see UploadManager
* @see Region or endpoint
* @see com.qiniu.storage.Configuration
* @see QiniuDfsServiceImpl
* @see QiniuSysFileServiceImpl
*/
@RefreshScope
@Configuration

@ -1,13 +1,12 @@
package com.ruoyi.file.controller;
import com.ruoyi.file.service.IDfsService;
import com.ruoyi.file.service.ISysFileService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -27,7 +26,7 @@ public class SysFileController {
private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
@Autowired
private IDfsService dfsService;
private ISysFileService dfsService;
/**
*
@ -90,4 +89,4 @@ public class SysFileController {
@ApiParam("需要访问的url,字段名:fileUrl,必填;不要带有?后面的参数") @RequestParam(value = "fileUrl") String fileUrl) {
return R.ok(dfsService.presignedUrl(fileUrl), "获取成功");
}
}
}

@ -44,7 +44,7 @@ import java.util.concurrent.TimeUnit;
*/
@Primary
@Service()
public class AliyunOssDsfServiceImpl implements IDfsService {
public class AliyunOssDsfServiceImpl implements ISysFileService {
private static final Logger log = LoggerFactory.getLogger(AliyunOssDsfServiceImpl.class);
@Autowired
private AliyunOssConfig aliyunOssConfig;

@ -22,7 +22,6 @@ import java.math.BigDecimal;
import java.net.URL;
import java.util.Date;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
/**
* @author dazer
@ -41,8 +40,8 @@ import java.util.function.Consumer;
* 3:使docker ceph 使aws sdk https://blog.csdn.net/freewebsys/article/details/79553386
*/
@Service()
public class CephDfsServiceImpl implements IDfsService {
private static final Logger log = LoggerFactory.getLogger(CephDfsServiceImpl.class);
public class CephSysFileServiceImpl implements ISysFileService {
private static final Logger log = LoggerFactory.getLogger(CephSysFileServiceImpl.class);
@Autowired
private CephConfig cephConfig;

@ -9,7 +9,6 @@ import org.csource.fastdfs.ProtoCommon;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.github.tobato.fastdfs.domain.fdfs.StorePath;
@ -23,9 +22,9 @@ import com.github.tobato.fastdfs.service.FastFileStorageClient;
*/
//@Primary
@Service()
public class FastDfsServiceImpl implements IDfsService
public class FastSysFileServiceImpl implements ISysFileService
{
private final Logger logger = LoggerFactory.getLogger(FastDfsServiceImpl.class);
private final Logger logger = LoggerFactory.getLogger(FastSysFileServiceImpl.class);
@Autowired
private FastFileStorageClient storageClient;
@ -34,7 +33,7 @@ public class FastDfsServiceImpl implements IDfsService
/**
* FastDfs
*
*
* @param file
* @return 访
* @throws Exception

@ -17,7 +17,7 @@ import java.io.IOException;
* @author dazer
*/
@Service()
public class FtpFileServiceImpl implements IDfsService {
public class FtpFileServiceImpl implements ISysFileService {
@Autowired
private FtpConfig ftpConfig;

@ -26,7 +26,7 @@ import static com.ruoyi.file.utils.FileUploadUtils.*;
* 6: CEPH http://docs.ceph.org.cn/
* @author ruoyi
*/
public interface IDfsService
public interface ISysFileService
{
/**
*
@ -41,7 +41,7 @@ public interface IDfsService
/**
*
*
*
* @param file
* @return 访
* @throws Exception

@ -4,7 +4,6 @@ import cn.hutool.core.io.FileUtil;
import com.ruoyi.common.core.exception.CustomException;
import com.ruoyi.file.config.LocalFileConfig;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.file.utils.FileUploadUtils;
@ -13,11 +12,11 @@ import java.io.File;
/**
*
*
*
* @author ruoyi
*/
@Service()
public class LocalFileServiceImpl implements IDfsService
public class LocalFileServiceImpl implements ISysFileService
{
private final LocalFileConfig localFileConfig;
@ -27,7 +26,7 @@ public class LocalFileServiceImpl implements IDfsService
/**
*
*
*
* @param file
* @return 访
* @throws Exception

@ -7,9 +7,6 @@ import io.minio.http.Method;
import io.minio.messages.Item;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.file.config.MinioConfig;
@ -24,7 +21,7 @@ import java.util.function.Consumer;
/**
* Minio
*
*
* @author ruoyi
* http://docs.minio.org.cn/docs/master/java-client-quickstart-guidec
* springboot使Minio8 https://springboot.io/t/topic/3109
@ -38,7 +35,7 @@ import java.util.function.Consumer;
*/
//@Primary
@Service()
public class MinioDfsServiceImpl implements IDfsService
public class MinioSysFileServiceImpl implements ISysFileService
{
@Autowired
private MinioConfig minioConfig;
@ -47,7 +44,7 @@ public class MinioDfsServiceImpl implements IDfsService
/**
*
*
*
* @param file
* @return 访
* @throws Exception

@ -16,7 +16,6 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@ -34,8 +33,8 @@ import java.io.InputStream;
*/
//@Primary
@Service()
public class QiniuDfsServiceImpl implements IDfsService {
private static final Logger log = LoggerFactory.getLogger(QiniuDfsServiceImpl.class);
public class QiniuSysFileServiceImpl implements ISysFileService {
private static final Logger log = LoggerFactory.getLogger(QiniuSysFileServiceImpl.class);
@Autowired
private QiniuKodoConfig qiniuKodoConfig;

@ -9,7 +9,6 @@ import com.qcloud.cos.model.*;
import com.ruoyi.common.core.exception.CustomException;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.file.config.TencentCosConfig;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@ -25,7 +24,7 @@ import java.util.List;
*/
//@Primary
@Service()
public class TencentCosServiceImpl implements IDfsService {
public class TencentCosServiceImpl implements ISysFileService {
private final COSClient cosClient;
private final TencentCosConfig config;

Loading…
Cancel
Save