[add] function implementation

This commit is contained in:
acite
2025-08-24 20:07:38 +08:00
parent 996c1ff5cf
commit d0a6497dd6
64 changed files with 2924 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
package com.acitelight.aether.model
data class BookMark(
val name: String,
val page: String
)

View File

@@ -0,0 +1,5 @@
package com.acitelight.aether.model
data class ChallengeResponse(
val response: String // 签名后的 challenge
)

View 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>
)

View File

@@ -0,0 +1,7 @@
package com.acitelight.aether.model
data class Comment(
val content: String,
val username: String,
val time: String
)

View File

@@ -0,0 +1,6 @@
package com.acitelight.aether.model
data class KeyImage(
val url: String,
val key: String
)

View File

@@ -0,0 +1,5 @@
package com.acitelight.aether.model
data class TokenResponse(
val token: String
)

View 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")
}
}
}

View File

@@ -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
)