package com.gh.gamecenter.retrofit.service

import com.gh.gamecenter.entity.AppEntity
import com.gh.gamecenter.entity.VNewSetting
import com.gh.gamecenter.entity.VSetting
import io.reactivex.Single
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.Query

interface VApiService {

    /**
     * 获取对应包名匹配的更新
     */
    @GET("upgrade")
    fun getPackageUpdate(
        @Query("version") version: String?,
        @Query("version_code") code: Int,
        @Query("package") packageName: String?
    ): Single<AppEntity>

    /**
     * 获取设置
     */
    @GET("setting")
    fun getSettings(@Query("version") version: String?, @Query("android") androidSdkVersion: Int): Single<VSetting>

    @GET("new/setting")
    fun getNewSettings(
        @Query("version") version: String?,
        @Query("android") androidSdkVersion: Int,
    ): Single<VNewSetting>

    @GET("new/upgrade")
    fun getNewPackageUpdate(
        @Query("version") version: String?,
        @Query("va_version") vaVersion: String?,
        @Query("channel") channel: String,
    ): Single<AppEntity>
}