| | |
| | | |
| | | import com.panzhihua.applets.config.MinioUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import net.coobird.thumbnailator.Thumbnails; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.lang3.RandomUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "新上传照片压缩接口") |
| | | @PostMapping(value = "/uploadimagescompress", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImagesComPress(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename()); |
| | | String uuid=UUID.randomUUID().toString().replaceAll("-", "") + "."; |
| | | String name = uuid + extension; |
| | | String imageUrl = minioUtil.upload(file, name); |
| | | Thumbnails.of(file.getInputStream()).scale(1).outputQuality(0.25).outputFormat("jpg").toFile("D://image/compress"+uuid); |
| | | return R.ok(url + "/idcard/compress" + uuid+".jpg"); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "发送验证码") |
| | | @PostMapping(value = "smscode") |
| | | public R smscode(@RequestBody UserPhoneVO userPhoneVO) { |