import request from '@/utils/request'

// 查询主播动态列表
export function listDynamic(query) {
  return request({
    url: '/cai/dynamic/list',
    method: 'get',
    params: query
  })
}

// 查询主播动态详细
export function getDynamic(id) {
  return request({
    url: '/cai/dynamic/' + id,
    method: 'get'
  })
}

// 新增主播动态
export function addDynamic(data) {
  return request({
    url: '/cai/dynamic',
    method: 'post',
    data: data
  })
}

// 修改主播动态
export function updateDynamic(data) {
  return request({
    url: '/cai/dynamic',
    method: 'put',
    data: data
  })
}
export function auditFailDynamic(data) {
  return request({
    url: '/cai/dynamic/audit/fail',
    method: 'put',
    data: data
  })
}

export function auditSuccessDynamic(data) {
  return request({
    url: '/cai/dynamic/audit/success',
    method: 'put',
    data: data
  })
}

export function batchAuditDynamic(data) {
  return request({
    url: '/cai/dynamic/batch/audit',
    method: 'post',
    data: data
  })
}


// 删除主播动态
export function delDynamic(id) {
  return request({
    url: '/cai/dynamic/' + id,
    method: 'delete'
  })
}

export function dynamicTop(id) {
  return request({
    url: '/cai/dynamic/top',
    method: 'post',
    data: {id:id}
  })
}

export function dynamicUnTop(id) {
  return request({
    url: '/cai/dynamic/unTop',
    method: 'post',
    data: {id:id}
  })
}

export function dynamicSelectTop() {
  return request({
    url: '/cai/dynamic/selectTop',
    method: 'get'
  })
}
