diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/GetMenuPresetResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/GetMenuPresetResponse.kt new file mode 100644 index 0000000..b1d6aec --- /dev/null +++ b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/GetMenuPresetResponse.kt @@ -0,0 +1,7 @@ +package kr.co.vividnext.sodalive.live.room.menu + +data class GetMenuPresetResponse( + val id: Long, + val menu: String, + val isActive: Boolean +) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/GetMenuResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/GetMenuResponse.kt deleted file mode 100644 index c1187e9..0000000 --- a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/GetMenuResponse.kt +++ /dev/null @@ -1,6 +0,0 @@ -package kr.co.vividnext.sodalive.live.room.menu - -data class GetMenuResponse( - val id: Long, - val menu: String -) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/LiveRoomMenuService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/LiveRoomMenuService.kt index e27c78a..e9fc6ab 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/LiveRoomMenuService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/menu/LiveRoomMenuService.kt @@ -9,13 +9,13 @@ class LiveRoomMenuService( private val idGenerator: RedisIdGenerator, private val repository: LiveRoomMenuRepository ) { - fun getAllLiveMenu(creatorId: Long, memberId: Long): List { + fun getAllLiveMenu(creatorId: Long, memberId: Long): List { if (creatorId != memberId) throw SodaException("잘못된 요청입니다.") return repository.findByCreatorId(creatorId) .sortedBy { it.id } .asSequence() - .map { GetMenuResponse(id = it.id, menu = it.menu) } + .map { GetMenuPresetResponse(id = it.id, menu = it.menu, isActive = it.isActive) } .toList() } @@ -66,7 +66,7 @@ class LiveRoomMenuService( } } - fun getLiveMenu(creatorId: Long): GetMenuResponse? { + fun getLiveMenu(creatorId: Long): GetMenuPresetResponse? { val menuList = repository.findByCreatorId(creatorId = creatorId) var activeMenu: LiveRoomMenu? = null @@ -81,7 +81,7 @@ class LiveRoomMenuService( return null } - return GetMenuResponse(id = activeMenu.id, menu = activeMenu.menu) + return GetMenuPresetResponse(id = activeMenu.id, menu = activeMenu.menu, isActive = activeMenu.isActive) } fun deactivateAll(memberId: Long) {