| | |
| | | import cc.mrbird.febs.mall.dto.Base64UploadDto; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.service.ICommonService; |
| | | import cn.hutool.core.io.file.FileNameUtil; |
| | | import cn.hutool.core.lang.UUID; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.thoughtworks.xstream.core.BaseException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.coobird.thumbnailator.Thumbnails; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.FileCopyUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import sun.misc.BASE64Encoder; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通用上传请求 |
| | | */ |
| | | // 文件保存目录路径 |
| | | @Value("${static.resource.url}") |
| | | private String resourceUrl; |
| | | // 文件保存目录URL |
| | | @Value("${static.resource.path}") |
| | | private String resourcePath; |
| | | |
| | | @ApiOperation(value = "文件上传服务器", notes = "文件上传服务器") |
| | | @GetMapping(value = "/fileUploadEsc") |
| | | public Map<String,Object> fileUploadEsc(MultipartFile file) throws IOException { |
| | | if (file == null) { |
| | | throw new FebsException("上传文件不能为空"); |
| | | } |
| | | return FileUtil.fileUploadEsc(file,resourceUrl,resourcePath); |
| | | } |
| | | |
| | | /** |
| | | * 图片上传 |
| | | * @return |
| | | */ |