fix: 앱 실행시 처음 실행하는 유저 정보 조회
- point를 가져와서 SharedPreferences에 저장
This commit is contained in:
@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.common
|
||||
|
||||
object Constants {
|
||||
const val PREF_CAN = "pref_can"
|
||||
const val PREF_POINT = "pref_point"
|
||||
const val PREF_TOKEN = "pref_token"
|
||||
const val PREF_EMAIL = "pref_email"
|
||||
const val PREF_USER_ID = "pref_user_id"
|
||||
|
||||
@@ -99,6 +99,12 @@ object SharedPreferenceManager {
|
||||
sharedPreferences[Constants.PREF_CAN] = value
|
||||
}
|
||||
|
||||
var point: Int
|
||||
get() = sharedPreferences[Constants.PREF_POINT, 0]
|
||||
set(value) {
|
||||
sharedPreferences[Constants.PREF_POINT] = value
|
||||
}
|
||||
|
||||
var role: String
|
||||
get() = sharedPreferences[Constants.PREF_USER_ROLE, MemberRole.USER.name]
|
||||
set(value) {
|
||||
|
||||
@@ -100,6 +100,7 @@ class MainViewModel(
|
||||
if (it.success && it.data != null) {
|
||||
val data = it.data
|
||||
SharedPreferenceManager.can = data.can
|
||||
SharedPreferenceManager.point = data.point
|
||||
SharedPreferenceManager.role = data.role.name
|
||||
SharedPreferenceManager.isAuth = data.isAuth
|
||||
SharedPreferenceManager.isAuditionNotification =
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.google.gson.annotations.SerializedName
|
||||
@Keep
|
||||
data class GetMemberInfoResponse(
|
||||
@SerializedName("can") val can: Int,
|
||||
@SerializedName("point") val point: Int,
|
||||
@SerializedName("isAuth") val isAuth: Boolean,
|
||||
@SerializedName("gender") val gender: String?,
|
||||
@SerializedName("signupDate") val signupDate: String,
|
||||
|
||||
Reference in New Issue
Block a user