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 selectLiveToStudent(query) {
  return request({
    url: '/live/live/selectLiveToStudent',
    method: 'post',
    data: query
  })
}

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

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

export function updateLiveIsAudit(data) {
  return request({
    url: '/live/live/updateLiveIsAudit' ,
    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 verifyIdInfo(data) {
  return request({
    url: '/live/live/verifyIdInfo',
    method: 'post',
    data: data
  })
}

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

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

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

// 查询公司list
export function getCompanyDropList() {
  return request({
    url: '/live/live/getCompanyDropList',
    method: 'get'
  })
}

// 根据公司查询主体list
export function getQwCorpList(companyId) {
  return request({
    url: '/live/live/getQwCorpList/' + companyId,
    method: 'get'
  })
}
// 根据主体条件查询标签信息
export function getTagsListByCorpId(qwTagGroup) {
  return request({
    url: '/live/live/getTagsListByCorpId',
    method: 'get',
    params:qwTagGroup
  })
}

// 清除直播间缓存
export function clearLiveCache(liveId) {
  return request({
    url: '/live/live/clearCache/' + liveId,
    method: 'post'
  })
}
