BookRepositoryApi

书本相关的Api

Since

Api 2

Functions

Link copied to clipboard

获取全部存在的书本阅读数据

Link copied to clipboard
abstract suspend fun getBookInformation(id: String, priority: WebDataSourcePriority): BookInformation

获取书本详情

Link copied to clipboard
abstract fun getBookInformationFlow(id: String, priority: WebDataSourcePriority = WebDataSourcePriority.Default): Flow<BookInformation>

获取书本详情的流 流遵照先本地后远程的顺序发射数据

Link copied to clipboard
abstract fun getBookVolumesFlow(id: String, priority: WebDataSourcePriority = WebDataSourcePriority.Default): Flow<BookVolumes>

获取书本卷目录的流 流遵照先本地后远程的顺序发射数据

Link copied to clipboard
abstract suspend fun getChapterContent(chapterId: String, bookId: String, priority: WebDataSourcePriority = WebDataSourcePriority.Default): ChapterContent

获取章节内容

Link copied to clipboard
abstract fun getChapterContentFlow(chapterId: String, bookId: String, priority: WebDataSourcePriority = WebDataSourcePriority.Default): Flow<ChapterContent>

获取章节内容的流 流遵照先本地后远程的顺序发射数据

Link copied to clipboard
abstract suspend fun getIsBookCached(bookId: String): Boolean

获取书本是缓存状态

Link copied to clipboard
abstract fun getStateBookInformation(id: String, coroutineScope: CoroutineScope, priority: WebDataSourcePriority = WebDataSourcePriority.Default): BookInformation

获取可观测的书本详情 需要传入CoroutineScope用于主动更新内容 调用此函数后会启动一个协程来更新其内容 遵照先本地后远程的顺序更新数据

Link copied to clipboard
abstract fun getStateChapterContent(chapterId: String, bookId: String, coroutineScope: CoroutineScope, priority: WebDataSourcePriority = WebDataSourcePriority.Default): ChapterContent

获取可观测的章节内容 需要传入CoroutineScope用于主动更新内容 调用此函数后会启动一个协程来更新其内容 遵照先本地后远程的顺序更新数据

Link copied to clipboard
abstract fun getStateUserReadingData(bookId: String, coroutineScope: CoroutineScope): UserReadingData

获取可观测的阅读数据 需要传入CoroutineScope用于主动更新内容 调用此函数后会启动一个协程来更新其内容

Link copied to clipboard

获取阅读数据

Link copied to clipboard
abstract fun getUserReadingDataFlow(bookId: String): Flow<UserReadingData>

获取阅读数据的流

Link copied to clipboard
abstract fun progressBookTagClick(tag: String, navController: NavController)

将书本标签点击事件交于数据源处处理

Link copied to clipboard

更新用户书本阅读数据