Skip to content

Commit

Permalink
[Refactor/#281] total count of siren & question
Browse files Browse the repository at this point in the history
  • Loading branch information
Han-Jeong committed Jun 2, 2024
1 parent 4578e85 commit 63a334c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import com.example.waggle.domain.board.presentation.dto.question.QuestionResponse.QuestionSummaryDto;
import com.example.waggle.domain.board.presentation.dto.question.QuestionResponse.QuestionSummaryListDto;
import com.example.waggle.domain.board.presentation.dto.question.QuestionResponse.RepresentativeQuestionDto;
import com.example.waggle.domain.member.presentation.converter.MemberConverter;
import com.example.waggle.global.util.MediaUtil;
import com.example.waggle.global.util.PageUtil;
import com.example.waggle.domain.member.presentation.converter.MemberConverter;
import org.springframework.data.domain.Page;

import java.util.List;
Expand Down Expand Up @@ -49,6 +49,7 @@ public static QuestionResponse.QuestionDetailDto toDetailDto(Question question)
.mediaList(MediaUtil.getBoardMedias(question))
.member(MemberConverter.toMemberSummaryDto(question.getMember()))
.viewCount(question.getViewCount())
.commentCount(question.getComments().size())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.example.waggle.domain.board.presentation.converter;

import com.example.waggle.domain.board.persistence.entity.Siren;
import com.example.waggle.domain.board.presentation.dto.siren.SirenResponse.SirenSummaryListDto;
import com.example.waggle.domain.board.presentation.dto.siren.SirenResponse.SirenDetailDto;
import com.example.waggle.domain.board.presentation.dto.siren.SirenResponse.SirenPagedSummaryListDto;
import com.example.waggle.domain.board.presentation.dto.siren.SirenResponse.SirenSummaryDto;
import com.example.waggle.global.util.MediaUtil;
import com.example.waggle.domain.board.presentation.dto.siren.SirenResponse.SirenSummaryListDto;
import com.example.waggle.domain.member.presentation.converter.MemberConverter;
import com.example.waggle.global.util.MediaUtil;
import com.example.waggle.global.util.PageUtil;
import org.springframework.data.domain.Page;

Expand Down Expand Up @@ -53,6 +53,7 @@ public static SirenDetailDto toSirenDetailDto(Siren siren) {
.status(siren.getStatus())
.member(MemberConverter.toMemberSummaryDto(siren.getMember()))
.viewCount(siren.getViewCount())
.commentCount(siren.getComments().size())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static class QuestionDetailDto {
private MemberSummaryDto member;
private int recommendCount;
private long viewCount;
private int commentCount;
}

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static class SirenDetailDto {
private ResolutionStatus status;
private int recommendCount;
private long viewCount;
private int commentCount;
}

@Data
Expand Down

0 comments on commit 63a334c

Please sign in to comment.