Skip to content
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

[REFACT] 프로젝트 카드 랜덤 리스트 조회 API에서 프로젝트 상태 필드를 추가로 전달하도록 수정, queryDSL warn 해결 #174

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public CursorPaginationResult<ProjectDetailAPIRes> findByConditionWithPagination
List<Project> entities = jpaQueryFactory.selectFrom(project)
.innerJoin(project.creator, user)
.on(project.creator.id.eq(user.id))
.join(project.projectTags).fetchJoin()
.where(
cursorIdCondition(pageable.getCursorId()),
userIdEq(userId),
Expand Down Expand Up @@ -64,6 +63,7 @@ public CursorPaginationResult<ProjectDetailAPIRes> findByConditionWithPagination
project.getCreator().getUserWantedJobTags().stream().map(
UserWantedJobTag::getWantedJob).map(String::valueOf).toList()
),
project.getProjectStatus(),
project.getProjectTags().stream().map(ProjectTag::getContent).toList(),
new MeetingInfoResponse(
project.getMeetingInfo().getMeetStartTime(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.oeid.mogakgo.domain.project.presentation.dto.res;

import io.oeid.mogakgo.domain.project.domain.entity.enums.ProjectStatus;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserPublicApiResponse;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
Expand All @@ -15,6 +16,9 @@ public class ProjectDetailAPIRes {
@Schema(description = "프로젝트 생성자 정보")
private final UserPublicApiResponse creator;

@Schema(description = "프로젝트 상태")
private final ProjectStatus projectStatus;

@Schema(description = "프로젝트 모임 태그", example = "[\"수다스러운\", \"재밌는\"]")
private final List<String> projectTags;

Expand All @@ -23,19 +27,21 @@ public class ProjectDetailAPIRes {


public ProjectDetailAPIRes(Long projectId, UserPublicApiResponse creator,
List<String> projectTags, MeetingInfoResponse meetingInfo
ProjectStatus projectStatus, List<String> projectTags, MeetingInfoResponse meetingInfo
) {
this.projectId = projectId;
this.creator = creator;
this.projectStatus = projectStatus;
this.projectTags = projectTags;
this.meetingInfo = meetingInfo;
}

public static ProjectDetailAPIRes of(Long projectId, UserPublicApiResponse creator,
List<String> projectTags, MeetingInfoResponse meetingInfo) {
ProjectStatus projectStatus, List<String> projectTags, MeetingInfoResponse meetingInfo) {
return new ProjectDetailAPIRes(
projectId,
creator,
projectStatus,
projectTags,
meetingInfo
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public CursorPaginationResult<ProjectJoinRequestDetailAPIRes> getBySenderIdWithP
List<ProjectJoinRequestDetailAPIRes> result = entities.stream().map(
projectJoinRequest -> new ProjectJoinRequestDetailAPIRes(
projectJoinRequest.getProject().getId(),
projectJoinRequest.getProject().getProjectStatus(),
projectJoinRequest.getProject().getCreator().getAvatarUrl(),
new MeetingInfoResponse(
projectJoinRequest.getProject().getMeetingInfo().getMeetStartTime(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.oeid.mogakgo.domain.project_join_req.presentation.dto.res;

import io.oeid.mogakgo.domain.project.domain.entity.enums.ProjectStatus;
import io.oeid.mogakgo.domain.project.presentation.dto.res.MeetingInfoResponse;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
Expand All @@ -14,29 +13,24 @@ public class ProjectJoinRequestDetailAPIRes {
@NotNull
private final Long projectId;

@Schema(description = "프로젝트 상태", example = "PENDING", implementation = ProjectStatus.class)
@NotNull
private final ProjectStatus projectStatus;

@Schema(description = "프로젝트 생성자 아바타 URL", example = "https://avatars.githubusercontent.com/u/85854384?v=4")
private final String creatorAvatorUrl;

@Schema(description = "프로젝트 만남 장ㅔ")
private final MeetingInfoResponse meetingInfo;

public ProjectJoinRequestDetailAPIRes(Long projectId, ProjectStatus projectStatus,
String creatorAvatorUrl, MeetingInfoResponse meetingInfo
public ProjectJoinRequestDetailAPIRes(Long projectId, String creatorAvatorUrl,
MeetingInfoResponse meetingInfo
) {
this.projectId = projectId;
this.projectStatus = projectStatus;
this.creatorAvatorUrl = creatorAvatorUrl;
this.meetingInfo = meetingInfo;
}

public static ProjectJoinRequestDetailAPIRes from(Long projectId, ProjectStatus projectStatus,
String creatorAvatorUrl, MeetingInfoResponse meetingInfo
public static ProjectJoinRequestDetailAPIRes from(Long projectId, String creatorAvatorUrl,
MeetingInfoResponse meetingInfo
) {
return new ProjectJoinRequestDetailAPIRes(projectId, projectStatus, creatorAvatorUrl, meetingInfo);
return new ProjectJoinRequestDetailAPIRes(projectId, creatorAvatorUrl, meetingInfo);
}

}
Loading