package com.gh.gamecenter.feature.retrofit

import com.gh.gamecenter.feature.entity.FilterPackageConfig
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.PlatformEntity
import io.reactivex.Observable
import io.reactivex.Single
import okhttp3.ResponseBody
import retrofit2.http.*

interface ApiService {

    /**
     * 获取游戏平台信息
     */
    @GET("platforms")
    fun getGamePlatform(): Observable<List<PlatformEntity>>

    /**
     * 获取游戏摘要
     */
    @GET("games/{game_id}?view=digest")
    fun getGameDigest(@Path("game_id") game_id: String): Observable<GameEntity>

    /**
     * 添加关注
     */
    @Headers("Content-Type: application/json", "Accept: application/json")
    @POST("users/{user_id}/follows/games/{game_id}")
    fun postConcern(
        @Path("user_id") user_id: String,
        @Path("game_id") game_id: String,
        @Query("mode") mode: String
    ): Observable<ResponseBody>

    /**
     * 删除关注
     */
    @DELETE("users/{user_id}/follows/games/{game_id}")
    fun deleteConcern(@Path("user_id") user_id: String, @Path("game_id") game_id: String): Observable<ResponseBody>

    /**
     * 意见反馈-包名屏蔽列表
     */
    @GET("package_shield")
    fun getFeedbackFilterPackages(): Single<List<FilterPackageConfig>>
}