|
@@ -6,23 +6,28 @@ import io.swagger.annotations.Api;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
@RestController
|
|
@RestController
|
|
@Api(value = "文件上传API", tags = { "文件上传API" })
|
|
@Api(value = "文件上传API", tags = { "文件上传API" })
|
|
-@RequestMapping("/file")
|
|
|
|
|
|
+@RequestMapping(value = "/file",method = RequestMethod.GET)
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
public class UploadController {
|
|
public class UploadController {
|
|
@Autowired
|
|
@Autowired
|
|
private UploadFacade uploadFacade;
|
|
private UploadFacade uploadFacade;
|
|
|
|
|
|
- @PostMapping("/upload")
|
|
|
|
- public RespDTO<String> singleFileUpload(@RequestParam("file") MultipartFile file) {
|
|
|
|
|
|
+ @PostMapping("/uploadImage")
|
|
|
|
+ public RespDTO<Map<String, Object>> singleFileUpload(@RequestParam("upfile") MultipartFile file) {
|
|
return RespDTO.onSuc(uploadFacade.singleFileUpload(file));
|
|
return RespDTO.onSuc(uploadFacade.singleFileUpload(file));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@PostMapping("/deleteRemoteFile")
|
|
@PostMapping("/deleteRemoteFile")
|
|
public RespDTO<Boolean> deleteRemoteFile(@RequestParam("path") String path) {
|
|
public RespDTO<Boolean> deleteRemoteFile(@RequestParam("path") String path) {
|
|
return RespDTO.onSuc(uploadFacade.deleteRemoteFile(path));
|
|
return RespDTO.onSuc(uploadFacade.deleteRemoteFile(path));
|