🚚
This commit is contained in:
@@ -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?
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
@@ -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("조회되는 공지사항이 없습니다.")
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user