|
|
|
@@ -15,7 +15,6 @@ import com.iformall.common.ResultData; |
|
|
|
import com.iformall.config.AwsProperty; |
|
|
|
import com.iformall.domain.po.MallResource; |
|
|
|
import com.iformall.service.MallResourceService; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
import com.iformall.utils.ImgUtil; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@@ -29,9 +28,6 @@ import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.imageio.ImageIO; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
import java.io.*; |
|
|
|
import java.net.URL; |
|
|
|
import java.util.*; |
|
|
|
@@ -50,6 +46,9 @@ public class UploadController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private MallResourceService mallResourceService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private String fmUploadDir; |
|
|
|
|
|
|
|
private AmazonS3 s3 = null; |
|
|
|
|
|
|
|
private ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, String tenantId) { |
|
|
|
@@ -180,8 +179,8 @@ public class UploadController extends BaseController { |
|
|
|
|
|
|
|
String imgFormat = ImgUtil.getImgFormat(fileFormat); |
|
|
|
if(StringUtils.isNotBlank(imgFormat)) { |
|
|
|
String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + "-1" + fileFormat; |
|
|
|
String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; |
|
|
|
String localImgFileName = fmUploadDir + tempFileName + "-1" + fileFormat; |
|
|
|
String localNewImgFileName = fmUploadDir + tempFileName + fileFormat; |
|
|
|
BufferedInputStream fs = null; |
|
|
|
File localFile = new File(localImgFileName); |
|
|
|
fos = new FileOutputStream(localFile); |
|
|
|
|