| | |
| | | } |
| | | } |
| | | } |
| | | /* if (file != null) { |
| | | BufferedImage bufferedImage = null; |
| | | try { |
| | | String fileName = file.getOriginalFilename(); |
| | | String[] arr = fileName.split("\\."); |
| | | String suffixName = arr[arr.length - 1].toLowerCase(); |
| | | |
| | | bufferedImage = ImageIO.read(file.getInputStream()); |
| | | // 宽度 |
| | | int width = bufferedImage.getWidth(); |
| | | sysPictureBase.setWidth(width); |
| | | // 高度 |
| | | int height = bufferedImage.getHeight(); |
| | | sysPictureBase.setHeight(height); |
| | | sysPictureBaseService.update(sysPictureBase); |
| | | String tempUploadDir = localPath + "/product_img/"; |
| | | File dir = new File(tempUploadDir); |
| | | if (!dir.exists()) { |
| | | dir.mkdirs(); |
| | | } |
| | | ImageIO.write(bufferedImage, suffixName, new File(tempUploadDir + sysPictureBase.getId().toString())); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }*/ |
| | | return Result.ok(); |
| | | } |
| | | |