diff --git a/common/src/main/kotlin/space/mori/chzzk_bot/common/models/User.kt b/common/src/main/kotlin/space/mori/chzzk_bot/common/models/User.kt index 334a10f..8cd8431 100644 --- a/common/src/main/kotlin/space/mori/chzzk_bot/common/models/User.kt +++ b/common/src/main/kotlin/space/mori/chzzk_bot/common/models/User.kt @@ -10,7 +10,7 @@ object Users: IntIdTable("users") { val username = varchar("username", 255) val token = varchar("token", 64) val discord = long("discord") - val naverId = long("naver_id") + val naverId = varchar('naver_id', 128) val liveAlertGuild = long("live_alert_guild").nullable() val liveAlertChannel = long("live_alert_channel").nullable() val liveAlertMessage = text("live_alert_message").nullable() diff --git a/common/src/main/kotlin/space/mori/chzzk_bot/common/services/UserService.kt b/common/src/main/kotlin/space/mori/chzzk_bot/common/services/UserService.kt index 3863851..4b430a8 100644 --- a/common/src/main/kotlin/space/mori/chzzk_bot/common/services/UserService.kt +++ b/common/src/main/kotlin/space/mori/chzzk_bot/common/services/UserService.kt @@ -47,7 +47,7 @@ object UserService { } } - fun getUserWithNaverId(naverId: Long): User? { + fun getUserWithNaverId(naverId: String): User? { return transaction { val users = User.find(Users.naverId eq naverId) diff --git a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt index 9208bd6..617d03c 100644 --- a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt +++ b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt @@ -73,7 +73,7 @@ fun Routing.apiRoutes() { return@get } println(session) - val user = UserService.getUserWithNaverId(session.id.toLong()) + val user = UserService.getUserWithNaverId(session.id) if(user == null) { call.respondText("No session found", status = HttpStatusCode.NotFound) return@get