Skip to content

Commit 42c037c

Browse files
committed
feat(be) : ë�서비스 단순 조회에 readonly 추가
1 parent 76061f6 commit 42c037c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/main/kotlin/com/back/koreaTravelGuide/domain/userChat/chatmessage/service/ChatMessageService.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ class ChatMessageService(
1313
) {
1414
data class SendMessageReq(val senderId: Long, val content: String)
1515

16+
@Transactional(readOnly = true)
1617
fun getlistbefore(
1718
roomId: Long,
1819
limit: Int,
1920
): List<ChatMessage> = msgRepository.findTop50ByRoomIdOrderByIdDesc(roomId).asReversed()
2021

22+
@Transactional(readOnly = true)
2123
fun getlistafter(
2224
roomId: Long,
2325
afterId: Long,

src/main/kotlin/com/back/koreaTravelGuide/domain/userChat/chatroom/service/ChatRoomService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class ChatRoomService(
2727
)
2828
}
2929

30+
@Transactional(readOnly = true)
3031
fun get(roomId: Long): ChatRoom =
3132
roomRepository.findById(roomId)
3233
.orElseThrow { NoSuchElementException("room not found: $roomId") }

0 commit comments

Comments
 (0)