Skip to content

Commit

Permalink
[refactor] 자동정렬 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbbin committed Jul 9, 2024
1 parent c777270 commit c0adfa1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.recordy.server.user.controller.dto.response.UserSignInResponse;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public S3ServiceImpl(@Value("${aws-property.s3-bucket-name}") final String bucke
}

@Override
public String uploadFile (MultipartFile file) throws IOException {
public String uploadFile(MultipartFile file) throws IOException {
validateFileExtension(file);
validateFileSize(file);
final String url = getFileExtension(file);
Expand All @@ -49,14 +49,14 @@ public String uploadFile (MultipartFile file) throws IOException {
return url;
}

public String getFileExtension (MultipartFile file) {
return UUID.randomUUID()+switch (Objects.requireNonNull(file.getContentType())) {
public String getFileExtension(MultipartFile file) {
return UUID.randomUUID() + switch (Objects.requireNonNull(file.getContentType())) {
case "image/jpeg", "image/jpg" -> ".jpg";
case "image/png" -> ".png";
case "image/webp" -> ".webp";
case "video/mp4" -> ".mp4";
case "video/mov", "video/quicktime" -> ".mov";
default -> throw new ExternalException (ErrorMessage. INVALID_FILE_TYPE);
default -> throw new ExternalException(ErrorMessage.INVALID_FILE_TYPE);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
public class FileServiceImpl implements FileService {

private final S3Service s3Service;

@Override
public FileUrl save(File file) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

@Tag(name = "유저 관련 API")
public interface UserApi {

@Operation(
summary = "유저 회원 가입 API",
description = "유저가 회원 가입하는 API입니다. ",
Expand Down

0 comments on commit c0adfa1

Please sign in to comment.