| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.InputStream; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | } |
| | | return fileService.baseDownLoad(map); |
| | | } |
| | | /** |
| | | * byte[]上传 |
| | | */ |
| | | @PostMapping(value="byteUplaod",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | public FileInfo byteUplaod(@RequestParam("fileName") String fileName,@RequestParam("byte[]") byte[] bytes){ |
| | | if(bytes.length == 0){ |
| | | return null; |
| | | } |
| | | if (com.kidgrow.common.utils.StringUtils.isBlank(fileName)) { |
| | | return null; |
| | | } |
| | | InputStream inputStream = new ByteArrayInputStream(bytes); |
| | | return fileService.byteUplaod(fileName,inputStream,bytes.length); |
| | | } |
| | | |
| | | /** |
| | | * 文件删除 |