|
@@ -104,9 +104,9 @@ public class FileUploadController extends BaseApiController {
|
|
|
return uploadImageFile(auth, file, PicHandlerTypeEnum.CROP.getValue());
|
|
|
}
|
|
|
|
|
|
- @PostMapping("image/remote/upload/post/commpress/{type}")
|
|
|
- public AjaxResult postCommpressImage(@PathVariable("type") int type, @RequestParam("file") MultipartFile file) {
|
|
|
- return uploadImageFile(0, file, type);
|
|
|
+ @PutMapping("image/remote/upload/commpress/{auth}")
|
|
|
+ public AjaxResult postCommpressImage(@PathVariable("auth") int auth, @RequestParam("file") MultipartFile file) {
|
|
|
+ return uploadImageFile(auth, file, PicHandlerTypeEnum.COMPRESSION.getValue());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -256,14 +256,9 @@ public class FileUploadController extends BaseApiController {
|
|
|
String outFilePath = filePath+"/thumb/"+thumbName+"."+mimeType.substring(mimeType.lastIndexOf("/")+1);
|
|
|
builder.toFile(outFilePath);
|
|
|
|
|
|
- // 压缩图片
|
|
|
- Thumbnails.of(outFilePath).scale(0.5f).outputQuality(0.5f).toFile(outFilePath);
|
|
|
-
|
|
|
// 压缩图片
|
|
|
if (pWidth > 500) {
|
|
|
-
|
|
|
float scale = 500f / pWidth;
|
|
|
-
|
|
|
Thumbnails.of(outFilePath).scale(scale).outputQuality(0.5f).toFile(outFilePath);
|
|
|
}else {
|
|
|
Thumbnails.of(outFilePath).scale(1f).outputQuality(0.5f).toFile(outFilePath);
|