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

/**
 * 新增数据
 * @param param 新增参数
 */
async function addOne(param) {
  return requestClient.post('/auth/LiveRoomRelation/addOne', param);
}

/**
 * 批量新增数据
 * @param param 新增参数
 */
async function addBatch(param) {
  return requestClient.post('/auth/LiveRoomRelation/addBatch', param);
}

/**
 * 根据uid更新数据
 * @param param 更新参数，包含uuid字段
 */
async function updateByUid(param) {
  return requestClient.post('/auth/LiveRoomRelation/updateByUid/' + param.uuid, param);
}

/**
 * 根据uid删除数据
 * @param param 删除参数，包含uuid字段
 */
async function removeByUid(param) {
  return requestClient.post('/auth/LiveRoomRelation/removeByUid/' + param.uuid, param);
}

/**
 * 批量删除数据
 * @param param 批量删除参数，包含uids字段
 */
async function removeBatchByUid(param) {
  return requestClient.post('/auth/LiveRoomRelation/removeBatchByUid', param);
}

/**
 * 根据uid查询指定数据
 * @param param 查询参数，包含uuid字段
 */
async function getOneByUid(param) {
  return requestClient.post('/auth/LiveRoomRelation/getOneByUid/' + param.uuid, param);
}

/**
 * 分页查询数据
 * @param param 分页查询参数
 */
async function queryPage(param) {
  return requestClient.post('/auth/LiveRoomRelation/queryPage', param);
}

/**
 * 查询所有数据
 * @param param 查询参数
 */
async function queryList(param) {
  return requestClient.post('/auth/LiveRoomRelation/queryList', param);
}

/**
 * 查询总数
 * @param param 查询参数
 */
async function count(param) {
  return requestClient.post('/auth/LiveRoomRelation/count', param);
}

/**
 * 导出全部数据URL
 */
function exportAllUrl(param) {
  return fullUrl('/auth/LiveRoomRelation/export', param);
}

/**
 * 导出部分数据URL
 */
function exportPartUrl(param) {
  return fullUrl('/auth/LiveRoomRelation/export', param);
}

/**
 * 导出全部数据
 */
async function exportAll(param) {
  return requestClient.post('/auth/LiveRoomRelation/export', param);
}

/**
 * 导出部分数据
 */
async function exportPart(param) {
  return requestClient.post('/auth/LiveRoomRelation/exportPart', param);
}

export const liveRoomRelation = {
  addOne,
  addBatch,
  updateByUid,
  removeByUid,
  removeBatchByUid,
  getOneByUid,
  queryPage,
  queryList,
  count,
  exportAllUrl,
  exportPartUrl,
  exportAll,
  exportPart
}