This commit is contained in:
jini
2023-03-30 19:57:52 +09:00
parent 36c34a77c4
commit a2b580e8e7
3 changed files with 3 additions and 3 deletions

View File

@@ -5,5 +5,5 @@ import me.jiniworld.demohx.application.notice.domain.Notice
interface GetNoticeQuery {
fun getNoticeSummaries(command: GetNoticesCommand): Flow<Notice.Summary>
suspend fun getNotice(id: String): Notice.Detail?
suspend fun getNoticeDetail(id: String): Notice.Detail?
}

View File

@@ -20,6 +20,6 @@ internal class GetNoticeService(
loadNoticePort.loadNotices(PageRequest.of(command.page, command.size, Sort.by(
Sort.Order.desc("id")))).map { it.summary }
override suspend fun getNotice(id: String): Notice.Detail? =
override suspend fun getNoticeDetail(id: String): Notice.Detail? =
loadNoticePort.loadNotice(id)?.detail()
}

View File

@@ -26,7 +26,7 @@ internal class GetNoticeController(
@Operation(summary = "공지사항 상세조회")
@GetMapping("/{notice_id}")
suspend fun getNotice(@PathVariable("notice_id") noticeId: String,
) = getNoticeQuery.getNotice(noticeId)
) = getNoticeQuery.getNoticeDetail(noticeId)
?: throw NotFoundException("조회되는 공지사항이 없습니다.")
}