package com.swago.baseswago.inter

import com.swago.baseswago.model.live.*
import com.swago.baseswago.model.live.game.GameListModel
import com.swago.baseswago.model.live.gift.GiftAllModel
import com.swago.baseswago.model.live.gift.GiftSendModel
import retrofit2.http.*

/**
 *@date 2021/10/20 21:26
 *description:
 */
interface RoomApi {

    /**
     * 游戏列表
     */
    @POST("/v1/rtc/game/list")
    suspend fun getGameList(): GameListModel

    /**
     * 开播
     */
    @FormUrlEncoded
    @POST("/v1/rtc/start/broadcast")
    suspend fun startLive(@Field("game_type")game_type:Int):RoomModel


    /**
     * 关播
     */
    @POST("/v1/rtc/end/broadcast")
    suspend fun closeLive():AnchorClosedModel


    /**
     * 加入房间
     */
    @FormUrlEncoded
    @POST("/v1/rtc/join/broadcast")
    suspend fun joinRoom(@Field("room_id")room_id:String):RoomModel

    /**
     * 退出房间
     */
    @FormUrlEncoded
    @POST("/v1/rtc/leave/broadcast")
    suspend fun leaveRoom(@Field("room_id")room_id:String):Any


    /**
     * 观众列表
     */
    @FormUrlEncoded
    @POST("/v1/rtc/broadcast/user/list")
    suspend fun getRoomUser(@Field("room_id")room_id:String,@Field("page")page:Int=1,@Field("page_size")page_size:Int=100):RoomUserModel

    /**
     * 直播间排行榜
     * 排行榜类型(1日榜2周榜3月榜)rank_type
     */
    @FormUrlEncoded
    @POST("/v1/rtc/fans/rank/list")
    suspend fun getRankList(@Field("room_id")room_id:String,@Field("rank_type")rank_type:Int,@Field("page")page:Int=1,@Field("page_size")page_size:Int=20):RankListModel


    /**
     * 直播间礼物
     */
    @POST("/v1/rtc/gift/list")
    suspend fun getGiftList():List<GiftAllModel>

    /**
     * 赠送礼物
     */
    @FormUrlEncoded
    @POST("/v1/rtc/buy/gift")
    suspend fun sendGift(@Field("room_id")room_id:String,
                         @Field("gift_id")gift_id:String,
                         @Field("gift_batch")gift_batch:Int,
                         @Field("gift_receive_id")gift_receive_id:String,
                         @Field("is_combo")is_combo:Int,
                         @Field("gift_num")gift_num:Int): GiftSendModel

    /**
     * 用户在直播间权限
     */
    @FormUrlEncoded
    @POST("/v1/rtc/broadcast/auth")
    suspend fun getUserRoomAuth(@Field("room_id")room_id:String,
                                @Field("user_id")user_id:String):RoomAuthModel

    /**
     * 剔除直播间
     * type 1 添加  0移除
     */
    @FormUrlEncoded
    @POST("/v1/rtc/remove/user")
    suspend fun kickUserFromRoom(@Field("room_id")room_id:String,
                                 @Field("user_id")user_id:String,
                                 @Field("type")type:Int)

    /**
     * 用户禁言
     */
    @FormUrlEncoded
    @POST("/v1/rtc/forbid/user/msg")
    suspend fun muteUerFromRoom(@Field("room_id")room_id:String,
                                @Field("user_id")user_id:String,
                                @Field("type")type:Int)

    /**
     * 直播间拉黑
     * black_type  用户类型 1拉黑主播 2拉黑用户
     * type 类型(0取消拉黑1拉黑)
     */
    @FormUrlEncoded
    @POST("/v1/rtc/broadcast/black/user")
    suspend fun blackUser(@Field("black_user_id")black_user_id:String,
                          @Field("black_type")black_type:Int,
                          @Field("type")type:Int)

}