Skip to content

Commit ec20f80

Browse files
committed
fix: 수정된 정규 표현식으로 멱등성 키 패턴 검증 개선
1 parent c92f1c9 commit ec20f80

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

apps/commerce-api/src/main/java/com/loopers/interfaces/api/payment/PaymentV1Dto.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ public record PointPaymentRequest(
2727
example = "order-1-user-kim123-point-20250104153000")
2828
@NotBlank(message = "멱등성 키는 필수입니다.")
2929
@Size(max = 100, message = "멱등성 키는 100자를 초과할 수 없습니다.")
30-
@Pattern(regexp = "^[a-zA-Z0-9-_:]+$",
30+
@Pattern(regexp = "^[-a-zA-Z0-9_:]+$",
3131
message = "멱등성 키는 영문, 숫자, -, _, : 만 사용할 수 있습니다.")
3232
String idempotencyKey
3333
) {
34-
/**
35-
* DTO → Command 변환
36-
* - userId는 Controller에서 헤더로 받아서 주입
37-
*/
3834
public PaymentPointCommand toCommand(String userId) {
3935
return PaymentPointCommand.of(
4036
userId,
@@ -73,14 +69,10 @@ public record CardPaymentRequest(
7369
required = true)
7470
@NotBlank(message = "멱등성 키는 필수입니다.")
7571
@Size(max = 100, message = "멱등성 키는 100자를 초과할 수 없습니다.")
76-
@Pattern(regexp = "^[a-zA-Z0-9-_:]+$",
72+
@Pattern(regexp = "^[-a-zA-Z0-9_:]+$",
7773
message = "멱등성 키는 영문, 숫자, -, _, : 만 사용할 수 있습니다.")
7874
String idempotencyKey
7975
) {
80-
/**
81-
* DTO → Command 변환
82-
* - userId는 Controller에서 헤더로 받아서 주입
83-
*/
8476
public PaymentPgCardCommand toCommand(String userId) {
8577
return PaymentPgCardCommand.of(
8678
userId,

0 commit comments

Comments
 (0)