-
Notifications
You must be signed in to change notification settings - Fork 0
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
[feat #51] 질문 검색 결과에 북마크 수, 추천 수 추가 #52
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
58aa685
[refactor] : questionPostRepository에만 의존하도록 수정
hyun2371 23101bf
[feat] : querydsl용 dto 생성
hyun2371 36b2f8c
[refactor] : 일관성 위해 응답 dto 필드 순서 변경
hyun2371 c24c154
[feat] : 상호작용 관련 Fixture DB 저장 여부에 따라 분리
hyun2371 5042744
[feat] : 카운트 추출 로직 제거
hyun2371 8faae9c
[feat] : 엔티티가 아닌 DTO로 조회하도록 쿼리 수정
hyun2371 a982fe5
[test] : 엔티티가 아닌 DTO로 조회하도록 쿼리 수정 테스트
hyun2371 3a59741
[feat] : mapper 미사용 비즈니스 로직에 반영
hyun2371 e110963
[test] : fixture 이원화 기존 테스트에 반영
hyun2371 6f5aaad
[style] : 코드 리포멧팅
hyun2371 ae380bd
[chore] : 상호작용 API 스웨거 명세 추가
hyun2371 547800f
Merge branch 'dev' into feat/#51/question-search-add-field
hyun2371 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 25 additions & 2 deletions
27
src/main/java/com/dnd/gongmuin/question_post/dto/response/QuestionPostSimpleResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,36 @@ | ||
package com.dnd.gongmuin.question_post.dto.response; | ||
|
||
import com.dnd.gongmuin.question_post.domain.QuestionPost; | ||
import com.querydsl.core.annotations.QueryProjection; | ||
|
||
public record QuestionPostSimpleResponse( | ||
Long questionPostId, | ||
String title, | ||
String content, | ||
String jobGroup, | ||
int reward, | ||
String createdAt, | ||
boolean isChosen | ||
// TODO: 8/11/24 북마크 수, 추천수 추가 | ||
boolean isChosen, | ||
int savedCount, | ||
int recommendCount | ||
) { | ||
|
||
@QueryProjection | ||
public QuestionPostSimpleResponse( | ||
QuestionPost questionPost, | ||
int savedCount, | ||
int recommendCount | ||
) { | ||
this( | ||
questionPost.getId(), | ||
questionPost.getTitle(), | ||
questionPost.getContent(), | ||
questionPost.getJobGroup().getLabel(), | ||
questionPost.getReward(), | ||
questionPost.getCreatedAt().toString(), | ||
questionPost.getIsChosen(), | ||
savedCount, | ||
recommendCount | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
삼항 연산자를 쓰는기 불편했는데 coalesce()를 쓰면 null일 때 0으로 반환되군요? 저도 써봐야겠네요!