12345678910111213141516171819202122 |
- package com.nosum.deliver.file.controller;
- import com.nosum.common.base.domain.Result;
- import com.nosum.deliver.file.factory.UploadFileFactory;
- import org.springframework.web.bind.annotation.PostMapping;
- 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;
- @RestController
- @RequestMapping("/file")
- public class UploadFileController {
- @PostMapping("/file/v1/upload")
- public Result uploadFile(@RequestParam(value = "file") final MultipartFile file) {
- String storyType = "";
- final String store = UploadFileFactory.getUploadFileService(storyType).saveFileStore(file);
- return Result.createWithSuccessMessage().setExtra(store);
- }
- }
|