From b8e03666a1357c2f1e3360939ba9cc32f6aa24dd Mon Sep 17 00:00:00 2001 From: hellozo0 Date: Thu, 18 Jan 2024 03:21:26 +0900 Subject: [PATCH] =?UTF-8?q?[hotfix]=20=EC=A7=80=EC=9B=90=EC=84=9C=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1=20Validation=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prefer_hair_style/PreferHairStylesValidator.java | 8 ++++---- .../model/dto/request/ModelApplicationRequest.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/moddy/server/common/validation/prefer_hair_style/PreferHairStylesValidator.java b/src/main/java/com/moddy/server/common/validation/prefer_hair_style/PreferHairStylesValidator.java index 793c0e28..ef4087ce 100644 --- a/src/main/java/com/moddy/server/common/validation/prefer_hair_style/PreferHairStylesValidator.java +++ b/src/main/java/com/moddy/server/common/validation/prefer_hair_style/PreferHairStylesValidator.java @@ -1,6 +1,6 @@ package com.moddy.server.common.validation.prefer_hair_style; -import com.moddy.server.domain.prefer_hair_style.PreferHairStyle; +import com.moddy.server.domain.prefer_hair_style.HairStyle; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; @@ -8,16 +8,16 @@ import java.util.List; import java.util.Set; -public class PreferHairStylesValidator implements ConstraintValidator> { +public class PreferHairStylesValidator implements ConstraintValidator> { @Override public void initialize(ValidPreferHairStyles constraintAnnotation) { } @Override - public boolean isValid(List preferHairStyles, ConstraintValidatorContext context) { + public boolean isValid(List preferHairStyles, ConstraintValidatorContext context) { - Set uniquePreferHairStyles = new HashSet<>(preferHairStyles); + Set uniquePreferHairStyles = new HashSet<>(preferHairStyles); if(uniquePreferHairStyles.size() != preferHairStyles.size()) return false; if (preferHairStyles.isEmpty() || preferHairStyles == null) return false; diff --git a/src/main/java/com/moddy/server/controller/model/dto/request/ModelApplicationRequest.java b/src/main/java/com/moddy/server/controller/model/dto/request/ModelApplicationRequest.java index fb79b66c..b2d62aba 100644 --- a/src/main/java/com/moddy/server/controller/model/dto/request/ModelApplicationRequest.java +++ b/src/main/java/com/moddy/server/controller/model/dto/request/ModelApplicationRequest.java @@ -26,7 +26,7 @@ public record ModelApplicationRequest( @Size(min = 0, max = 3, message = "hairServiceRecord는 선택사항이며, 3개까지 추가 가능합니다.") List hairServiceRecords, @Schema(description = "모델의 인스타그램 예시입니다.", example ="hizo0") - @Pattern(regexp = "^[^@\\s]+[_\\.]+[^\\s]+$", message = "인스타 그램 아이디에는 @는 들어올 수 없지만 _와 .는 가능합니다.") + @Pattern(regexp = "^[^@\\s]*[_\\.]*[^\\s]+$", message = "인스타 그램 아이디에는 @는 들어올 수 없지만 _와 .는 가능합니다.") String instagramId ) { public List getHairServiceRecords() {