Skip to content
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 @@ -99,6 +99,7 @@ public ResponseEntity<ApiResponseDto<SearchAnswerEntryResponse>> searchAnswers(
description = """
답변 ID로 해당 답변의 상세 정보와 리포트를 조회합니다.

- 일간 리포트 ID (dailyReportId, 리포트 없으면 null)
- 질문 내용 (questionText)
- 질문 카테고리 (interestCode)
- 답변 작성일 (answerDate)
Expand Down Expand Up @@ -206,6 +207,7 @@ public ResponseEntity<ApiResponseDto<CalendarRecentsResponse>> getCalendarRecent
특정 날짜의 답변 전체 정보를 조회합니다.

응답 데이터:
- 일간 리포트 ID (dailyReportId, 리포트 없으면 null)
- 질문 내용 (questionText)
- 질문 카테고리 (interestCode)
- 답변 작성일 (answerDate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
@Schema(description = "답변 상세 조회 응답")
public record AnswerDetailResponse(

@Schema(description = "일간 리포트 ID (댓글·좋아요 조회 시 사용)", example = "42")
Long dailyReportId,

@Schema(description = "질문 내용", example = "오늘 가장 기뻤던 순간은?")
String questionText,

Expand All @@ -31,6 +34,7 @@ public record AnswerDetailResponse(
) {
public static AnswerDetailResponse from(AnswerDetailDto dto, String imageUrl) {
return new AnswerDetailResponse(
dto.dailyReportId(),
dto.questionText(),
dto.interestCode() != null ? dto.interestCode().name() : null,
dto.answerDate(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Repository 쿼리 결과를 담는 DTO
*/
public record AnswerDetailDto(
Long dailyReportId,
String questionText,
InterestCode interestCode,
LocalDate answerDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ List<SearchAnswerEntryDto> findRecentAnswers(
*/
@Query("""
select new com.devkor.ifive.nadab.domain.dailyreport.core.dto.AnswerDetailDto(
ae.question.questionText, ae.question.interest.code, ae.date, ae.content, dr.content, e.code, ae.imageKey
dr.id, ae.question.questionText, ae.question.interest.code, ae.date, ae.content, dr.content, e.code, ae.imageKey
)
from AnswerEntry ae
left join DailyReport dr on dr.answerEntry = ae and dr.status = com.devkor.ifive.nadab.domain.dailyreport.core.entity.DailyReportStatus.COMPLETED
Expand All @@ -126,7 +126,7 @@ Optional<AnswerDetailDto> findDetailByAnswerId(
*/
@Query("""
select new com.devkor.ifive.nadab.domain.dailyreport.core.dto.AnswerDetailDto(
ae.question.questionText, ae.question.interest.code, ae.date, ae.content, dr.content, e.code, ae.imageKey
dr.id, ae.question.questionText, ae.question.interest.code, ae.date, ae.content, dr.content, e.code, ae.imageKey
)
from AnswerEntry ae
left join DailyReport dr on dr.answerEntry = ae and dr.status = com.devkor.ifive.nadab.domain.dailyreport.core.entity.DailyReportStatus.COMPLETED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public interface DailyReportRepository extends JpaRepository<DailyReport, Long>
*/
@Query("""
select new com.devkor.ifive.nadab.domain.dailyreport.core.dto.AnswerDetailDto(
dr.id,
q.questionText,
i.code,
ae.date,
Expand Down
Loading