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

fix: 미션 인증글, 공지글 response dto 수정 #86

Merged
merged 4 commits into from
Mar 27, 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
@@ -1,11 +1,30 @@
package com.renew.sw.mentoring.domain.post.model.entity.dto.response;

import com.renew.sw.mentoring.domain.post.model.entity.RegisterStatus;
import com.renew.sw.mentoring.domain.post.model.entity.type.MissionBoard;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

@Getter
public class ResponseMissionBoardDto extends ResponseSingleGenericPostDto {

@Schema(description = "댓글 개수", example = "4")
private final int commentCount;

@Schema(description = "게시글 상태", example = "IN_PROGRESS")
private final RegisterStatus registerStatus;

@Schema(description = "미션 아이디", example = "1")
private final Long missionId;

@Schema(description = "보너스 미션 성공 여부", example = "false")
private final boolean bonusMissionSuccessful;

public ResponseMissionBoardDto(ResponseSingleGenericPostDto dto, MissionBoard post) {
super(dto);
this.commentCount = post.getComments().size();
this.registerStatus = post.getRegisterStatus();
this.missionId = post.getMissionId();
this.bonusMissionSuccessful = post.isBonusMissionSuccessful();
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package com.renew.sw.mentoring.domain.post.model.entity.dto.response;

import com.renew.sw.mentoring.domain.post.model.entity.type.Notice;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

@Getter
public class ResponseSingleNoticeDto extends ResponseSingleGenericPostDto {

@Schema(description = "댓글 개수", example = "4")
private final int commentCount;

public ResponseSingleNoticeDto(ResponseSingleGenericPostDto dto, Notice notice) {
super(dto);
this.commentCount = notice.getComments().size();
}
}