mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-06 12:28:10 +00:00
删除多余的依赖
This commit is contained in:
@@ -52,16 +52,15 @@
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
<artifactId>fastdfs-client</artifactId>
|
||||
<version>1.26.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Ruoyi Common Security -->
|
||||
<!-- RuoYi Api System -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-security</artifactId>
|
||||
<artifactId>ruoyi-api-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Ruoyi Common Swagger -->
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
|
@@ -4,7 +4,6 @@ import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||
|
||||
/**
|
||||
@@ -13,7 +12,6 @@ import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
|
||||
public class RuoYFileApplication
|
||||
|
@@ -3,7 +3,6 @@ package com.ruoyi.file.controller;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -22,12 +21,6 @@ public class SysFileController
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
|
||||
|
||||
/**
|
||||
* 上传文件存储在本地的根路径
|
||||
*/
|
||||
@Value("${file.path}")
|
||||
private String localFilePath;
|
||||
|
||||
@Autowired
|
||||
private ISysFileService sysFileService;
|
||||
|
||||
@@ -40,7 +33,7 @@ public class SysFileController
|
||||
try
|
||||
{
|
||||
// 上传并返回访问地址
|
||||
String url = sysFileService.uploadFile(file, localFilePath);
|
||||
String url = sysFileService.uploadFile(file);
|
||||
SysFile sysFile = new SysFile();
|
||||
sysFile.setName(FileUtils.getName(url));
|
||||
sysFile.setUrl(url);
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user