![JAR search and dependency download from the Maven repository](/logo.png)
com.hiczp.bilibili.api.retrofit.CommonResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bilibili-api Show documentation
Show all versions of bilibili-api Show documentation
Bilibili Android client API library for Kotlin
package com.hiczp.bilibili.api.retrofit
import com.google.gson.JsonElement
import com.google.gson.annotations.SerializedName
/**
* 通用实体, 可表示无 data 的响应 或 错误响应
* code 为 0 表示正常响应, 此时 message 为 null
* code 不为 0 表示错误响应, 此时 data 可能是各种类型
* 一些 API 同时有 msg 和 message
*/
data class CommonResponse(
@SerializedName("code")
var code: Int, // 0
@SerializedName("msg")
var msg: String?,
@SerializedName("message")
var message: String?,
@SerializedName("ts")
var timestamp: Long, // 1550546539
/**
* data 可能是各种类型, 例如 array, object, string
*/
@SerializedName("data")
var data: JsonElement?,
/**
* ttl, 不明确含义, 如果存在则值总为 1
*/
@SerializedName("ttl")
var ttl: Int?
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy