import request from '@/utils/request'

// 查询直播列表
export function listLive(query) {
  return request({
    url: '/live/live/list',
    method: 'get',
    params: query
  })
}

// 查询直播详细
export function getLive(liveId) {
  return request({
    url: '/live/live/' + liveId,
    method: 'get'
  })
}

// 新增直播
export function addLive(data) {
  return request({
    url: '/live/live',
    method: 'post',
    data: data
  })
}

// 修改直播
export function updateLive(data) {
  return request({
    url: '/live/live',
    method: 'put',
    data: data
  })
}

// 删除直播
export function delLive(liveId) {
  return request({
    url: '/live/live/' + liveId,
    method: 'delete'
  })
}

// 导出直播
export function exportLive(query) {
  return request({
    url: '/live/live/export',
    method: 'get',
    params: query
  })
}
// 查询未结束的直播间
export function listToLiveNoEnd(query) {
  return request({
    url: '/live/live/listToLiveNoEnd',
    method: 'get',
    params: query
  })
}

// 查询直播间分组列表
export function listLiveGroupType(query) {
  return request({
    url: '/live/liveGroupType/list',
    method: 'get',
    params: query
  })
}

export function selectLiveToStudent(query) {
  return request({
    url: '/live/live/selectLiveToStudent?pageNum=' + query.pageNum + '&pageSize=' + query.pageSize,
    method: 'post',
    data: query
  })
}

export function selectCompanyTalent(query) {
  return request({
    url: '/company/user/selectCompanyTalent/' + query,
    method: 'get'
  })
}

export function getLivingUrl(liveId) {
  return request({
    url: '/live/live/living/' + liveId,
    method: 'get'
  })
}

export function verifyIdInfo(data) {
  return request({
    url: '/live/live/verifyIdInfo',
    method: 'post',
    data: data
  })
}
//上下架视频
export function handleShelfOrUn(data) {
  return request({
    url: '/live/live/handleShelfOrUn',
    method: 'post',
    data: data
  })
}


export function handleDeleteSelected(data) {
  return request({
    url: '/live/live/handleDeleteSelected',
    method: 'post',
    data: data
  })
}

// 结束录播直播间
export function finishLive(data) {
  return request({
    url: '/live/live/finishLive',
    method: 'get',
    params: data
  })
}
// 复制录播直播间
export function copyLive(data) {
  return request({
    url: '/live/live/copyLive',
    method: 'get',
    params: data
  })
}

// 结束录播直播间
export function startLive(data) {
  return request({
    url: '/live/live/startLive',
    method: 'get',
    params: data
  })
}
// 生成直播间小程序二维码
export function generateCode(data) {
  return request({
    url: '/live/live/getWxaCodeUnLimit',
    method: 'get',
    params: data
  })
}

export function createAppLink(data) {
    return request({
        url: '/live/live/createAppLink',
        method: 'get',
        params: data
    })
}

export function getAppAllList() {
    return request({
        url: '/live/live/getAppAllList',
        method: 'get'
    })
}
