|
@@ -17,6 +17,7 @@ import org.jeecg.modules.wps.service.IWpsFileService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.Arrays;
|
|
@@ -40,6 +41,21 @@ public class WpsFileController {
|
|
|
public Map<String,Object> bindProject(String fileId,Long projectId){
|
|
|
return wpsFileService.bindProject(fileId,projectId);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上传文件
|
|
|
+ */
|
|
|
+ @PostMapping("uploadFile")
|
|
|
+ public ResponseEntity<Object> uploadFile(@RequestParam("file") MultipartFile file){
|
|
|
+ try {
|
|
|
+ LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ wpsFileService.uploadFile(file,user.getId());
|
|
|
+ return Response.success(true,"上传成功");
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return Response.success(false,"上传失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
/**
|
|
|
* 分页列表查询
|
|
|
* @param wpsFile
|