import { requestClient, fullUrl } from '#/api/request';

/**
 * 获取直播间列表
 */
async function getLiveRoomList() {
  return requestClient.post('/auth/LiveService/getLiveRoomList');
}

/**
 * 根据ID获取直播间信息
 * @param param 查询参数，包含roomId
 */
async function getLiveRoomById(param) {
  return requestClient.post('/auth/LiveService/getLiveRoomById', param);
}

/**
 * 根据名称获取直播间信息
 * @param param 查询参数，包含roomName
 */
async function getLiveRoomByName(param) {
  return requestClient.post('/auth/LiveService/getLiveRoomByName', param);
}

/**
 * 重置直播间缓存
 */
async function resetCache() {
  return requestClient.post('/auth/LiveService/resetCache');
}

/**
 * 清除指定直播间缓存
 * @param param 查询参数，包含roomId
 */
async function clearLiveRoomCache(param) {
  return requestClient.post('/auth/LiveService/clearLiveRoomCache', param);
}

export const liveService = {
  getLiveRoomList,
  getLiveRoomById,
  getLiveRoomByName,
  resetCache,
  clearLiveRoomCache
}