pull/2380/head
parent
0867c1fc32
commit
c214fb65ca
@ -1,4 +1,4 @@ |
||||
package io.legado.app.help.webdav |
||||
package io.legado.app.help |
||||
|
||||
import android.content.Context |
||||
import io.legado.app.R |
@ -1,4 +1,4 @@ |
||||
package io.legado.app.help |
||||
package io.legado.app.help.book |
||||
|
||||
import com.github.liuyueyi.quick.transfer.ChineseUtils |
||||
import io.legado.app.constant.AppLog |
@ -0,0 +1,35 @@ |
||||
package io.legado.app.model.remote |
||||
|
||||
import android.net.Uri |
||||
import io.legado.app.data.entities.Book |
||||
import io.legado.app.data.entities.RemoteBook |
||||
|
||||
abstract class RemoteBookManager { |
||||
protected val remoteBookFolder: String = "books" |
||||
|
||||
abstract suspend fun initRemoteContext() |
||||
|
||||
/** |
||||
* 获取书籍列表 |
||||
*/ |
||||
@Throws(Exception::class) |
||||
abstract suspend fun getRemoteBookList(path: String): MutableList<RemoteBook> |
||||
|
||||
/** |
||||
* 上传书籍 |
||||
*/ |
||||
@Throws(Exception::class) |
||||
abstract suspend fun upload(book: Book) |
||||
|
||||
/** |
||||
* 删除书籍 |
||||
*/ |
||||
@Throws(Exception::class) |
||||
abstract suspend fun delete(remoteBookUrl: String) |
||||
|
||||
/** |
||||
* @return Uri:下载到本地的路径 |
||||
*/ |
||||
@Throws(Exception::class) |
||||
abstract suspend fun getRemoteBook(remoteBook: RemoteBook): Uri |
||||
} |
@ -1,18 +0,0 @@ |
||||
package io.legado.app.ui.book.remote |
||||
|
||||
import android.net.Uri |
||||
import io.legado.app.data.entities.Book |
||||
import io.legado.app.data.entities.RemoteBook |
||||
|
||||
abstract class RemoteBookManager { |
||||
protected val remoteBookFolder : String = "books" |
||||
abstract suspend fun initRemoteContext() |
||||
abstract suspend fun getRemoteBookList(path: String): MutableList<RemoteBook> |
||||
abstract suspend fun upload(book: Book): Boolean |
||||
abstract suspend fun delete(remoteBookUrl: String): Boolean |
||||
|
||||
/** |
||||
* @return String:下载到本地的路径 |
||||
*/ |
||||
abstract suspend fun getRemoteBook(remoteBook: RemoteBook): Uri? |
||||
} |
Loading…
Reference in new issue