package io.bluerain.tweets.data.api

import io.bluerain.tweets.data.api.ICommons.APPLICATION_JSON
import io.bluerain.tweets.data.models.ResultModel
import io.bluerain.tweets.data.models.TweetJsonModel
import io.bluerain.tweets.data.models.TweetModel
import retrofit2.Call
import retrofit2.http.*

/**
 * Created by hentioe on 17-5-6.
 * Tweets 相关 RESTful API
 */
interface ITweetsRest {

    @GET("/admin/v1/manage/tweets")
    fun list(@Header("authorization") token: String): Call<List<TweetModel>>

    @POST("/admin/v1/manage/tweets")
    @Headers(APPLICATION_JSON)
    fun publisher(@Header("authorization") token: String, @Body model: TweetModel): Call<ResultModel>

    @DELETE("/admin/v1/manage/tweets/{id}")
    fun delete(@Header("authorization") token: String, @Path("id") id: Long): Call<ResultModel>

    @PUT("/admin/v1/manage/tweets/status/1/{id}")
    fun hidden(@Header("authorization") token: String, @Path("id") id: Long): Call<ResultModel>

    @PUT("/admin/v1/manage/tweets/status/0/{id}")
    fun normal(@Header("authorization") token: String, @Path("id") id: Long): Call<ResultModel>

    @PUT("/admin/v1/manage/tweets")
    @Headers(APPLICATION_JSON)
    fun update(@Header("authorization") token: String, @Body model: TweetJsonModel): Call<ResultModel>


}