|
@@ -4,11 +4,13 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.trade.common.core.domain.ResponseResult;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import com.trade.service.filestorage.enums.FileModuleEnum;
|
|
@@ -19,7 +21,7 @@ import com.trade.service.filestorage.service.OSSFileService;
|
|
|
* oss文件存储 前端控制器
|
|
|
* </p>
|
|
|
*/
|
|
|
-@Controller
|
|
|
+@RestController
|
|
|
@RequestMapping("/file_storage_oss")
|
|
|
public class OSSFileStorageController {
|
|
|
|
|
@@ -30,8 +32,8 @@ public class OSSFileStorageController {
|
|
|
* 单个文件上传
|
|
|
*/
|
|
|
@RequestMapping(value = "/singleUpload")
|
|
|
- public Long uploadFile(@RequestParam("file") MultipartFile file, FileModuleEnum moduleDict) {
|
|
|
- return fileService.uploadFile(file, moduleDict);
|
|
|
+ public ResponseResult<Long> uploadFile(@RequestParam("file") MultipartFile file, FileModuleEnum moduleDict) {
|
|
|
+ return ResponseResult.success(fileService.uploadFile(file, moduleDict));
|
|
|
}
|
|
|
|
|
|
/**
|