package com.pixelized.biblib.network.client

import com.google.gson.internal.LinkedTreeMap
import com.pixelized.biblib.network.data.query.AuthLoginQuery
import com.pixelized.biblib.network.data.response.*
import retrofit2.http.*

interface IBibLibWebServiceAPI {
    @POST("authent/login")
    suspend fun login(@Body query: AuthLoginQuery): AuthLoginResponse

    @GET("authent/google-id-token")
    suspend fun loginWithGoogle(@Query("id_token") token: String): AuthLoginResponse

    @GET("authent/user")
    suspend fun user(): UserResponse

    @GET("book")
    suspend fun list(): BookListResponse

    @GET("book/new")
    suspend fun new(): BookListResponse

    @GET("book/{id}")
    suspend fun detail(@Path("id") bookId: Int): BookDetailResponse

    @GET("book/{id}/send/kindle")
    suspend fun send(@Path("id") bookId: Int, @Query("mail") mail: String, @Query("format") format: String): LinkedTreeMap<String, Any>

    @GET("series")
    suspend fun series(): SeriesListResponse

    @GET("tags")
    suspend fun genre(): GenreListResponse

//    @GET("/book/{id}/epub/url")
//    suspend fun epub(@Path("id") bookId: Int): TokenResponse
//
//    @GET("/book/{id}/mobi/url")
//    suspend fun mobi(@Path("id") bookId: Int): TokenResponse
//
//    @GET("/book/{id}/epub")
//    fun downloadEpub(@Path("id") bookId: Int, @Query("token") token: String): Call<ResponseBody>
//
//    @GET("/book/{id}/mobi")
//    fun downloadMobi(@Path("id") bookId: Int, @Query("token") token: String): Call<ResponseBody>
}