32 lines
809 B
Kotlin
32 lines
809 B
Kotlin
package com.example.smart119
|
|
|
|
import com.google.gson.JsonObject
|
|
|
|
object LoginManager {
|
|
private var isLoggedIn: Boolean = false // 기본값 설정
|
|
var tryLoginBody: JsonObject = JsonObject().apply {
|
|
addProperty("userId", "")
|
|
addProperty("carNo", "")
|
|
addProperty("ver", "")
|
|
}
|
|
|
|
// 로그인 상태 확인
|
|
fun isLoggedIn(): Boolean {
|
|
return isLoggedIn
|
|
}
|
|
|
|
// 로그인 상태 업데이트
|
|
fun setLoggedIn(status: Boolean) {
|
|
isLoggedIn = status
|
|
}
|
|
|
|
fun getLoggedInfo() :JsonObject{
|
|
return tryLoginBody;
|
|
}
|
|
|
|
fun setLoggedInfo(userId:String, carNo:String, ver:String) {
|
|
tryLoginBody.addProperty("userId", userId)
|
|
tryLoginBody.addProperty("carNo", carNo)
|
|
tryLoginBody.addProperty("ver", ver)
|
|
}
|
|
} |