package com.zxhl.cms.net.api

import com.zxhl.cms.ad.upload.model.Response
import com.zxhl.cms.common.NetConfig
import com.zxhl.cms.net.model.box.AddressEntity
import com.zxhl.cms.net.model.box.HomeListEntity
import com.zxhl.cms.net.model.box.RoomMemberEntity
import com.zxhl.cms.net.model.chat.*
import io.reactivex.Observable
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 * @Description: java类作用描述
 * @CreateDate: 2021/12/28 9:41 上午
 */
interface IChatModuleApi {
    /**
     * 发送礼物
     * @param giftId 礼物id
     * @param recevierUserId 接收礼物人id
     */
    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_MESSAGE_SEND_GIFT)
    fun chatSendGift(
        @Query("giftId") giftId: String?,
        @Query("userId") recevierUserId: String?
    ): Observable<Response<Any>>

    /**
     * 获取礼物列表
     */
    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_MESSAGE_GIFT_LIST)
    fun getChatGiftList(
        @Query("category") category: String?,
    ): Observable<Response<List<ChatGiftListBackEntity>>>

    /**
     * 获取好友亲密度
     */
    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_MESSAGE_STAR_VALUE)
    fun getChatMessageStarInfo(@Query("userId") userId: String): Observable<Response<ChatMessageStarEntity>>

    /**
     * 判断消息是否收费
     */
    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_MESSAGE_CHARGE_OR_NOT)
    fun getChatMessageChargeOrNot(
        @Query("type") type: String,
        @Query("userId") userId: String?
    ): Observable<Response<ChatMessageChargeOrNotEntity>>

    /**
     * 扣费
     */
    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_MESSAGE_IM_DEDUCTION)
    fun chatImDEduction(
        @Query("talkTime") talkTime: String?,
        @Query("type") type: String
    ): Observable<Response<Any>>

    /**
     * 发送消息
     */
    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_MESSAGE_SEND_MESSAGE)
    fun chatSendMessage(
        @Query("free") free: Int,
        @Query("msgContent") msgContent: String?,
        @Query("msgType") msgType: String?,
        @Query("userId") userId: String
    ): Observable<Response<Any>>

    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_MESSAGE_CHATUP_TEMPLATE)
    fun getChatUpMessageTemplate(): Observable<Response<ChatUpMessageTemplateEntity>>

    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_IM_FREE_REPORT)
    fun freeReport(
        @Query("type") type: Int?
    ): Observable<Response<Any>>

    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_HAS_WINTER_BOX)
    fun hasWinterBox(): Observable<Response<HasWinterBoxEntity>>

    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_GET_WINTER_BOX)
    fun getWinterBox(): Observable<Response<Any>>

    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_OPEN_WINTER_BOX)
    fun openWinterBox(): Observable<Response<BoxRewardEntity>>

    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_TAB)
    fun getTab(): Observable<Response<List<RoomTypeEntity>>>

    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_TO_CREATE_ROOM)
    fun toCreateRoom(): Observable<Response<ToCreateRoomEntity>>

    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_CREATE_ROOM)
    fun createRoom(@Body room: ChatRoomEntity?): Observable<Response<ChatRoomEntity>>

    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_ROOM_LIST)
    fun getRoomList(
        @Query("page") page: Int,
        @Query("size") size: Int,
        @Query("category") category: String
    ): Observable<Response<List<ChatRoomEntity>>>

    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_CLOSE_ROOM)
    fun closeRoom(@Query("roomId") roomId: Int): Observable<Response<RoomStatusEntity>>

    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_IN_ROOM)
    fun inRoom(@Query("roomId") roomId: String?): Observable<Response<RoomStatusEntity>>

    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_OUT_ROOM)
    fun outRoom(@Query("roomId") roomId: String): Observable<Response<Any>>

    @POST(NetConfig.StarLight.HOME_STAR_LIGHT_GIFT)
    fun getGift(
        @Query("giftId") giftId: Int,
        @Query("nums") nums: Int,
        @Query("userId") userId: Int,
    ): Observable<Response<Any>>

    @GET(NetConfig.StarLight.HOME_STAR_GIFT_WALL)
    fun getGiftWall(): Observable<Response<List<ChatRoomEntity>>>

    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_GET_RECENT_CONTACTS)
    fun getRecentContacts(): Observable<Response<List<RoomMemberEntity>>>

    @GET(NetConfig.StarLight.HOME_STAR_LIGHT_GET_ROOM_USER)
    fun getRoomUser(@Query("roomId") roomId: Int): Observable<Response<List<RoomMemberEntity>>>
}