package com.ym.service;

import com.ym.mec.biz.dal.dto.RongyunBasicUserDto;
import com.ym.pojo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by super_zou on 2019/11/28.
 */
public interface RoomService {
    //everyone
    RoomResult joinRoom(String roomId) throws Exception;

    Integer getCurrentCourseId(String roomId);

    //only host
    Boolean downgrade(String roomId, List<ReqChangeUserRoleData.ChangedUser> users) throws Exception;

    Boolean kickMember(String roomId) throws Exception;

    void joinRoomSuccess(String roomId,String userId,String deviceNum) throws Exception;

    void leaveRoomSuccess(String roomId,String userId,String deviceNum) throws Exception;

    //only teacher
    Boolean display(String roomId, int type, String uri, String userId) throws Exception;

    String createWhiteBoard(String roomId) throws Exception;

    Boolean deleteWhiteboard(String roomId, String whiteBoardId) throws Exception;

    List<RoomResult.WhiteboardResult> getWhiteboard(String roomId) throws Exception;

    Boolean turnWhiteBoardPage(String roomId, String whiteBoardId, int page) throws Exception;

    Boolean controlDevice(String roomId, String userId, DeviceTypeEnum type, boolean enable) throws Exception;

    Boolean batchControlDevice(ReqDeviceControlData data) throws Exception;

    Boolean approveControlDevice(String roomId, String ticket) throws Exception;

    Boolean rejectControlDevice(String roomId, String ticket) throws Exception;


    List<RoomResult.MemberResult> getMembers(String roomId) throws  Exception;

    Boolean applySpeech(String roomId) throws  Exception;

    Boolean approveSpeech(String roomId, String requestId) throws  Exception;

    Boolean rejectSpeech(String roomId, String requestId) throws  Exception;

    Boolean transfer(String roomId, String userId) throws Exception;

    Boolean inviteUpgradeRole(String roomId, String userId, int role) throws  Exception;
    Boolean approveUpgradeRole(String roomId, String ticket) throws Exception;
    Boolean rejectUpgradeRole(String roomId, String ticket) throws Exception;

    Boolean syncDeviceState(String roomId, DeviceTypeEnum type, boolean enable) throws Exception;

    Boolean changeRole(String roomId, String userId, int role) throws Exception;

    void destroyRoom(String roomId);
    Boolean memberOnlineStatus(List<ReqMemberOnlineStatus> statusList, String nonce, String timestamp, String signature) throws Exception;
    void userIMOfflineKick(String userId);

    /**
     * 发送节拍器消息
     * @param playMidiMessageData
     */
    void sendImPlayMidiMessage(PlayMidiMessageData playMidiMessageData) throws Exception;

    /**
     * 获取未进入教室的学员列表
     * @return
     */
    List<RongyunBasicUserDto> queryNoJoinStu(String roomId);

    /**
     * 推送学员开始下载伴奏的通知
     * @author zouxuan
     * @param roomId
     * @param examSongId
     */
    void pushDownloadExamSongMsg(String roomId, Integer examSongId) throws Exception;

    /**
     * 修改学员伴奏下载状态
     * @author zouxuan
     * @param roomId
     * @param status
     */
    void adjustExamSong(String roomId,Integer status,Integer examSongId) throws Exception;

    /**
     * 移动端用户加入房间失败
     * @author zouxuan
     * @param roomId
     * @param userId
     */
    void joinRoomFailure(String roomId, String userId);
}
