-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Fix] #286 - 소셜 쿼리 오류 수정 및 닉네임 정규표현식 수정 #287
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package org.moonshot.constants; | ||
|
||
public class RegexConstants { | ||
public static final String nicknameRegex = "^[a-zA-Z0-9가-힣]{1,7}$"; | ||
public static final String nicknameRegex = "^[a-zA-Z0-9ㄱ-ㅎㅏ-ㅣ가-힣]{1,7}$"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,17 @@ | |
import static org.moonshot.keyresult.model.QKeyResult.keyResult; | ||
import static org.moonshot.objective.model.QObjective.objective; | ||
import static org.moonshot.task.model.QTask.task; | ||
import static org.moonshot.user.model.QUser.user; | ||
|
||
import com.querydsl.core.types.OrderSpecifier; | ||
import com.querydsl.core.types.dsl.BooleanExpression; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
|
||
import java.util.LinkedHashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.hibernate.Hibernate; | ||
|
@@ -72,12 +78,12 @@ private OrderSpecifier<?> order(Criteria criteria) { | |
|
||
@Override | ||
public List<Objective> findSocialObjectives() { | ||
return queryFactory.selectFrom(objective).distinct() | ||
.join(objective.user).fetchJoin() | ||
return queryFactory.selectFrom(objective) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Projection으로 DTO로 바로 뽑아내는게 더 효율적이었으면 좋았는데 아쉽네요 |
||
.join(objective.user, user).fetchJoin() | ||
.leftJoin(objective.keyResultList, keyResult).fetchJoin() | ||
.leftJoin(keyResult.taskList, task) | ||
.where(objective.isPublic.eq(true)) | ||
.orderBy(objective.heartCount.desc(), objective.id.desc(), keyResult.idx.asc(), task.id.asc()) | ||
.orderBy(objective.heartCount.desc(), objective.id.desc(), keyResult.idx.asc(), task.idx.asc()) | ||
.limit(10) | ||
.fetch(); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Repository SRP 지키면서 로직을 작성하신거 너무 잘하셨습니다~ |
||
|
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.
Application 레벨에서 전처리 잘 해주셨네요~
LinkedHashSet을 통해 순서를 보장하며 중복을 제거한 선택 아주 잘하셨습니당~