implement the album feature

This commit is contained in:
Carlos Martinez
2020-02-03 23:01:38 -03:00
parent 1d752803d7
commit 2411c1c84d
24 changed files with 367 additions and 98 deletions

View File

@@ -1,5 +0,0 @@
package com.hako.base.domain
interface UseCase <T> {
fun execute(onSuccess: (List<T>) -> Unit, onError: (Throwable) -> Unit, onLoading: () -> Unit)
}

View File

@@ -18,6 +18,9 @@ interface AlbumDao {
@get:Query("SELECT * FROM ${AlbumEntity.TABLE_NAME}")
val all: List<AlbumEntity>
@Query("SELECT * FROM ${AlbumEntity.TABLE_NAME} WHERE userId = :userId ORDER BY id ASC")
fun getAlbums(userId: Int): List<AlbumEntity>
@Query("SELECT COUNT(*) FROM ${AlbumEntity.TABLE_NAME}")
fun count(): Int