cloudroam
2025-03-31 a7820e2f1ee06a7b43b4d351cced3343d7e1a5e2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.example.firstapp.database.repository
 
import androidx.annotation.WorkerThread
import com.example.firstapp.database.dao.MsgDao
import com.example.firstapp.database.entity.Msg
 
 
class MsgRepository(private val msgDao: MsgDao) {
 
    @WorkerThread
    fun insert(msg: Msg): Long = msgDao.insert(msg)
 
    @WorkerThread
    fun delete(id: Long) = msgDao.delete(id)
 
    fun deleteAll() = msgDao.deleteAll()
 
    @WorkerThread
    fun deleteTimeAgo(time: Long) = msgDao.deleteTimeAgo(time)
 
}