package com.adealink.weparty.room.datasource.remote

import com.adealink.frame.base.Rlt
import com.adealink.frame.network.data.Res
import com.adealink.weparty.room.data.AcceptApplyMicReq
import com.adealink.weparty.room.data.ApplyMicListReq
import com.adealink.weparty.room.data.ApplyMicListRes
import com.adealink.weparty.room.data.ApplyMicPlaymateCategoryReq
import com.adealink.weparty.room.data.ApplyMicPlaymateCategoryRes
import com.adealink.weparty.room.data.ApplyMicReq
import com.adealink.weparty.room.data.CancelApplyMicReq
import com.adealink.weparty.room.data.CheckCreateRoomPermissionRes
import com.adealink.weparty.room.data.ClearApplyMicListReq
import com.adealink.weparty.room.data.CreateRoomReq
import com.adealink.weparty.room.data.CreateRoomRes
import com.adealink.weparty.room.data.GetRoomMemberReq
import com.adealink.weparty.room.data.GetRoomMemberRes
import com.adealink.weparty.room.data.InviteMicReq
import com.adealink.weparty.room.data.ReportRoomAvailableReq
import com.adealink.weparty.room.data.RoomPlaymateCategoryReq
import com.adealink.weparty.room.data.RoomPlaymateCategoryRes
import com.adealink.weparty.room.data.UpdateRoomInfoReq
import com.adealink.weparty.room.list.data.RoomListReq
import com.adealink.weparty.room.list.data.RoomListRes
import retrofit2.http.Body
import retrofit2.http.Core
import retrofit2.http.POST

interface RoomHttpService {

    /**
     * 房间列表
     */
    @POST("live/room/list")
    suspend fun roomList(@Body req: RoomListReq): Rlt<Res<RoomListRes>>

    @Core
    @POST("live/host/info")
    suspend fun checkCreateRoomPermission(): Rlt<Res<CheckCreateRoomPermissionRes>>

    @POST("live/room/create")
    suspend fun createRoom(@Body req: CreateRoomReq): Rlt<Res<CreateRoomRes>>

    //申请上麦
    @POST("live/mic/apply/submit")
    suspend fun applyMic(@Body req: ApplyMicReq): Rlt<Res<Any>>

    @POST("live/mic/apply/cancel")
    suspend fun cancelApplyMic(@Body req: CancelApplyMicReq): Rlt<Res<Any>>

    @POST("live/mic/apply/list")
    suspend fun applyMicList(@Body req: ApplyMicListReq): Rlt<Res<ApplyMicListRes>>

    //审核上麦(同意,pass:true)
    @POST("live/mic/apply/audit")
    suspend fun acceptApplyMic(@Body req: AcceptApplyMicReq): Rlt<Res<Any>>

    //清除申请
    @POST("live/mic/apply/clear")
    suspend fun clearApplyMicList(@Body req: ClearApplyMicListReq): Rlt<Res<Any>>

    @POST("live/room/update")
    suspend fun updateRoomInfo(@Body req: UpdateRoomInfoReq): Rlt<Res<Any>>

    @POST("live/mic/invite/send")
    suspend fun inviteOnMic(@Body req: InviteMicReq): Rlt<Res<Any>>

    @POST("live/viewer/list")
    suspend fun getRoomMembers(@Body req: GetRoomMemberReq): Rlt<Res<GetRoomMemberRes>>

    @POST("live/viewer/category")
    suspend fun getRoomPlaymateCategory(@Body req: RoomPlaymateCategoryReq): Rlt<Res<RoomPlaymateCategoryRes>>

    @POST("live/mic/apply/category")
    suspend fun getApplyMicPlaymateCategory(@Body req: ApplyMicPlaymateCategoryReq): Rlt<Res<ApplyMicPlaymateCategoryRes>>

    @POST("live/room/unavailable")
    suspend fun reportRoomUnavailable(@Body req: ReportRoomAvailableReq): Rlt<Res<Any>>
}