com.hiczp.picacomic.api.service.Response.kt Maven / Gradle / Ivy
package com.hiczp.picacomic.api.service
import io.ktor.http.HttpStatusCode
data class Response(
val code: Int,
val error: String?,
val message: String,
val detail: String?,
val data: T
) {
fun ok() = code == HttpStatusCode.OK.value
fun unauthorized() = code == HttpStatusCode.Unauthorized.value
val hasError get() = error != null
val hasDetail get() = detail != null
val hasData get() = data != null
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy