import request from '@/utils/request'

// 查询专家列表
export function getExpertList(query) {
  return request({
    url: '/system/plat/expert/page',
    method: 'get',
    params: query
  })
}
// 新增专家
export function addExpert(data) {
  return request({
    url: '/system/plat/expert',
    method: 'post',
    data: data
  })
}

export function addExpertAccount(data) {
  return request({
    url: '/system/plat/expert/addAccount',
    method: 'put',
    data
  })
}
// 编辑专家
export function editExpert(data) {
  return request({
    url: '/system/plat/expert',
    method: 'put',
    data: data
  })
}
// 专家详情
export function getExpertDetails(id) {
  return request({
    url: `/system/plat/expert/${id}`,
    method: 'get'
  })
}

// 删除专家
export function deleteExpert(id, ids) {
  return request({
    url: `/system/plat/expert/abandon/${id}?userId=${ids}`,
    method: 'put'
  })
}

// 账号管理
export function accountManger(data) {
  return request({
    url: `/system/plat/expert/resetPwd`,
    method: 'put',
    data: data
  })
}
// 切换状态
export function changeStatus(data) {
  return request({
    url: `/system/plat/expert/changeStatus`,
    method: 'put',
    data: data
  })
}
