package com.daya.live_teaching.api;

import com.cooleshow.base.data.net.BaseResponse;
import com.daya.live_teaching.model.ClassMember;
import com.daya.live_teaching.model.FileUploadBean;
import com.daya.live_teaching.model.LoginResult;
import com.daya.live_teaching.model.Result;

import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

public interface LiveTeachingApi {
    /**
     * 签到
     * @return
     */
    @FormUrlEncoded
    @POST(LiveTeachingUrls.SIGN_IN)
    Call<Result<String>> signIn(@Field("roomId") String roomId);

    /**
     * 签到
     * @return
     */
    @POST(LiveTeachingUrls.QUERY_NO_JOIN_STU)
    Call<Result<List<ClassMember>>> queryNoJoinStu(@Body RequestBody body);

    /**
     * 开关节拍器
     * @return
     */
    @POST(LiveTeachingUrls.SEND_IMPLAY_MIDI_MESSAGE)
    Call<Result<Boolean>> sendImPlayMidiMessage(@Body RequestBody body);

    /**
     * 登录
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.LOGIN)
    Call<Result<LoginResult>> login(@Body RequestBody body);


    /**
     * 退出房间
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.ROOM_LEAVE)
    Call<Result<Boolean>> leave(@Body RequestBody body);


    /**
     * 踢人
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.KICK_OFF)
    Call<Result<Boolean>> kickOff(@Body RequestBody body);

    /**
     * 控制设备
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.DEVICE_CONTROL)
    Call<Result<Boolean>> deviceControl(@Body RequestBody body);

    /**
     * 控制全员设备
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.DEVICE_BATCH_CONTROL)
    Call<Result<Boolean>> deviceBatchControl(@Body RequestBody body);

    /**
     * 同意开启设备
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.DEVICE_APPROVE)
    Call<Result<Boolean>> deviceApprove(@Body RequestBody body);

    /**
     * 拒绝开启设备
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.DEVICE_REJECT)
    Call<Result<Boolean>> deviceReject(@Body RequestBody body);


    /**
     * 同步设备状态
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.DEVICE_SYNC)
    Call<Result<Boolean>> deviceSync(@Body RequestBody body);


    /**
     * 降级
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.DOWNGRADE)
    Call<Result<Boolean>> downgrade(@Body RequestBody body);

    /**
     * 申请发言
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.SPEECH_APPLY)
    Call<Result<Boolean>> applySpeech(@Body RequestBody body);


    /**
     * 同意发言
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.SPEECH_APPROVE)
    Call<Result<Boolean>> applyApprove(@Body RequestBody body);


    /**
     * 拒绝发言
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.SPEECH_REJECT)
    Call<Result<Boolean>> applyReject(@Body RequestBody body);


    /**
     * 转移角色
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.TRANSFER_ROLE)
    Call<Result<Boolean>> transferRole(@Body RequestBody body);


    /**
     * 要求升级
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.UPGRADE_INVITE)
    Call<Result<Boolean>> upgradeInvite(@Body RequestBody body);


    /**
     * 接受升级
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.UPGRADE_APPROVE)
    Call<Result<Boolean>> upgradeApprove(@Body RequestBody body);


    /**
     * 拒绝升级
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.UPGRADE_REJECT)
    Call<Result<Boolean>> upgradeReject(@Body RequestBody body);


    /**
     * 设置角色， 设置为老师
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.CHANGE_ROLE)
    Call<Result<Boolean>> changeRole(@Body RequestBody body);


    /**
     * 创建白板
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.WHITE_BOARD_CREATE)
    Call<Result<String>> createWhiteBoard(@Body RequestBody body);


    /**
     * 删除白板
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.WHITE_BOARD_DELETE)
    Call<Result<Boolean>> deleteWhiteBoard(@Body RequestBody body);


    /**
     * 切换共享画布区内容显示Id
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.SWITCH_DISPLAY)
    Call<Result<Boolean>> switchDisplay(@Body RequestBody body);

    /**
     * 通知学生下载伴奏
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.PUSH_DOWNLOAD_EXAM_SONG_MSG)
    Call<Result<Boolean>> pushDownloadexamSongMsg(@Body RequestBody body);

    /**
     * 学员伴奏下载回执
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.ADJUST_EXAM_SONG)
    Call<Result<Boolean>> adjustExamSong(@Body RequestBody body);

    /**
     * 同步房间状态
     * @param body
     * @return
     */
    @POST(LiveTeachingUrls.JOIN_ROOM_STATUS_NOTIFY)
    Call<Result<Boolean>> joinRoomStatusNotify(@Body RequestBody body);


    /**
     * 文件上传
     * @param file
     * @return
     */
    @Multipart
    @POST("api-teacher/uploadFile")
    Call<BaseResponse<FileUploadBean>> uploadFile(@Part MultipartBody.Part file);

    /**
     * 文件下载
     * @return
     */
    @Streaming
    @GET
    @Headers({"User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4)"})
    Call<ResponseBody> downloadFileWithFixedUrl(@Url String url);
}
