Skip to content

Commit

Permalink
#48 fix: 공지사항 idx -> id로 네이밍 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chaerlo127 committed Aug 4, 2023
1 parent a70ae13 commit 0ac4451
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/com/psr/psr/cs/controller/CsController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CsController(
*/
@GetMapping("/notices/{noticeIdx}")
@ResponseBody
fun getNotice(@PathVariable(name = "noticeIdx") noticeIdx: Long): BaseResponse<NoticeRes>{
return BaseResponse(csService.getNotice(noticeIdx))
fun getNotice(@PathVariable(name = "noticeIdx") noticeId: Long): BaseResponse<NoticeRes>{
return BaseResponse(csService.getNotice(noticeId))
}
}
2 changes: 1 addition & 1 deletion src/main/kotlin/com/psr/psr/cs/dto/NoticeRes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude
import java.time.LocalDateTime

data class NoticeRes (
val noticeIdx: Long,
val noticeId: Long,
val title: String,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
val date: LocalDateTime,
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/psr/psr/cs/service/CsService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class CsService(
}

// 공지사항 상세
fun getNotice(noticeIdx: Long) : NoticeRes{
val notice = noticeRepository.findByIdAndStatus(noticeIdx, ACTIVE_STATUS) ?: throw BaseException(BaseResponseCode.NOT_FOUND_NOTICE)
fun getNotice(noticeId: Long) : NoticeRes{
val notice = noticeRepository.findByIdAndStatus(noticeId, ACTIVE_STATUS) ?: throw BaseException(BaseResponseCode.NOT_FOUND_NOTICE)
return csAssembler.toNoticeRes(notice)
}

Expand Down

0 comments on commit 0ac4451

Please sign in to comment.