Skip to content

Commit

Permalink
[hotfix] 지원서 작성 Validation 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hellozo0 committed Jan 17, 2024
1 parent 37bca84 commit b8e0366
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
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;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class PreferHairStylesValidator implements ConstraintValidator<ValidPreferHairStyles, List<PreferHairStyle>> {
public class PreferHairStylesValidator implements ConstraintValidator<ValidPreferHairStyles, List<HairStyle>> {

@Override
public void initialize(ValidPreferHairStyles constraintAnnotation) {
}

@Override
public boolean isValid(List<PreferHairStyle> preferHairStyles, ConstraintValidatorContext context) {
public boolean isValid(List<HairStyle> preferHairStyles, ConstraintValidatorContext context) {

Set<PreferHairStyle> uniquePreferHairStyles = new HashSet<>(preferHairStyles);
Set<HairStyle> uniquePreferHairStyles = new HashSet<>(preferHairStyles);
if(uniquePreferHairStyles.size() != preferHairStyles.size()) return false;
if (preferHairStyles.isEmpty() || preferHairStyles == null) return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public record ModelApplicationRequest(
@Size(min = 0, max = 3, message = "hairServiceRecord는 선택사항이며, 3개까지 추가 가능합니다.")
List<ModelHairServiceRequest> hairServiceRecords,
@Schema(description = "모델의 인스타그램 예시입니다.", example ="hizo0")
@Pattern(regexp = "^[^@\\s]+[_\\.]+[^\\s]+$", message = "인스타 그램 아이디에는 @는 들어올 수 없지만 _와 .는 가능합니다.")
@Pattern(regexp = "^[^@\\s]*[_\\.]*[^\\s]+$", message = "인스타 그램 아이디에는 @는 들어올 수 없지만 _와 .는 가능합니다.")
String instagramId
) {
public List<ModelHairServiceRequest> getHairServiceRecords() {
Expand Down

0 comments on commit b8e0366

Please sign in to comment.