package com.example.dtf.repositories.online

import com.example.dtf.api.ServerService
import com.example.dtf.db.AppDatabase
import com.example.dtf.models.User
import com.example.dtf.repositories.IUserRepository
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import javax.inject.Inject

class RestUserRepository @Inject constructor(
    private val appDatabase: AppDatabase,
    private val serverService: ServerService
) : IUserRepository {
    override fun getById(id: Int): Flow<User> {
        return flow { emit(serverService.getUser(id)) }
    }
}