Skip to content

Commit

Permalink
feat: 전화번호 형식 제약 조건 추가(#28)
Browse files Browse the repository at this point in the history
010으로 시작하며 0~9까지의 숫자로 이뤄진 11자리 문자열만 허용토록 제약 조건 추가
  • Loading branch information
Minjae-An committed Mar 14, 2024
1 parent 15ec97d commit a81a435
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package yeonba.be.login.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public class UserPhoneNumberVerifyRequest {

@Schema(
type = "string",
description = "전화번호",
example = "010-1111-2222"
)
example = "01011112222")
@Pattern(
regexp = "^010\\d{8}$",
message = "전화번호는 11자리 010으로 시작하며 하이픈(-) 없이 0~9의 숫자로 이뤄져야 합니다.")
private String phoneNumber;
}

0 comments on commit a81a435

Please sign in to comment.