Skip to content

Commit

Permalink
👔 [STMT-146] 리뷰반영: 변경된 FileValidator를 로직에 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
05AM committed Mar 12, 2024
1 parent f53c126 commit ff65af5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import com.stumeet.server.common.exception.model.NotImplementedException;
import com.stumeet.server.common.response.ErrorCode;
import com.stumeet.server.common.util.FileUtil;
import com.stumeet.server.common.util.FileValidator;
import com.stumeet.server.file.application.port.out.FileCommandPort;
import com.stumeet.server.file.application.port.out.FileUrl;
import com.stumeet.server.file.domain.ImageFile;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -36,11 +36,11 @@ public class S3ImageStorageAdapter implements FileCommandPort {

@Override
public FileUrl uploadImageFile(MultipartFile file, String directoryPath) {
ImageFile imageFile = new ImageFile(file);
String key = FileUtil.generateKey(directoryPath, imageFile.getName());
FileValidator.validateImageFile(file);
String key = FileUtil.generateKey(directoryPath, file.getOriginalFilename());

PutObjectRequest objectRequest = PutObjectRequest.builder()
.contentType(imageFile.getContentType())
.contentType(file.getContentType())
.bucket(bucket)
.key(key)
.build();
Expand Down
39 changes: 0 additions & 39 deletions src/main/java/com/stumeet/server/file/domain/ImageFile.java

This file was deleted.

0 comments on commit ff65af5

Please sign in to comment.