Skip to content

Commit

Permalink
Merge pull request #73 from We-Food-C-I-A/hotfix/57
Browse files Browse the repository at this point in the history
fix: 이미지 수정
  • Loading branch information
JBumLee authored Aug 24, 2024
2 parents 5db1a0c + c29dc10 commit cf1576f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,10 @@ public void saveImages(Long id, List<MultipartFile> multipartFiles, String dirNa
public void saveThumbnail(Long id, MultipartFile multipartFile, String dirName)
throws IOException {
ImageRootType rootType= dbCheckRootType(dirName, id);
System.out.println("drcheck exit");
File uploadFile = convert(multipartFile) // 파일 변환할 수 없으면 에러
.orElseThrow(() -> new IllegalArgumentException("error: MultipartFile -> File convert fail"));
System.out.println("convert exit");
String imageUrl = upload(uploadFile, dirName, id);
System.out.println("upload ad exit");
String extension = getFileExtension(imageUrl);
System.out.println(imageUrl+" "+extension);
Image image = Image.builder().name(imageUrl).extension(extension).build();
imageRepository.save(image);
saveThumbnailTypeRepo(rootType,image);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public ResponseEntity<Message<ProductDetailResponse>> getProduct(@PathVariable(n
}

@ResponseStatus(HttpStatus.CREATED)
@PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@PostMapping
public void uploadImages(
@RequestParam("id") Long id,
@RequestParam("files") List<MultipartFile> files) {
Expand Down

0 comments on commit cf1576f

Please sign in to comment.