Skip to content

Commit

Permalink
Merge pull request #14 from kjungw1025/fix/post
Browse files Browse the repository at this point in the history
�fix: 미션 인증글, 공지글 response dto 수정
  • Loading branch information
kjungw1025 authored Mar 27, 2024
2 parents 3ef6b0c + c8cdb7a commit 707a80e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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();
}
}

0 comments on commit 707a80e

Please sign in to comment.