-
Notifications
You must be signed in to change notification settings - Fork 1
feat: subscribe interest keyword #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/main/java/com/example/userservice/domain/subscriber/service/impl/SubscriberServiceImpl.java:27
- Consider adding a null check or additional validation for the 'keywords' parameter here to ensure it is not null, even though the DTO validation should typically handle this.
public void subscribe(String email, List<String> keywords) {
src/main/java/com/example/userservice/domain/subscriber/entity/Subscriber.java:40
- [nitpick] Consider trimming each keyword before creating the Interest object to ensure that accidental leading or trailing whitespace does not affect uniqueness or behavior.
keywords.stream().distinct().map(Interest::new).forEach(this::add);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~
public boolean isValid(List<String> value, ConstraintValidatorContext constraintValidatorContext) { | ||
if (value == null) return false; | ||
|
||
List<String > processed = value.stream() | ||
.map(String::trim) | ||
.filter(StringUtils::isNotBlank) | ||
.distinct() | ||
.collect(Collectors.toList()); | ||
|
||
if (processed.size() < minSize || processed.size() > maxSize) { | ||
return false; | ||
} | ||
|
||
return processed.stream() | ||
.allMatch(s -> s.length() >= keywordMinLength && s.length() <= keywordMaxLength); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
특수기호에 대한 validation은 하지않아도 될까요?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어떤거 검증하면 좋을까요?
지금 당장은 생각나는게 없어서..
필요한 validation 말씀해주시면 바로 추가할게용 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 제 생각엔 그냥 static한 정규표현식으로 특수기호체크하는 로직만 추가되면 좋을 것 같네요~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pattern.compile("^[a-zA-Z0-9가-힣 ]+$");
영문, 한글, 숫자, 띄어쓰기만 가능하도록 했습니당
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GOOD~ 머지하셔도 될 것 같아요 approve 했습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
늦어서 죄송합니다 ㅠㅠ 확인 했습니다! 👏🏻
✨ 요약
관심 키워드 테이블 생성
키워드가 유니크하게 다대다로 해야할까?
키워드 글자가 중요한 것이니, 편의를 위해 일대다로 할까?
엔티티 매핑
[How does JPA orphanRemoval=true differ from the ON DELETE CASCADE DML clause](https://stackoverflow.com/questions/4329577/how-does-jpa-orphanremoval-true-differ-from-the-on-delete-cascade-dml-clause)
기능 추가
기능 구현 테스트
email: “[email protected]”
추가 커밋 이유
해결
직접 Validator 구현
validator
추가로 할 것
😎 해결한 이슈
[✨ feat] 관심 키워드 알림 서비스 #48
궁금증