package com.narutohuo.xindazhou.common.auth.datasource.local

import com.narutohuo.xindazhou.common.auth.model.LoginResponse
import com.narutohuo.xindazhou.common.auth.storage.TokenStore

/**
 * 认证本地数据源实现
 * 
 * 使用 TokenStore 进行 Token 的持久化存储
 */
class AuthLocalDataSourceImpl : AuthLocalDataSource {
    
    override suspend fun saveToken(loginResponse: LoginResponse) {
        TokenStore.saveToken(
            loginResponse.accessToken,
            loginResponse.refreshToken,
            loginResponse.userId
        )
    }
    
    override suspend fun getToken(): String? {
        return TokenStore.getAccessToken()
    }
    
    override suspend fun clearToken() {
        TokenStore.clearToken()
    }
}

