一、文件上传接口
/**
* 文件服务
*
* @Author Feng, Ge 2020年3月11日15:22:54
*/
@RestController
@RequestMapping(value = "/file")
@Api(value = "FileController", tags = {"文件服务"})
@Slf4j
public class FileController {
@Value("${fileServer.url}")
private String FILE_SERVER_URL;
/**
* 文件上传接口
* @param file
* @return
* @throws IOException
*/
@RequestMapping("/uploadFileToServer")
@ResponseBody
public JsonResult uploadFileToServer(MultipartFile file) throws IOException, ApiException {
MlyunClient client = new DefaultMlyunClient(FILE_SERVER_URL);
File tempFile = null;
try {
String originalFilename = file.getOriginalFilename();
long size = file.getSize();
Strin