Skip to content

Commit f051fe7

Browse files
authored
fix: πŸ› Modify the business logic of chat room creation (#180)
* fix: presigned_url_property_factory λΆˆν•„μš”ν•œ builder 제거 * refactor: property 좔상 클래슀λ₯Ό μ‚¬μš©ν•œ μžμ› 생성 μ „λž΅ μˆ˜μ • * fix: presigned-url λ°œκΈ‰μ„ μœ„ν•œ validator μˆ˜μ • * fix: query param chat_id, feed_id μ‚­μ œ * test: storage_controller_test μˆ˜μ • * test: factory test μˆ˜μ • * fix: factory 생성 μ „λž΅ μˆ˜μ • * fix: object_key_typeμ—μ„œ ν•„μˆ˜λ‘œ λ³€κ²½λ˜μ–΄μ•Ό ν•  아이디 리슀트 제곡 λ©”μ„œλ“œ μΆ”κ°€ * fix: λ³€κ²½ν•  아이디 전달 객체 μƒμ„±ν•˜μ—¬ 반영 * fix: aws_adapter νŒŒλΌλ―Έν„° μˆ˜μ • * test: url_generator test μˆ˜μ • * fix: pending chatroom entity 및 λΉ„μ§€λ‹ˆμŠ€ 둜직 제거 * test: chat_room create controller unit test μˆ˜μ • * fix: chat_room_controller pend 경둜 제거 및 dto 톡합 * docs: μ±„νŒ…λ°© 생성 μŠ€μ›¨κ±° μˆ˜μ • * test: μ±„νŒ…λ°© 생성 톡합 ν…ŒμŠ€νŠΈ κΈ°λŒ€κ°’ μˆ˜μ • * fix: chat_room_req password μœ νš¨μ„± 검사λ₯Ό μœ„ν•œ ν•„λ“œ νƒ€μž… μˆ˜μ • 및 null λΆ„κΈ° 쑰건 μΆ”κ°€ * fix: μ±„νŒ…λ°© 생성 λΉ„μ§€λ‹ˆμŠ€ 둜직 μˆ˜μ • * rename: actual_id_provider λͺ¨ν˜Έν•¨μ„ μœ λ°œν•  수 μžˆλŠ” 주석 μˆ˜μ •
1 parent fcb54ff commit f051fe7

File tree

33 files changed

+418
-613
lines changed

33 files changed

+418
-613
lines changed

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/chat/api/ChatRoomApi.javaβ€Ž

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,15 @@
99
import io.swagger.v3.oas.annotations.tags.Tag;
1010
import kr.co.pennyway.api.apis.chat.dto.ChatRoomReq;
1111
import kr.co.pennyway.api.apis.chat.dto.ChatRoomRes;
12-
import kr.co.pennyway.api.common.annotation.ApiExceptionExplanation;
13-
import kr.co.pennyway.api.common.annotation.ApiResponseExplanations;
1412
import kr.co.pennyway.api.common.security.authentication.SecurityUserDetails;
15-
import kr.co.pennyway.domain.common.redis.chatroom.PendedChatRoomErrorCode;
1613
import org.springframework.http.ResponseEntity;
1714
import org.springframework.security.core.annotation.AuthenticationPrincipal;
1815
import org.springframework.web.bind.annotation.RequestBody;
1916

2017
@Tag(name = "[μ±„νŒ…λ°© API]")
2118
public interface ChatRoomApi {
22-
@Operation(summary = "[1] μ±„νŒ…λ°© 생성 λŒ€κΈ° μš”μ²­", method = "POST", description = "μ±„νŒ…λ°© λ°°κ²½ 이미지λ₯Ό μ œμ™Έν•œ λͺ¨λ“  정보λ₯Ό μ„œλ²„μ— μ €μž₯ν•˜κΈ° μœ„ν•œ API. 성곡 μ‹œ, μ±„νŒ…λ°© 아이디λ₯Ό λ°˜ν™˜ν•˜λ©°, 5λΆ„ 후에 μ €μž₯된 μžλ™ μ‚­μ œλœλ‹€.")
23-
@ApiResponse(responseCode = "200", description = "μ±„νŒ…λ°© 생성 λŒ€κΈ° μš”μ²­ 성곡", content = @Content(schemaProperties = @SchemaProperty(name = "chatRoomId", schema = @Schema(implementation = Long.class))))
24-
ResponseEntity<?> postChatRoom(@RequestBody ChatRoomReq.Pend request, @AuthenticationPrincipal SecurityUserDetails user);
25-
26-
@Operation(summary = "[2] μ±„νŒ…λ°© 생성", method = "POST", description = "μ±„νŒ…λ°© λ°°κ²½ 이미지λ₯Ό μ „λ‹¬ν•˜μ—¬ `[1] μ±„νŒ…λ°© 생성 λŒ€κΈ° μš”μ²­`의 μš”μ²­μ„ ν™•μ •μ§“λŠ”λ‹€. μ €μž₯된 μ±„νŒ…λ°© 정보λ₯Ό λ°˜ν™˜ν•œλ‹€.")
19+
@Operation(summary = "μ±„νŒ…λ°© 생성", method = "POST", description = "μ±„νŒ…λ°© 생성에 μ„±κ³΅ν•˜λ©΄ μƒμ„±λœ μ±„νŒ…λ°©μ˜ 상세 정보λ₯Ό λ°˜ν™˜ν•œλ‹€.")
2720
@ApiResponse(responseCode = "200", description = "μ±„νŒ…λ°© 생성 성곡", content = @Content(schemaProperties = @SchemaProperty(name = "chatRoom", schema = @Schema(implementation = ChatRoomRes.Detail.class))))
28-
@ApiResponseExplanations(errors = {
29-
@ApiExceptionExplanation(value = PendedChatRoomErrorCode.class, constant = "NOT_FOUND", name = "μ±„νŒ…λ°© 정보 탐색 μ‹€νŒ¨", description = "μ‚¬μš©μžκ°€ μƒμ„±ν•œ μ±„νŒ…λ°© 정보가 μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” 경우 λ°œμƒν•˜λ©°, 이 경우 μ±„νŒ…λ°© 생성 μš”μ²­μ€ μž¬μ‹œλ„ 없이 μ‹€νŒ¨ μ²˜λ¦¬ν•΄μ•Ό ν•œλ‹€.")
30-
})
3121
ResponseEntity<?> createChatRoom(@RequestBody ChatRoomReq.Create request, @AuthenticationPrincipal SecurityUserDetails user);
3222

3323
@Operation(summary = "κ°€μž…ν•œ μ±„νŒ…λ°© λͺ©λ‘ 쑰회", method = "GET", description = "μ‚¬μš©μžκ°€ κ°€μž…ν•œ μ±„νŒ…λ°© λͺ©λ‘μ„ μ‘°νšŒν•˜λ©°, μ •λ ¬ μˆœμ„œλŠ” 보μž₯ν•˜μ§€ μ•ŠλŠ”λ‹€. 졜근 ν™œμ„±ν™”λœ μ±„νŒ…λ°©μ˜ μˆœμ„œλ₯Ό μ§€μ •ν•  방법에 λŒ€ν•΄ μΆ”κ°€ κ°œμ„ μ΄ ν•„μš”ν•œ APIμ΄λ―€λ‘œ, μΆ”ν›„ κΈ°λŠ₯이 일뢀 μˆ˜μ •λ  μˆ˜λ„ μžˆλ‹€.")

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/chat/controller/ChatRoomController.javaβ€Ž

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,22 @@
1010
import org.springframework.http.ResponseEntity;
1111
import org.springframework.security.access.prepost.PreAuthorize;
1212
import org.springframework.security.core.annotation.AuthenticationPrincipal;
13+
import org.springframework.validation.annotation.Validated;
1314
import org.springframework.web.bind.annotation.*;
1415

1516
@Slf4j
1617
@RestController
1718
@RequiredArgsConstructor
1819
@RequestMapping("/v2/chat-rooms")
1920
public class ChatRoomController implements ChatRoomApi {
20-
private static final String CHAT_ROOM_ID = "chatRoomId";
2121
private static final String CHAT_ROOM = "chatRoom";
2222
private static final String CHAT_ROOMS = "chatRooms";
2323
private final ChatRoomUseCase chatRoomUseCase;
2424

25-
@Override
26-
@PostMapping("/pend")
27-
@PreAuthorize("isAuthenticated()")
28-
public ResponseEntity<?> postChatRoom(@RequestBody ChatRoomReq.Pend request, @AuthenticationPrincipal SecurityUserDetails user) {
29-
return ResponseEntity.ok(SuccessResponse.from(CHAT_ROOM_ID, chatRoomUseCase.pendChatRoom(request, user.getUserId())));
30-
}
31-
3225
@Override
3326
@PostMapping("")
3427
@PreAuthorize("isAuthenticated()")
35-
public ResponseEntity<?> createChatRoom(@RequestBody ChatRoomReq.Create request, @AuthenticationPrincipal SecurityUserDetails user) {
28+
public ResponseEntity<?> createChatRoom(@Validated @RequestBody ChatRoomReq.Create request, @AuthenticationPrincipal SecurityUserDetails user) {
3629
return ResponseEntity.ok(SuccessResponse.from(CHAT_ROOM, chatRoomUseCase.createChatRoom(request, user.getUserId())));
3730
}
3831

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/chat/dto/ChatRoomReq.javaβ€Ž

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import jakarta.validation.constraints.NotBlank;
55
import jakarta.validation.constraints.Pattern;
66
import jakarta.validation.constraints.Size;
7-
import kr.co.pennyway.domain.common.redis.chatroom.PendedChatRoom;
7+
import kr.co.pennyway.domain.domains.chatroom.domain.ChatRoom;
88

99
public final class ChatRoomReq {
10-
@Schema(title = "μ±„νŒ…λ°© 생성 μš”μ²­ - λŒ€κΈ°")
11-
public record Pend(
10+
@Schema(title = "μ±„νŒ…λ°© 생성 μš”μ²­ DTO")
11+
public record Create(
1212
@NotBlank
1313
@Size(min = 1, max = 50)
1414
@Schema(description = "μ±„νŒ…λ°© 제λͺ©. NULL ν˜Ήμ€ 곡백은 ν—ˆμš©ν•˜μ§€ μ•ŠμœΌλ©°, 1~50자 μ΄λ‚΄μ˜ λ¬Έμžμ—΄μ΄μ–΄μ•Ό ν•œλ‹€.", example = "νŽ˜λ‹ˆμ›¨μ΄")
@@ -17,19 +17,20 @@ public record Pend(
1717
@Schema(description = "μ±„νŒ…λ°© μ„€λͺ…. NULL을 ν—ˆμš©ν•˜λ©°, λ¬Έμžκ°€ μ‘΄μž¬ν•  μ‹œ 곡백 ν—ˆμš© 없이 1~100자 μ΄λ‚΄μ˜ λ¬Έμžμ—΄μ΄μ–΄μ•Ό ν•œλ‹€.", example = "νŽ˜λ‹ˆμ›¨μ΄ μ±„νŒ…λ°©μž…λ‹ˆλ‹€.")
1818
String description,
1919
@Schema(description = "μ±„νŒ…λ°© λΉ„λ°€λ²ˆν˜Έ. NULL을 ν—ˆμš©ν•œλ‹€. λΉ„λ°€λ²ˆν˜ΈλŠ” 6자리 μ •μˆ˜λ§Œ ν—ˆμš©", example = "123456")
20-
@Size(min = 6, max = 6)
21-
Integer password
22-
) {
23-
public PendedChatRoom toEntity(Long id, Long userId) {
24-
return PendedChatRoom.of(id, userId, title, description, password);
25-
}
26-
}
27-
28-
@Schema(title = "μ±„νŒ…λ°© 생성 μš”μ²­ - ν™•μ •")
29-
public record Create(
20+
@Pattern(regexp = "^[0-9]{6}$", message = "μ±„νŒ…λ°© λΉ„λ°€λ²ˆν˜ΈλŠ” 6자리 μ •μˆ˜μ—¬μ•Ό ν•©λ‹ˆλ‹€.")
21+
String password,
3022
@Schema(description = "μ±„νŒ…λ°© λ°°κ²½ 이미지 URL. NULL을 ν—ˆμš©ν•œλ‹€.", example = "delete/chatroom/{chatroom_id}/{uuid}_{timestamp}.{ext}")
3123
@Pattern(regexp = "^delete/.*", message = "μ±„νŒ…λ°© λ°°κ²½ 이미지 URL은 delete/둜 μ‹œμž‘ν•΄μ•Ό ν•©λ‹ˆλ‹€.")
3224
String backgroundImageUrl
3325
) {
26+
public ChatRoom toEntity(long chatRoomId, String originImageUrl) {
27+
return ChatRoom.builder()
28+
.id(chatRoomId)
29+
.title(title)
30+
.description(description)
31+
.password(password != null ? Integer.valueOf(password) : null)
32+
.backgroundImageUrl(originImageUrl)
33+
.build();
34+
}
3435
}
3536
}

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/chat/service/ChatRoomSaveService.javaβ€Ž

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
import kr.co.pennyway.api.apis.chat.dto.ChatRoomReq;
44
import kr.co.pennyway.api.common.storage.AwsS3Adapter;
5-
import kr.co.pennyway.domain.common.redis.chatroom.PendedChatRoom;
6-
import kr.co.pennyway.domain.common.redis.chatroom.PendedChatRoomErrorCode;
7-
import kr.co.pennyway.domain.common.redis.chatroom.PendedChatRoomErrorException;
8-
import kr.co.pennyway.domain.common.redis.chatroom.PendedChatRoomService;
95
import kr.co.pennyway.domain.domains.chatroom.domain.ChatRoom;
106
import kr.co.pennyway.domain.domains.chatroom.service.ChatRoomService;
117
import kr.co.pennyway.domain.domains.member.domain.ChatMember;
@@ -15,7 +11,7 @@
1511
import kr.co.pennyway.domain.domains.user.exception.UserErrorCode;
1612
import kr.co.pennyway.domain.domains.user.exception.UserErrorException;
1713
import kr.co.pennyway.domain.domains.user.service.UserService;
18-
import kr.co.pennyway.infra.client.aws.s3.ObjectKeyType;
14+
import kr.co.pennyway.infra.client.aws.s3.ActualIdProvider;
1915
import kr.co.pennyway.infra.client.guid.IdGenerator;
2016
import lombok.RequiredArgsConstructor;
2117
import lombok.extern.slf4j.Slf4j;
@@ -29,44 +25,19 @@ public class ChatRoomSaveService {
2925
private final UserService userService;
3026
private final ChatRoomService chatRoomService;
3127
private final ChatMemberService chatMemberService;
32-
private final PendedChatRoomService pendedChatRoomService;
3328

3429
private final AwsS3Adapter awsS3Adapter;
3530
private final IdGenerator<Long> idGenerator;
3631

37-
/**
38-
* μ±„νŒ…λ°© 생성 정보λ₯Ό μΊμ‹±ν•œλ‹€.
39-
* ν•΄λ‹Ή μš”μ²­μ€ {@link #createChatRoom(ChatRoomReq.Create, Long)}λ₯Ό 톡해 μ±„νŒ…λ°©μ„ ν™•μ •ν•  수 μžˆλ‹€.
40-
*
41-
* @return μΊμ‹±λœ μ±„νŒ…λ°©μ˜ ID
42-
*/
43-
@Transactional
44-
public Long pendChatRoom(ChatRoomReq.Pend request, Long userId) {
45-
Long chatRoomId = idGenerator.generate();
46-
log.info("Chat room ID: {}", chatRoomId);
47-
PendedChatRoom info = pendedChatRoomService.create(request.toEntity(chatRoomId, userId));
48-
log.info("Pended chat room: {}", info);
49-
50-
return chatRoomId;
51-
}
52-
53-
/**
54-
* μΊμ‹±λœ μ±„νŒ…λ°©μ„ ν™•μ •ν•˜κ³  μ±„νŒ…λ°©μ„ μƒμ„±ν•œλ‹€.
55-
* μ±„νŒ…λ°©μ„ μƒμ„±ν•œ μ‚¬μš©μžλŠ” μ±„νŒ…λ°©μ˜ κ΄€λ¦¬μžλ‘œ μ„€μ •λœλ‹€.
56-
*
57-
* @throws PendedChatRoomErrorException: {@link PendedChatRoomErrorCode#NOT_FOUND} - μΊμ‹±λœ μ±„νŒ…λ°©μ΄ μ‘΄μž¬ν•˜μ§€ μ•Šμ„ 경우
58-
*/
5932
@Transactional
6033
public ChatRoom createChatRoom(ChatRoomReq.Create request, Long userId) {
61-
PendedChatRoom pendedChatRoom = pendedChatRoomService.readByUserId(userId)
62-
.orElseThrow(() -> new PendedChatRoomErrorException(PendedChatRoomErrorCode.NOT_FOUND));
34+
Long chatRoomId = idGenerator.generate();
6335

6436
String originImageUrl = null;
6537
if (request.backgroundImageUrl() != null) {
66-
originImageUrl = awsS3Adapter.saveImage(request.backgroundImageUrl(), ObjectKeyType.CHAT_PROFILE);
38+
originImageUrl = awsS3Adapter.saveImage(request.backgroundImageUrl(), ActualIdProvider.createInstanceOfChatroomProfile(chatRoomId));
6739
}
68-
69-
ChatRoom chatRoom = chatRoomService.create(pendedChatRoom.toChatRoom(originImageUrl));
40+
ChatRoom chatRoom = chatRoomService.create(request.toEntity(chatRoomId, originImageUrl));
7041

7142
User user = userService.readUser(userId).orElseThrow(() -> new UserErrorException(UserErrorCode.NOT_FOUND));
7243
ChatMember member = ChatMember.of(user.getName(), user, chatRoom, ChatMemberRole.ADMIN);

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/chat/usecase/ChatRoomUseCase.javaβ€Ž

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ public class ChatRoomUseCase {
1818
private final ChatRoomSaveService chatRoomSaveService;
1919
private final ChatRoomSearchService chatRoomSearchService;
2020

21-
public Long pendChatRoom(ChatRoomReq.Pend request, Long userId) {
22-
return chatRoomSaveService.pendChatRoom(request, userId);
23-
}
24-
2521
public ChatRoomRes.Detail createChatRoom(ChatRoomReq.Create request, Long userId) {
2622
ChatRoom chatRoom = chatRoomSaveService.createChatRoom(request, userId);
2723

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/storage/adapter/PresignedUrlGenerateAdapter.javaβ€Ž

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ public class PresignedUrlGenerateAdapter {
1616
private final AwsS3Provider awsS3Provider;
1717

1818
public URI execute(Long userId, PresignedUrlDto.Req request) {
19-
PresignedUrlPropertyFactory factory = PresignedUrlPropertyFactory.create(request.ext(), request.type())
20-
.userId(userId)
21-
.chatroomId(request.chatroomId())
22-
.chatId(request.chatId())
23-
.feedId(request.feedId())
24-
.build();
19+
PresignedUrlPropertyFactory factory = PresignedUrlPropertyFactory.createInstance(request.ext(), request.type(), userId, request.chatroomId());
2520

2621
return awsS3Provider.generatedPresignedUrl(factory);
2722
}

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/storage/api/StorageApi.javaβ€Ž

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ public interface StorageApi {
3636
@ExampleObject(value = "jpeg", name = "jpeg")
3737
}),
3838
@Parameter(name = "chatroomId", description = "μ±„νŒ…λ°© ID", in = ParameterIn.QUERY, example = "123456789"),
39-
@Parameter(name = "chatId", description = "μ±„νŒ… ID", in = ParameterIn.QUERY, example = "123456789"),
40-
@Parameter(name = "feedId", description = "ν”Όλ“œ ID", in = ParameterIn.QUERY, example = "123456789"),
4139
@Parameter(name = "request", hidden = true)
4240
})
4341
@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = PresignedUrlDto.Res.class)))

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/storage/dto/PresignedUrlDto.javaβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ public record Req(
1515
@NotBlank(message = "파일 ν™•μž₯μžλŠ” ν•„μˆ˜μž…λ‹ˆλ‹€.")
1616
@Pattern(regexp = "^(jpg|png|jpeg)$", message = "파일 ν™•μž₯μžλŠ” jpg, png, jpeg 쀑 ν•˜λ‚˜μ—¬μ•Ό ν•©λ‹ˆλ‹€.")
1717
String ext,
18-
Long chatroomId,
19-
Long chatId,
20-
Long feedId
18+
Long chatroomId
2119
) {
2220
}
2321

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/apis/users/usecase/UserAccountUseCase.javaβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import kr.co.pennyway.domain.domains.oauth.domain.Oauth;
1313
import kr.co.pennyway.domain.domains.user.domain.NotifySetting;
1414
import kr.co.pennyway.domain.domains.user.domain.User;
15-
import kr.co.pennyway.infra.client.aws.s3.ObjectKeyType;
15+
import kr.co.pennyway.infra.client.aws.s3.ActualIdProvider;
1616
import lombok.RequiredArgsConstructor;
1717
import lombok.extern.slf4j.Slf4j;
1818
import org.springframework.transaction.annotation.Transactional;
@@ -69,7 +69,7 @@ public void updatePassword(Long userId, String oldPassword, String newPassword)
6969
}
7070

7171
public String updateProfileImage(Long userId, UserProfileUpdateDto.ProfileImageReq request) {
72-
String originImageUrl = awsS3Adapter.saveImage(request.profileImageUrl(), ObjectKeyType.PROFILE);
72+
String originImageUrl = awsS3Adapter.saveImage(request.profileImageUrl(), ActualIdProvider.createInstanceOfProfile());
7373
String oldImageUrl = userProfileUpdateService.updateProfileImage(userId, originImageUrl);
7474

7575
if (oldImageUrl != null) {

β€Žpennyway-app-external-api/src/main/java/kr/co/pennyway/api/common/storage/AwsS3Adapter.javaβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package kr.co.pennyway.api.common.storage;
22

33
import kr.co.pennyway.common.annotation.Adapter;
4+
import kr.co.pennyway.infra.client.aws.s3.ActualIdProvider;
45
import kr.co.pennyway.infra.client.aws.s3.AwsS3Provider;
5-
import kr.co.pennyway.infra.client.aws.s3.ObjectKeyType;
66
import kr.co.pennyway.infra.common.exception.StorageErrorCode;
77
import kr.co.pennyway.infra.common.exception.StorageException;
88
import lombok.RequiredArgsConstructor;
@@ -17,12 +17,12 @@ public class AwsS3Adapter {
1717
/**
1818
* μž„μ‹œ μ €μž₯ κ²½λ‘œμ—μ„œ 원본 μ €μž₯ 경둜둜 사진을 λ³΅μ‚¬ν•˜κ³ , 원본이 μ €μž₯된 ν‚€λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.
1919
*
20-
* @param deleteImageUrl μž„μ‹œ μ €μž₯ 이미지 URL
21-
* @param type ν”„λ‘œν•„ 이미지 νƒ€μž… {@link ObjectKeyType}
20+
* @param deleteImageUrl String : μž„μ‹œ μ €μž₯ 이미지 URL
21+
* @param type {@link ActualIdProvider} : μ‹€μ œ IDλ₯Ό μ œκ³΅ν•˜λŠ” 클래슀
2222
* @return ν”„λ‘œν•„ 이미지 원본이 μ €μž₯된 key
2323
* @throws StorageException ν”„λ‘œν•„ 이미지 URL이 μœ νš¨ν•˜μ§€ μ•Šμ„ λ•Œ
2424
*/
25-
public String saveImage(String deleteImageUrl, ObjectKeyType type) {
25+
public String saveImage(String deleteImageUrl, ActualIdProvider type) {
2626
if (!awsS3Provider.isObjectExist(deleteImageUrl)) {
2727
log.info("ν”„λ‘œν•„ 이미지 URL이 μœ νš¨ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.");
2828
throw new StorageException(StorageErrorCode.NOT_FOUND);

0 commit comments

Comments
Β (0)