Skip to content

Commit

Permalink
GETP-171 feat: 피플 목록 조회 DTO에 소개 필드 추가 (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
scv1702 committed Aug 2, 2024
1 parent ac4cbca commit c084473
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import static java.util.stream.Collectors.toMap;

@Repository
public class PeopleDaoImpl extends QueryDslSupport implements PeopleDao {
public class PeopleQueryDslDao extends QueryDslSupport implements PeopleDao {

private Map<Long, Tuple> findMemberAndPeopleByPeopleId(final Long... peopleId) {
return queryFactory.select(
Expand Down Expand Up @@ -153,7 +153,7 @@ public PeopleResponse findByMemberId(final Long memberId) {
member.profileImage.uri,
people.peopleType,
Expressions.asNumber(0).as("completedProjectsCount"),
Expressions.asNumber(0).as("interestsCount"),
Expressions.asNumber(0).as("likesCount"),
people.createdAt,
people.updatedAt
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public record CardPeopleResponse(
String profileImageUri,
PeopleType peopleType,
Integer completedProjectsCount,
Integer interestsCount,
Integer likesCount,
CardPeopleProfileResponse profile
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public record DetailPeopleResponse(
String profileImageUri,
PeopleType peopleType,
Integer completedProjectsCount,
Integer interestsCount,
Integer likesCount,
DetailPeopleProfileResponse profile
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public record PeopleResponse(
String profileImageUri,
PeopleType peopleType,
Integer completedProjectsCount,
Integer interestsCount,
Integer likesCount,
LocalDateTime createdAt,
LocalDateTime updatedAt
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public record PublicDetailPeopleResponse(
String profileImageUri,
PeopleType peopleType,
Integer completedProjectsCount,
Integer interestsCount,
Integer likesCount,
PublicDetailPeopleProfileResponse profile
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import es.princip.getp.domain.people.command.domain.PeopleProfile;

public record CardPeopleProfileResponse(
String introduction,
String activityArea,
HashtagsResponse hashtags
) {

public static CardPeopleProfileResponse from(final PeopleProfile profile) {
return new CardPeopleProfileResponse(
profile.getIntroduction(),
profile.getActivityArea(),
HashtagsResponse.from(profile.getHashtags())
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package es.princip.getp.domain.people.query.infra;

import es.princip.getp.domain.people.query.dao.PeopleDao;
import es.princip.getp.domain.people.query.dao.PeopleDaoImpl;
import es.princip.getp.domain.people.query.dao.PeopleQueryDslDao;
import es.princip.getp.infra.DataLoader;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
Expand All @@ -16,7 +16,7 @@ public class PeopleDaoConfig {

@Bean
public PeopleDao peopleDao() {
return new PeopleDaoImpl();
return new PeopleQueryDslDao();
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void getCardPeoplePage() throws Exception {
0,
0,
new CardPeopleProfileResponse(
"소개",
activityArea(),
hashtagsResponse()
)
Expand Down Expand Up @@ -103,7 +104,8 @@ public void getCardPeoplePage() throws Exception {
getDescriptor("content[].nickname", "닉네임"),
getDescriptor("content[].profileImageUri", "프로필 이미지 URI"),
getDescriptor("content[].completedProjectsCount", "완수한 프로젝트 수"),
getDescriptor("content[].interestsCount", "받은 관심 수"),
getDescriptor("content[].likesCount", "받은 좋아요 수"),
getDescriptor("content[].profile.introduction", "소개"),
getDescriptor("content[].profile.activityArea", "활동 지역"),
getDescriptor("content[].profile.hashtags[]", "해시태그")
).and(pageResponseFieldDescriptors())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static FieldDescriptor[] description() {
getDescriptor("peopleType", "피플 유형")
.attributes(key("format").value("TEAM, INDIVIDUAL")),
getDescriptor("completedProjectsCount", "완수한 프로젝트 수"),
getDescriptor("interestsCount", "받은 관심 수"),
getDescriptor("likesCount", "받은 관심 수"),
getDescriptor("profile.introduction", "소개"),
getDescriptor("profile.activityArea", "활동 지역"),
getDescriptor("profile.techStacks[]", "기술 스택"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static FieldDescriptor[] description() {
getDescriptor("peopleType", "피플 유형")
.attributes(key("format").value("TEAM, INDIVIDUAL")),
getDescriptor("completedProjectsCount", "완수한 프로젝트 수"),
getDescriptor("interestsCount", "받은 관심 수"),
getDescriptor("likesCount", "받은 관심 수"),
getDescriptor("createdAt", "피플 정보 등록 일시"),
getDescriptor("updatedAt", "최근 피플 정보 수정 일시")
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static FieldDescriptor[] description() {
getDescriptor("peopleType", "피플 유형")
.attributes(key("format").value("TEAM, INDIVIDUAL")),
getDescriptor("completedProjectsCount", "완수한 프로젝트 수"),
getDescriptor("interestsCount", "받은 관심 수"),
getDescriptor("likesCount", "받은 관심 수"),
getDescriptor("profile.hashtags[]", "해시태그")
};
}
Expand Down

0 comments on commit c084473

Please sign in to comment.