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

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

@ -1,12 +1,12 @@
package com.ruoyi.file.config; 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.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
/** /**
* @see CephDfsServiceImpl * @see CephSysFileServiceImpl
* @author dazer * @author dazer
*/ */
@RefreshScope @RefreshScope

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

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

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

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

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

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

@ -9,7 +9,6 @@ import org.csource.fastdfs.ProtoCommon;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
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;
@ -23,9 +22,9 @@ import com.github.tobato.fastdfs.service.FastFileStorageClient;
*/ */
//@Primary //@Primary
@Service() @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 @Autowired
private FastFileStorageClient storageClient; private FastFileStorageClient storageClient;
@ -34,7 +33,7 @@ public class FastDfsServiceImpl implements IDfsService
/** /**
* FastDfs * FastDfs
* *
* @param file * @param file
* @return 访 * @return 访
* @throws Exception * @throws Exception

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

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

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

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

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

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

Loading…
Cancel
Save