add Session flows (1x)

- fix APIRoutes (debug Naver UserID)
This commit is contained in:
dalbodeule 2024-08-08 17:37:01 +09:00
parent 561ab188b2
commit 172885ae38
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65
3 changed files with 3 additions and 3 deletions

View File

@ -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()

View File

@ -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)

View File

@ -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