use string tag in domain layer

This commit is contained in:
2026-06-21 21:38:56 +03:00
parent 21a768edd5
commit b66fe60e48
25 changed files with 195 additions and 169 deletions
@@ -6,14 +6,14 @@ import ru.shadowsparky.vbox.shared.domain.DYNAMIC_PREFIX
interface MovieTagRepository {
fun query(movieId: Long): Flow<List<TagInfo>>
fun queryMovies(tagId: Long): Flow<Set<Long>>
suspend fun link(movieId: Long, tagId: Long)
suspend fun unlink(movieId: Long, tagId: Long)
fun queryMovies(tag: String): Flow<Set<Long>>
suspend fun link(movieId: Long, tag: String)
suspend fun unlink(movieId: Long, tag: String)
suspend fun clear() {}
companion object {
const val TAG_ID = "tagId"
const val TAG_NAME = "tagName"
const val MOVIE_ID = "movieId"
const val PREFIX = "$DYNAMIC_PREFIX/movieTag"
@@ -25,7 +25,7 @@ interface MovieTagRepository {
}
@Serializable
data class LinkRequest(val movieId: Long, val tagId: Long)
data class LinkRequest(val movieId: Long, val tag: String)
@Serializable
data class LinkedMovies(val ids: Set<Long>)
@@ -8,8 +8,8 @@ interface UserTagRepository {
val userTags: Flow<List<TagInfo>>
suspend fun add(tag: String)
suspend fun edit(id: Long, newTag: String)
suspend fun delete(id: Long)
suspend fun edit(oldTag: String, newTag: String)
suspend fun delete(tag: String)
suspend fun clear() {}
@@ -18,6 +18,7 @@ interface UserTagRepository {
const val LIST = "$PREFIX/list"
const val ADD = "$PREFIX/add"
const val EDIT = "$PREFIX/edit"
const val DELETE = "$PREFIX/delete"
}
@@ -30,10 +31,10 @@ data class TagResponse(val tags: List<TagInfo>)
data class AddRequest(val tag: String)
@Serializable
data class EditRequest(val id: Long, val newTag: String)
data class EditRequest(val oldTag: String, val newTag: String)
@Serializable
data class DeleteRequest(val id: Long)
data class DeleteRequest(val tag: String)
@Serializable
data class TagInfo(