diff --git a/pom.xml b/pom.xml
index 23bc21a..e959735 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,8 @@
5.0.0
5.0.0
2.0.4
+ 4.4.3
+ 0.4.0
@@ -214,6 +216,21 @@
aliyun-java-sdk-dysmsapi
1.1.0
+
+ cn.hutool
+ hutool-all
+ ${hutool-all.version}
+
+
+ io.tus.java.client
+ tus-java-client
+ ${tus-client.version}
+
+
+ org.springframework.kafka
+ spring-kafka
+ 2.5.10.RELEASE
+
diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java
index 7943196..601e796 100644
--- a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java
+++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java
@@ -55,6 +55,8 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers(HttpMethod.GET,"/selectFirePoint").permitAll()
.antMatchers(HttpMethod.POST,"/updateTypeByFireCode").permitAll()
.antMatchers(HttpMethod.GET,"/api/user/verificationCode").permitAll()
+ .antMatchers(HttpMethod.POST,"/uploadFileMore").permitAll()
+ .antMatchers(HttpMethod.POST,"/uploadFile").permitAll()
// 所有其它请求需要身份认证
.anyRequest().authenticated()
.and()
diff --git a/src/main/java/com/xkrs/controller/FileController.java b/src/main/java/com/xkrs/controller/FileController.java
new file mode 100644
index 0000000..1e63f62
--- /dev/null
+++ b/src/main/java/com/xkrs/controller/FileController.java
@@ -0,0 +1,116 @@
+package com.xkrs.controller;
+
+import com.xkrs.common.encapsulation.PromptMessageEnum;
+import com.xkrs.dao.FilePathDao;
+import com.xkrs.model.entity.FilePath;
+import com.xkrs.utils.FileFastDfs;
+import com.xkrs.utils.FileUtil;
+import org.springframework.context.i18n.LocaleContextHolder;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
+import static com.xkrs.utils.FileUtil.getUploadInfo;
+
+/**
+ * @author XinYi Song
+ * 文件上传
+ */
+@RestController
+public class FileController {
+
+ @Resource
+ private FileFastDfs fileFastDfs;
+
+ @Resource
+ private FilePathDao filePathDao;
+
+ /**
+ * 上传多张图片
+ * @param files
+ * @return
+ */
+ @PostMapping("/uploadFileMore")
+ public String uploadFileMore(MultipartFile[] files){
+ Locale locale = LocaleContextHolder.getLocale();
+ if (null == files || files.length == 0){
+ return outputEncapsulationObject(PromptMessageEnum.PARAM_NULL, "result or fileType is null", locale);
+ }
+ List list = new ArrayList();
+ for (MultipartFile file :
+ files) {
+ boolean m = FileUtil.checkFileSize(file.getSize(), 100, "M");
+ if(m == false){
+ return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG, "图片大小不能超过100M", locale);
+ }
+ String dir = "fire_point";
+ String info = fileFastDfs.uploadFile(file, dir);
+ Map map = getUploadInfo(info);
+ FilePath filePath = new FilePath();
+ filePath.setFilePath(map.get("path"));
+ filePath.setFileName(map.get("fileName"));
+ filePath.setSize(map.get("size"));
+ filePath.setMtime(map.get("mtime"));
+ filePath.setUrl(map.get("url"));
+ filePath.setMd5(map.get("md5"));
+ filePath.setScene(map.get("scene"));
+ filePathDao.save(filePath);
+ }
+ //List