package com.ys.bdtp.adm.mvvm.vm.task

import com.ys.bdtp.adm.mvvm.model.db.AdmDatabase
import com.ys.bdtp.adm.mvvm.model.db.entity.task.ProjectEntity
import com.ys.bdtp.adm.mvvm.model.nt.Api
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

/**
 * TaskRepository
 */
class TaskRepository(private val api: Api, private val db: AdmDatabase) {
    /**
     * 获取项目实例
     *
     * @author bai
     * @param id 项目id
     */
    suspend fun getProject(id: String): ProjectEntity {
        return withContext(Dispatchers.IO) {
            db.projectDao().getProjectById(id)
        }
    }
}