[add] function implementation
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package com.acitelight.aether.model
|
||||
|
||||
data class BookMark(
|
||||
val name: String,
|
||||
val page: String
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.acitelight.aether.model
|
||||
|
||||
data class ChallengeResponse(
|
||||
val response: String // 签名后的 challenge
|
||||
)
|
||||
8
app/src/main/java/com/acitelight/aether/model/Comic.kt
Normal file
8
app/src/main/java/com/acitelight/aether/model/Comic.kt
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.acitelight.aether.model
|
||||
|
||||
data class Comic(
|
||||
val comic_name: String,
|
||||
val page_count: Int,
|
||||
val bookmarks: List<BookMark>,
|
||||
val pages: List<String>
|
||||
)
|
||||
7
app/src/main/java/com/acitelight/aether/model/Comment.kt
Normal file
7
app/src/main/java/com/acitelight/aether/model/Comment.kt
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.acitelight.aether.model
|
||||
|
||||
data class Comment(
|
||||
val content: String,
|
||||
val username: String,
|
||||
val time: String
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.acitelight.aether.model
|
||||
|
||||
data class KeyImage(
|
||||
val url: String,
|
||||
val key: String
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.acitelight.aether.model
|
||||
|
||||
data class TokenResponse(
|
||||
val token: String
|
||||
)
|
||||
28
app/src/main/java/com/acitelight/aether/model/Video.kt
Normal file
28
app/src/main/java/com/acitelight/aether/model/Video.kt
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.acitelight.aether.model
|
||||
|
||||
import com.acitelight.aether.service.ApiClient
|
||||
import java.security.KeyPair
|
||||
|
||||
class Video constructor(
|
||||
val klass: String,
|
||||
val id: String,
|
||||
val token: String,
|
||||
val video: VideoResponse
|
||||
){
|
||||
fun getCover(): String
|
||||
{
|
||||
return "${ApiClient.base}api/video/$klass/$id/cover?token=$token"
|
||||
}
|
||||
|
||||
fun getVideo(): String
|
||||
{
|
||||
return "${ApiClient.base}api/video/$klass/$id/av?token=$token"
|
||||
}
|
||||
|
||||
fun getGallery(): List<KeyImage>
|
||||
{
|
||||
return video.gallery.map{
|
||||
KeyImage(url = "${ApiClient.base}api/video/$klass/$id/gallery/$it?token=$token", key = "$klass/$id/gallery/$it")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.acitelight.aether.model
|
||||
|
||||
data class VideoResponse(
|
||||
val name: String,
|
||||
val duration: Long,
|
||||
val gallery: List<String>,
|
||||
val comment: List<Comment>,
|
||||
val star: Boolean,
|
||||
val like: Int,
|
||||
val author: String
|
||||
)
|
||||
Reference in New Issue
Block a user