import request from '@/utils/request'

// 查询达人列表
export function listUserTalent(query) {
  return request({
    url: '/course/userTalent/list',
    method: 'get',
    params: query
  })
}

// 查询达人详细
export function getUserTalent(talentId) {
  return request({
    url: '/course/userTalent/' + talentId,
    method: 'get'
  })
}

// 新增达人
export function addUserTalent(data) {
  return request({
    url: '/course/userTalent',
    method: 'post',
    data: data
  })
}

// 修改达人
export function updateUserTalent(data) {
  return request({
    url: '/course/userTalent',
    method: 'put',
    data: data
  })
}

export function auditUserTalent(data) {
  return request({
    url: '/course/userTalent/audit',
    method: 'put',
    data: data
  })
}

// 删除达人
export function delUserTalent(talentId) {
  return request({
    url: '/course/userTalent/' + talentId,
    method: 'delete'
  })
}

// 导出达人
export function exportUserTalent(query) {
  return request({
    url: '/course/userTalent/export',
    method: 'get',
    params: query
  })
}

export function listBySearch(query) {
  return request({
    url: '/course/userTalent/listBySearch',
    method: 'get',
    params: query
  })
}

//查询所属销售公司
export function getCompanies(keyword) {
  return request({
    url: '/course/userTalent/listCompanyByKeyword/'+keyword,
    method: 'get'
  })
}
