All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.shoaky.sourcedownloader.sdk.api.bangumi.BangumiApiClient.kt Maven / Gradle / Ivy

The newest version!
package xyz.shoaky.sourcedownloader.sdk.api.bangumi

import xyz.shoaky.sourcedownloader.sdk.api.BaseRequest
import xyz.shoaky.sourcedownloader.sdk.api.HookedApiClient
import java.net.URI
import java.net.http.HttpRequest
import java.net.http.HttpResponse

//TODO 没有token有些结果获取不到
object BangumiApiClient : HookedApiClient() {

    private val endpoint by lazy {
        val s = System.getenv("BANGUMI_API_SERVER") ?: "https://api.bgm.tv/"
        URI(s) }
    fun , T : Any> execute(request: R): HttpResponse {
        return super.execute(endpoint, request)
    }

    override fun , T : Any> beforeRequest(requestBuilder: HttpRequest.Builder, request: R) {

    }

    override fun , T : Any> afterRequest(response: HttpResponse, request: R) {
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy