mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-08-07 21:01:14 +00:00
login method changed to chzzk login
This commit is contained in:
@@ -8,9 +8,8 @@ import org.jetbrains.exposed.dao.id.IntIdTable
|
||||
|
||||
object Users: IntIdTable("users") {
|
||||
val username = varchar("username", 255)
|
||||
val token = varchar("token", 64).nullable()
|
||||
val token = varchar("token", 64)
|
||||
val discord = long("discord").nullable()
|
||||
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()
|
||||
@@ -24,7 +23,6 @@ class User(id: EntityID<Int>) : IntEntity(id) {
|
||||
var username by Users.username
|
||||
var token by Users.token
|
||||
var discord by Users.discord
|
||||
var naverId by Users.naverId
|
||||
var liveAlertGuild by Users.liveAlertGuild
|
||||
var liveAlertChannel by Users.liveAlertChannel
|
||||
var liveAlertMessage by Users.liveAlertMessage
|
||||
|
@@ -6,11 +6,11 @@ import space.mori.chzzk_bot.common.models.User
|
||||
import space.mori.chzzk_bot.common.models.Users
|
||||
|
||||
object UserService {
|
||||
fun saveUser(username: String, naverId: String): User {
|
||||
fun saveUser(username: String, token: String): User {
|
||||
return transaction {
|
||||
User.new {
|
||||
this.username = username
|
||||
this.naverId = naverId
|
||||
this.token = token
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,14 +64,6 @@ object UserService {
|
||||
}
|
||||
}
|
||||
|
||||
fun getUserWithNaverId(naverId: String): User? {
|
||||
return transaction {
|
||||
val user = User.find{ Users.naverId eq naverId }.firstOrNull()
|
||||
user?.load(User::subordinates, User::managers)
|
||||
user
|
||||
}
|
||||
}
|
||||
|
||||
fun getAllUsers(): List<User> {
|
||||
return transaction {
|
||||
User.all().toList()
|
||||
|
Reference in New Issue
Block a user