mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
managers relation is fixed (3x)
This commit is contained in:
parent
1ec899a55a
commit
5d9b6a7e5e
@ -27,6 +27,9 @@ class User(id: EntityID<Int>) : IntEntity(id) {
|
|||||||
var liveAlertChannel by Users.liveAlertChannel
|
var liveAlertChannel by Users.liveAlertChannel
|
||||||
var liveAlertMessage by Users.liveAlertMessage
|
var liveAlertMessage by Users.liveAlertMessage
|
||||||
|
|
||||||
val managers by User.via(UserManagers.manager, UserManagers.user)
|
// 유저가 가진 매니저들
|
||||||
val subordinate by User.via(UserManagers.user, UserManagers.manager)
|
val managers by User.via(UserManagers.user, UserManagers.manager)
|
||||||
|
|
||||||
|
// 매니저가 관리하는 유저들
|
||||||
|
val subordinates by User.via(UserManagers.manager, UserManagers.user)
|
||||||
}
|
}
|
@ -117,11 +117,12 @@ fun Routing.apiRoutes() {
|
|||||||
songConfig.disabled
|
songConfig.disabled
|
||||||
))
|
))
|
||||||
|
|
||||||
user.subordinate.forEach {
|
returnUsers.addAll(user.subordinates.map {
|
||||||
val subStatus = user.token?.let { it1 -> getStreamInfo(it1) }
|
val subStatus = user.token?.let { it1 -> getStreamInfo(it1) }
|
||||||
if(it.token == null) return@forEach
|
return@map if (it.token == null || subStatus?.content == null) {
|
||||||
if(subStatus?.content == null) return@forEach
|
null
|
||||||
returnUsers.add(GetSessionDTO(
|
} else {
|
||||||
|
GetSessionDTO(
|
||||||
subStatus.content!!.channel.channelId,
|
subStatus.content!!.channel.channelId,
|
||||||
subStatus.content!!.channel.channelName,
|
subStatus.content!!.channel.channelName,
|
||||||
subStatus.content!!.status == "OPEN",
|
subStatus.content!!.status == "OPEN",
|
||||||
@ -130,8 +131,9 @@ fun Routing.apiRoutes() {
|
|||||||
0,
|
0,
|
||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
))
|
)
|
||||||
}
|
}
|
||||||
|
}.filterNotNull())
|
||||||
|
|
||||||
call.respond(HttpStatusCode.OK, returnUsers)
|
call.respond(HttpStatusCode.OK, returnUsers)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user