package com.migao.controller; import com.migao.config.response.ResponseBean; import com.migao.entity.vo.res.FileRes; import com.migao.service.FileService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; /** * @author : lcl * @date : 2020/10/14 9:24 */ @Api(tags = "001.统一上传") @RestController @RequestMapping(value = "/file") public class FileInfoController { @Resource private FileService fileInfoService; @ApiOperation(value = "01.文件统一上传") @PostMapping(value = "/upload") public ResponseBean upload(@RequestPart MultipartFile file) { return fileInfoService.upload(file); } @ApiOperation(value = "02.服务器文件同步", hidden = true) @PostMapping(value = "/serverUpload") public ResponseBean serverUpload(@RequestPart MultipartFile file) { return fileInfoService.serverUpload(file); } }