| | |
| | | import androidx.annotation.WorkerThread |
| | | import com.example.firstapp.database.dao.CodeDao |
| | | import com.example.firstapp.database.entity.Code |
| | | import com.example.firstapp.model.StationGroup |
| | | import kotlinx.coroutines.flow.Flow |
| | | |
| | | |
| | |
| | | return codeDao.getByKeyword(keyword) |
| | | } |
| | | |
| | | fun queryByTypeAndCodeAndDate(content: String, code: String, dateString: String): Code { |
| | | @WorkerThread |
| | | fun queryByTypeAndCodeAndDate(content: String, code: String, dateString: String): Code? { |
| | | return codeDao.queryByTypeAndCodeAndDate(content, code, dateString) |
| | | } |
| | | |
| | |
| | | |
| | | fun getCurrentYearStats(date: Long) = codeDao.getCurrentYearStats(date) |
| | | |
| | | @WorkerThread |
| | | fun getStationsByType(type: String): List<StationGroup> { |
| | | return codeDao.getStationsByType(type) |
| | | } |
| | | |
| | | @WorkerThread |
| | | fun getPackagesByTypeAndStation(type: String, stationName: String): List<Code> { |
| | | return codeDao.getPackagesByTypeAndStation(type, stationName) |
| | | } |
| | | |
| | | } |