|
|
@ -9,24 +9,24 @@ import kotlinx.android.parcel.Parcelize |
|
|
|
|
|
|
|
|
|
|
|
@Parcelize |
|
|
|
@Parcelize |
|
|
|
@Entity( |
|
|
|
@Entity( |
|
|
|
tableName = "chapters", |
|
|
|
tableName = "chapters", |
|
|
|
primaryKeys = ["exploreUrl", "bookUrl"], |
|
|
|
primaryKeys = ["url", "bookUrl"], |
|
|
|
indices = [(Index(value = ["exploreUrl"], unique = true)), (Index(value = ["bookUrl", "index"], unique = true))], |
|
|
|
indices = [(Index(value = ["bookUrl"], unique = true)), (Index(value = ["bookUrl", "index"], unique = true))], |
|
|
|
foreignKeys = [(ForeignKey( |
|
|
|
foreignKeys = [(ForeignKey( |
|
|
|
entity = Book::class, |
|
|
|
entity = Book::class, |
|
|
|
parentColumns = ["descUrl"], |
|
|
|
parentColumns = ["descUrl"], |
|
|
|
childColumns = ["bookUrl"], |
|
|
|
childColumns = ["bookUrl"], |
|
|
|
onDelete = ForeignKey.CASCADE |
|
|
|
onDelete = ForeignKey.CASCADE |
|
|
|
))] |
|
|
|
))] |
|
|
|
) // 删除书籍时自动删除章节 |
|
|
|
) // 删除书籍时自动删除章节 |
|
|
|
data class BookChapter( |
|
|
|
data class BookChapter( |
|
|
|
var url: String = "", // 章节地址 |
|
|
|
var url: String = "", // 章节地址 |
|
|
|
var title: String = "", // 章节标题 |
|
|
|
var title: String = "", // 章节标题 |
|
|
|
var bookUrl: String = "", // 书籍地址 |
|
|
|
var bookUrl: String = "", // 书籍地址 |
|
|
|
var index: Int = 0, // 章节序号 |
|
|
|
var index: Int = 0, // 章节序号 |
|
|
|
var resourceUrl: String? = null, // 音频真实URL |
|
|
|
var resourceUrl: String? = null, // 音频真实URL |
|
|
|
var tag: String? = null, // |
|
|
|
var tag: String? = null, // |
|
|
|
var start: Long? = null, // 章节起始位置 |
|
|
|
var start: Long? = null, // 章节起始位置 |
|
|
|
var end: Long? = null // 章节终止位置 |
|
|
|
var end: Long? = null // 章节终止位置 |
|
|
|
) : Parcelable |
|
|
|
) : Parcelable |
|
|
|
|
|
|
|
|
|
|
|