-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
src/main/kotlin/com/msg/gcms/domain/notice/service/impl/DeleteNoticeServiceImpl.kt
Outdated
Show resolved
Hide resolved
security config์ url์ ์ถ๊ฐํด์ฃผ์์๊น์? ๋ณ๊ฒฝ์ฌํญ์๋ ๋ณด์ด์ง ์๋ค์ ๐ฅ |
@@ -25,4 +28,11 @@ class NoticeController( | |||
.let { createNoticeService.execute(clubId, it) } | |||
.let { ResponseEntity.status(HttpStatus.CREATED).build() } | |||
|
|||
@DeleteMapping("/{id}") | |||
fun deleteNotice( | |||
@PathVariable("id") id: Long |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ตณ์ด ๋ช ์ ์ํด์ค๋ ๋ ๊ฒ ๊ฐ์์
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5eb6382
์์ ํ์ต๋๋ค
val notice = noticeRepository.findByIdOrNull(id) | ||
?: throw NoticeNotFoundException() | ||
|
||
noticeRepository.delete(notice) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋จผ์ ์ํฐํฐ๋ฅผ ์ฐพ๊ณ delete ๋ฉ์๋์ ๋๊ธฐ๋ ๋ฐฉ์์ผ๋ก ์์ฑํ์ จ๋๋ฐ ์ด๋ ๊ฒ ํ๋ฉด delete ๋ด๋ถ ๊ตฌํ์ฒด์์ find ์ฟผ๋ฆฌ๋ฅผ ๋ฐ์ ์ํค๊ธฐ ๋๋ฌธ์ deleteById๋ฅผ ์ฌ์ฉํ๋๊ฒ ์ด๋จ๊น ์ถ๋ค์
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
47105b8
์์ ํ์ต๋๋ค
๐ก ๊ฐ์
๊ณต์ง์ฌํญ ์ญ์ api๋ฅผ ๊ตฌํํ์ต๋๋ค
๐ ์์ ๋ด์ฉ