package com.swago.baseswago.inter

import com.swago.baseswago.model.*
import com.swago.baseswago.model.mine.LevelModel
import com.swago.baseswago.model.mine.RoomBlackBean
import com.swago.baseswago.model.mine.RoomBlackModel
import com.swago.baseswago.model.mine.TaskModel
import okhttp3.MultipartBody
import retrofit2.http.*


/**
 *@date 2021/8/23 16:42
 *description:
 */
interface UserApi {

    //广场类表
    @POST("/v1/user/market/list")
    suspend fun getMomentList(): List<MomentModel>

    //个人信息
    @POST("/v1/user/info")
    suspend fun getUserInfo(): UserInfoModel

    //用户信息
    @FormUrlEncoded
    @POST("/v1/user/detail")
    suspend fun getOtherUserInfo(@Field("id") id: String): OtherUserInfoModel

    //修改用户信息
    @POST("/v1/user/modify")
    suspend fun modifyUserInfo(@Body body: UploadInfo): Any

    //关注和取消关注 follow_type 关注类型(0关注1取消关注)
    @FormUrlEncoded
    @POST("/v1/user/follow")
    suspend fun follow(
        @Field("user_follow_id") userId: String,
        @Field("follow_type") type: Int
    ): Any

    //关注和粉丝列表 list_type 类型(0关注列表1粉丝列表)
    @FormUrlEncoded
    @POST("/v1/user/follow/list")
    suspend fun getList(
        @Field("page") page: Int,
        @Field("list_type") type: Int,
        @Field("page_size") size: Int = 20
    ): BlackListModel

    //black_type 0添加1移除   user_black_id这个改成了传user_code
    @FormUrlEncoded
    @POST("/v1/user/add/black")
    suspend fun addToBlackList(
        @Field("user_black_id") id: String,
        @Field("black_type") type: Int
    ): Any

    @FormUrlEncoded
    @POST("/v1/user/black/list")
    suspend fun getBackList(
        @Field("page") page: Int,
        @Field("page_size") size: Int = 20
    ): BlackListModel

    @Multipart
    @POST("/v1/upload/file")
    suspend fun uploadPic(@Part file: MultipartBody.Part): PicModel

    @POST("/v1/user/out")
    suspend fun logout(): Any

    //任务列表接口 任务类型(1每日任务2新人任务)
    @FormUrlEncoded
    @POST("/v1/task/list")
    suspend fun getTaskList(@Field("task_type") task_type: Int): List<TaskModel>

    //任务完成领取奖励
    @FormUrlEncoded
    @POST("/v1/task/complete")
    suspend fun receiveTaskReward(@Field("id") id: String): Any

    //等级列表接口 等级类型(1财富等级2主播等级)
    @FormUrlEncoded
    @POST("/v1/user/level/rule/list")
    suspend fun getLevelList(@Field("level_type") level_type: Int): ArrayList<LevelModel>


    //举报   report_user_id这个改成了传user_code
    @FormUrlEncoded
    @POST("/v1/user/report")
    suspend fun reportUser(
        @Field("report_user_id") report_user_id: String,
        @Field("report_content") report_content: String
    ): Any

    //被拉黑的主播
    @FormUrlEncoded
    @POST("/v1/rtc/broadcast/black/user/list")
    suspend fun getAnchorBlackList(@Field("page") page: Int):RoomBlackModel


    //直播间黑名单
    @FormUrlEncoded
    @POST("/v1/rtc/broadcast/log/black/list")
    suspend fun getRoomBlackList(@Field("page") page: Int):RoomBlackBean

}