Skip to content

Commit fadb217

Browse files
authored
Merge pull request #107 from UMCSCOI/Bug/#106
🐛 [Bug] Enum 타입 변환 문제 해결
2 parents e083d15 + e765172 commit fadb217

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/main/java/com/example/scoi/domain/transfer/converter/TransferConverter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static Recipient toFavoriteRecipient(TransferReqDTO.RecipientInformation
7777
return Recipient.builder()
7878
.walletAddress(recipient.walletAddress())
7979
.recipientKoName(recipient.recipientKoName())
80-
.recipientType(recipient.memberType())
80+
.recipientType(MemberType.from(recipient.memberType()))
8181
// .recipientCorpKoName(recipient.corpKoreanName())
8282
// .recipientCorpEnName(recipient.corpEnglishName())
8383
.isFavorite(true)
@@ -123,7 +123,7 @@ public static TransferResDTO.CheckRecipientResDTO toCheckRecipientResDTO(
123123
// 공통 수취인 정보 변환 로직 (중복 제거)
124124
private static TransferResDTO.RecipientDetailDTO toRecipientDetailDTO(TransferReqDTO.RecipientInformation info) {
125125
return TransferResDTO.RecipientDetailDTO.builder()
126-
.recipientType(info.memberType())
126+
.recipientType(MemberType.from(info.memberType()))
127127
.recipientKoName(info.recipientKoName())
128128
.recipientEnName(info.recipientEnName())
129129
// .corpKoreanName(info.corpKoreanName())
@@ -162,7 +162,7 @@ public static TransferReqDTO.BithumbWithdrawRequest toBithumbWithdrawRequest(Tra
162162
.amount(Double.valueOf(dto.amount()))
163163
.address(dto.address())
164164
.exchangeName(String.valueOf(dto.exchangeName()))
165-
.receiverType(MemberType.valueOf(mappedReceiverType))
165+
.receiverType(mappedReceiverType)
166166
.receiverKoName(dto.receiverKoName())
167167
.receiverEnName(dto.receiverEnName())
168168
// .receiverCorpKoName(dto.receiverCorpKoName()) // 법인일 때만 값이 들어있음
@@ -215,7 +215,7 @@ public static Recipient toRecipient(TransferReqDTO.WithdrawRequest request, Memb
215215
.walletAddress(request.address())
216216
.recipientEnName(request.receiverEnName())
217217
.recipientKoName(request.receiverKoName())
218-
.recipientType(request.receiverType())
218+
.recipientType(MemberType.from(request.receiverType()))
219219
.member(member)
220220
.build();
221221
}

src/main/java/com/example/scoi/domain/transfer/dto/TransferReqDTO.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public class TransferReqDTO {
1818
// 출금 시 필요한 수취인 값
1919
public record RecipientInformation(
2020
@Schema(description = "수취인 유형 (개인/법인)", example = "INDIVIDUAL", allowableValues = {"INDIVIDUAL", "CORPORATION"})
21-
@NotNull(message = "수취인 유형은 필수입니다.")
22-
MemberType memberType,
21+
@NotBlank(message = "수취인 유형은 필수입니다.")
22+
String memberType,
2323

2424
@Schema(description = "수취인 국문 이름", example = "김철수")
2525
@NotBlank(message = "수취인 이름은 필수입니다.")
@@ -102,7 +102,7 @@ public record WithdrawRequest(
102102
ExchangeType exchangeType,
103103

104104
@Schema(description = "수취인 유형 (빗썸 전용, 상대방 거래소)", example = "INDIVIDUAL", allowableValues = {"INDIVIDUAL", "CORPORATION"})
105-
MemberType receiverType,
105+
String receiverType,
106106

107107
@Schema(description = "수취인 성명 (국문, 빗썸 전용)", example = "김철수")
108108
String receiverKoName,
@@ -148,7 +148,7 @@ public record BithumbWithdrawRequest(
148148
@JsonProperty("exchange_name")
149149
String exchangeName, // 상대방 출금 거래소
150150
@JsonProperty("receiver_type")
151-
MemberType receiverType, // personal 또는 corporation
151+
String receiverType, // personal 또는 corporation
152152

153153
// 수취인(대표자) 정보
154154
@JsonProperty("receiver_ko_name")

src/main/java/com/example/scoi/domain/transfer/exception/code/TransferSuccessCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public enum TransferSuccessCode implements BaseSuccessCode {
1515
TRANSFER200_3(HttpStatus.OK, "TRANSFER200_3", "즐겨찾기 수취인으로 변경했습니다."),
1616
TRANSFER200_4(HttpStatus.OK, "TRANSFER200_4", "즐겨찾기 수취인에서 해제했습니다."),
1717
TRANSFER200_5(HttpStatus.OK, "TRANSFER200_5", "수취인 입력값 검증에 성공했습니다."),
18-
TRANSFER200_6(HttpStatus.OK, "TRANSFER200_6", "출금 견접 검증에 성공했습니다."),
18+
TRANSFER200_6(HttpStatus.OK, "TRANSFER200_6", "출금 견적 검증에 성공했습니다."),
1919
TRANSFER200_7(HttpStatus.OK, "TRANSFER200_7", "출금 요청에 성공했습니다."),
2020

2121
TRANSFER201_1(HttpStatus.CREATED, "TRANSFER201_1", "즐겨찾기 수취인 등록에 성공했습니다.")

0 commit comments

Comments
 (0)