-
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
[refactor] querydsl 및 프로젝션 적용 #155
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
091f544
[refactor] #154 add required dependencies
chaewonni f4c31c0
[refactor] #154 create querydsl configuration file
chaewonni 5650752
[refactor] #154 create projection and delete unnecessary dto
chaewonni 7553832
[refactor] #154 change to querydsl
chaewonni 6eb5970
[refactor] #154 change to querydsl and delete unnecessary code
chaewonni 8245d5c
[refactor] #154 latecomer query changed to querydsl
chaewonni 485b07d
[refactor] #154 delete unnecessary code
chaewonni f025679
[refactor] #154 change DTO mapping to Projection-based mapping
chaewonni 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
9 changes: 0 additions & 9 deletions
9
src/main/java/org/kkumulkkum/server/api/meeting/dto/MeetingMetCountDto.java
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
...main/java/org/kkumulkkum/server/api/meeting/dto/projection/MeetingMetCountProjection.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.kkumulkkum.server.api.meeting.dto.projection; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public interface MeetingMetCountProjection { | ||
Long getId(); | ||
String getName(); | ||
LocalDateTime getCreatedAt(); | ||
String getInvitationCode(); | ||
Long getMetCount(); | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/org/kkumulkkum/server/api/meeting/dto/projection/MemberProjection.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.kkumulkkum.server.api.meeting.dto.projection; | ||
|
||
public interface MemberProjection { | ||
Long getMemberId(); | ||
String getName(); | ||
String getProfileImg(); | ||
} |
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
15 changes: 0 additions & 15 deletions
15
src/main/java/org/kkumulkkum/server/api/meeting/dto/response/MemberDto.java
This file was deleted.
Oops, something went wrong.
6 changes: 4 additions & 2 deletions
6
src/main/java/org/kkumulkkum/server/api/meeting/dto/response/MembersDto.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
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
33 changes: 0 additions & 33 deletions
33
src/main/java/org/kkumulkkum/server/api/participant/dto/ParticipantStatusUserInfoDto.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...kkumulkkum/server/api/participant/dto/projection/ParticipantStatusUserInfoProjection.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.kkumulkkum.server.api.participant.dto.projection; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public record ParticipantStatusUserInfoProjection( | ||
Long participantId, | ||
Long memberId, | ||
String name, | ||
String profileImg, | ||
LocalDateTime preparationAt, | ||
LocalDateTime departureAt, | ||
LocalDateTime arrivalAt, | ||
String state | ||
) { | ||
} |
12 changes: 6 additions & 6 deletions
12
...ain/java/org/kkumulkkum/server/api/participant/dto/response/AvailableParticipantsDto.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
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
19 changes: 19 additions & 0 deletions
19
src/main/java/org/kkumulkkum/server/common/config/QuerydslConfig.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.kkumulkkum.server.common.config; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import jakarta.persistence.EntityManager; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@RequiredArgsConstructor | ||
public class QuerydslConfig { | ||
|
||
private final EntityManager entityManager; | ||
|
||
@Bean | ||
public JPAQueryFactory jpaQueryFactory() { | ||
return new JPAQueryFactory(entityManager); | ||
} | ||
} |
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.
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.
DB에서 처리돼서 오는거긴 하지만 보이는 코드는 깔끔해졌네용
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.
넵 기존 애플리케이션으로 가져와 처리하는 것보다 DB에서 처리하는 게 성능적인 이점과 코드 가독성 면에서 더 나은 방식이라고 판단하여 수정해보았습니다!