import request from '@/utils/request'

export function getSchoolList(query) {
    return request({
      url: '/train/schoolList',
      method: 'get',
      params: query,
      // headers: {
      //   isToken: false
      // },
    })
}

export function addSchool(data) {
    return request({
      url: '/train/school/add',
      method: 'post',
      data,

    })
}
export function updateSchool(data) {
    return request({
      url: '/train/school/update',
      method: 'post',
      data,
      
 
    })
}

export function delSchool(id) {
    return request({
      url: `/train/school/del/?schoolId=${id}`,
      method: 'delete',

    })
}


export function getSignUpList(query) {
    return request({
      url: `/train/trainClassList`,
      method: 'get',
      params: query,

    })
}
export function addSignUp(data) {
    return request({
      url: '/train/trainClass/add',
      method: 'post',
      data,

    })
}
export function updateSignUp(data) {
    return request({
      url: '/train/trainClass/update',
      method: 'post',
      data,


    })
}

export function delSignUp(id) {
    return request({
      url: `/train/trainClass/del?trainClassId=${id}`,
      method: 'delete',

    })
}

// 查询已报名列表
export function searchNum(id, query) {
    return request({
      url: `/train/trainStudentList?trainClassId=${id}`,
      method: 'get',
      params: query,
      
    })
}



// 人才库+教师
// 新增人才
export function listTalent() {
  return request({
    url: '/talent/admin/list',
    method: 'get',

  })
}
export function addTalent(data) {
  return request({
    url: '/talent/admin/add',
    method: 'post',
    data,

  })
}
// 修改人才
export function updateTalent(data) {
  return request({
    url: '/talent/admin/update',
    method: 'post',
    data,

  })
}

// 删除人才-删除教师
export function deleteTalent(id) {
  return request({
    url: '/talent/admin/' + id,
    method: 'delete',

  })
}

// 查看人才-教师详情
export function detailTalent(id) {
  return request({
    url: '/talent/admin/' + id,
    method: 'get',

  })
}

export function listTeacher() {
  return request({
    url: '/talent/admin/teacherList',
    method: 'get',

  })
}
// 新增教师
export function addTeacher(data) {
  return request({
    url: '/talent/admin/teacher/add',
    method: 'post',
    data,

  })
}
// 修改教师
export function updateTeacher(data) {
  return request({
    url: '/talent/admin/teacher/update',
    method: 'post',
    data,

  })
}

// 下载模板
export function importTemplate() {
  return request({
    url: '/talent/admin/download',
    method: 'get',
    responseType: 'blob',

  })
}

// 查询所有教师
export function listTeacherAll() {
  return request({
    url: '/talent/findAllTeacher',
    method: 'get',
  })
}