package com.ym.library.net

import com.ym.xynt.UserInfoEntity
import com.ym.library.module.*
import io.reactivex.Observable
import okhttp3.ResponseBody
import retrofit2.http.*

/**
 * Created by Antonio on 2019/5/15.
 */
interface IUserApi {

    /**
     * 版本
     *
     * @return
     */
    @GET("app/v1/version")
    fun getVersion(): Observable<Response<VersionEntity?>>

    /**
     * 游客登录
     *
     * @return
     */
    @POST(NetConfig.User.URL_DEVEICE_LOGIN_)
    fun deveiceLogin(): Observable<Response<UserInfoEntity>>

    /**
     * 获取用户资料
     * @return
     */
    @GET(NetConfig.User.URL_USER_GET_USERINFO_)
    fun getUserInfo(): Observable<Response<UserInfoEntity>>

    /**
     * 绑定微信
     * @return
     */

    @POST(NetConfig.User.URL_USER_WITHDRAW_BIND_WX)
    fun bindWx(
        @Query("openid") oppenid: String,
        @Query("accessToken") token: String
    ): Observable<Response<WxBindEntity>>

    /**
     * h5-post接口
     * @param
     * @param
     * @return
     */
    @POST
    fun webApiPost(@Url url: String): Observable<retrofit2.Response<ResponseBody>>

    /**
     * h5-get接口
     * @param
     * @param
     * @return
     */
    @GET
    fun webApiGet(@Url url: String): Observable<retrofit2.Response<ResponseBody>>
    /**
     * 加金币接口
     *
     * @return
     */
    @POST(NetConfig.Ad.URL_AD_NEW_GET_STATUS)
    fun readAddCoins(
        @Query("md5") md5: String,
        @Query("type") type: Long,
        @Query("adId") sid: String,
        @Query("slot_id") slot_id: String,
        @Query("adSign") adSign: String
    ): Observable<Response<CoinEntity>>
    /**
     * @param
     * @param
     * @return
     */
    @POST(NetConfig.User.URL_TASK_ADD_COINS)
    fun addCoins(
        @Query("md5") sessionId: String,
        @Query("type") type: Int,
        @Query("sid") sid: String,
        @Query(
            "slot_id"
        ) slot_id: String
    ): Observable<Response<CoinEntity>>
}