mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
feat: Add the ability to save search queries
I got tired of putting the same tag over and over, so...
This commit is contained in:
parent
7a08ca294a
commit
f13f98f19a
26 changed files with 880 additions and 80 deletions
|
@ -0,0 +1,14 @@
|
|||
package yokai.domain.source.browse.filter
|
||||
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import yokai.domain.source.browse.filter.models.RawSavedSearch
|
||||
|
||||
interface SavedSearchRepository {
|
||||
suspend fun findAll(): List<RawSavedSearch>
|
||||
fun subscribeAllBySourceId(sourceId: Long): Flow<List<RawSavedSearch>>
|
||||
suspend fun findAllBySourceId(sourceId: Long): List<RawSavedSearch>
|
||||
suspend fun findOneBySourceIdAndName(sourceId: Long, name: String): RawSavedSearch?
|
||||
suspend fun findById(id: Long): RawSavedSearch?
|
||||
suspend fun deleteById(id: Long)
|
||||
suspend fun insert(sourceId: Long, name: String, query: String?, filtersJson: String?): Long?
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package yokai.domain.source.browse.filter.models
|
||||
|
||||
data class RawSavedSearch(
|
||||
val id: Long,
|
||||
val sourceId: Long,
|
||||
val name: String,
|
||||
val query: String?,
|
||||
val filtersJson: String?,
|
||||
) {
|
||||
companion object {
|
||||
fun mapper(
|
||||
id: Long,
|
||||
sourceId: Long,
|
||||
name: String,
|
||||
query: String?,
|
||||
filtersJson: String?,
|
||||
) = RawSavedSearch(
|
||||
id = id,
|
||||
sourceId = sourceId,
|
||||
name = name,
|
||||
query = query,
|
||||
filtersJson = filtersJson,
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue