package com.ym.mec.biz.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ym.mec.biz.dal.dto.ImLiveBroadcastRoomDto;
import com.ym.mec.biz.dal.dto.RoomReservationUserSearch;
import com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom;
import com.ym.mec.biz.dal.page.LiveRoomGoodsOrderQueryInfo;
import com.ym.mec.biz.dal.vo.BaseRoomUserVo;
import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
import com.ym.mec.biz.dal.vo.RoomReservationUserVo;
import com.ym.mec.biz.dal.vo.LiveRoomGoodsOrderVo;
import com.ym.mec.common.entity.ImUserState;
import com.ym.mec.common.page.PageInfo;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 直播房间管理表(ImLiveBroadcastRoom)表服务接口
 *
 * @author hgw
 * @since 2022-02-17 20:52:05
 */
public interface ImLiveBroadcastRoomService extends IService<ImLiveBroadcastRoom> {

    PageInfo<ImLiveBroadcastRoomVo> queryPage(Map<String, Object> param);

    ImLiveBroadcastRoomVo queryRoomAndCheck(String roomUid, Integer userId, Integer osType);

    ImLiveBroadcastRoomVo queryRoomInfo(String roomUid);

    void add(ImLiveBroadcastRoomDto dto);

    void update(ImLiveBroadcastRoomDto dto);

    void whetherChat(Integer id, Integer whetherChat);

    /**
     * 关闭房间-融云
     * 获取所有直播间缓存数据并写入数据库后并清理缓存
     *
     * @param roomUid 直播间Uid
     */
    void roomDestroy(String roomUid);

    void roomDestroy(Integer id);

    void delete(Integer id);

    /**
     * 推广直播间-每个机构只能有一个直播间在首页推广
     *
     * @param id         直播间id
     * @param popularize 是否在首页推广 0否 1是
     */
    void opsPopularize(Integer id, Integer popularize);

    /**
     * 查询该机构目前推广的直播间
     */
    ImLiveBroadcastRoomVo queryPopularizeRoom();

    void destroyExpiredLiveRoom();

    void syncLike(String roomUid, Integer likeNum);

    void opsRoom(List<ImUserState> userState);

    ImLiveBroadcastRoomVo speakerJoinRoom(String roomUid, String os);

    void joinRoom(String roomUid, Integer userId);

    void startLive(String roomUid, Integer userId,String videoResolution);

    void closeLive(String roomUid, Integer userId);

    void createLiveRoom();

    Map<String, Object> test(String roomUid,String userFlag);

    /**
     * @param roomUid 直播间uid
     * @author zx
     * @since 2022/2/23 16:17
     * 分享直播链接
     */
    void shareGroup(String roomUid, String groupIds);

    List<BaseRoomUserVo> queryRoomOnlineUserInfo(String roomUid);

    List<BaseRoomUserVo> queryRoomLimitOnlineUserInfo(String roomUid);

    /**
     * 根据传入的用户id查询用户信息
     *
     * @param userIdList 用户id集合
     */
    List<BaseRoomUserVo> queryBaseUserInfo(List<Integer> userIdList);

    /**
     * 获取直播间预约用户信息
     *
     * @param query
     * @return
     */
    PageInfo<RoomReservationUserVo> queryRoomUser(RoomReservationUserSearch query);

    /**
     * 导出直播间预约用户信息
     *
     * @param query
     * @param response
     */
    void exportReservationRoomUser(RoomReservationUserSearch query, HttpServletResponse response) throws IOException;

    //查询直播间商品订单列表
    PageInfo<LiveRoomGoodsOrderVo> queryLiveRoomGoodsOrderList(LiveRoomGoodsOrderQueryInfo queryInfo);
}

