package com.newfiber.api.pc.controller; import com.newfiber.api.core.annotation.SysLog; import com.newfiber.api.core.commons.CustomException; import com.newfiber.api.core.commons.ResultCode; import com.newfiber.api.core.commons.ResultObj; import com.newfiber.api.pc.service.FileService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; 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; import javax.servlet.http.HttpServletResponse; import java.io.UnsupportedEncodingException; @RestController @RequestMapping("/sysfile") @Api(value = "文件", tags = "文件") public class FileController { @Autowired private FileService fileService; @PostMapping(value = "/addFileInfo") @ApiOperation("文件上传-文件") @SysLog(actionType = "1",value = "文件上传-文件") public ResultObj addFileInfo(@RequestParam("file") MultipartFile multipartFile){ return fileService.addFileInfo(multipartFile); } }