import request from '@/utils/request'

// 查询员工信息列表
export function listTeacher(query) {
  return request({
    url: '/system/teacher/list',
    method: 'get',
    params: query
  })
}
export function teacherSelect(query) {
  return request({
    url: '/system/teacher/teacherSelect',
    method: 'get',
    params: query
  })
}
export function getUserForTeacher(query) {
  return request({
    url: '/system/teacher/getUserForTeacher',
    method: 'get',
    params: query
  })
}

// 查询员工信息详细
export function getTeacher(userId) {
  return request({
    url: '/system/teacher/' + userId,
    method: 'get'
  })
}

// 新增员工信息
export function addTeacher(data) {
  return request({
    url: '/system/teacher',
    method: 'post',
    data: data
  })
}

// 修改员工信息
export function updateTeacher(data) {
  return request({
    url: '/system/teacher',
    method: 'put',
    data: data
  })
}

// export function delTeacher(data) {
//   return request({
//     url: '/system/teacher/remove', // 后端接收批量删除的接口地址（需与后端一致）
//     method: 'post', // 改为POST方法
//     data: data // 请求体传递ids数组
//   });
// }
export function delTeacher(ids) {
  return request({
    url: '/system/teacher/remove',
    method: 'post',
    data: ids // 注意：这里直接传数组，不是{ids: ids}
  });
}
