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(params) {
  return request({
    url: `/train/trainStudentList`,
    method: 'get',
    params,
  })
}



// 人才库+教师
// 新增人才
export function listTalent(params) {
  return request({
    url: '/talent/admin/list',
    method: 'get',
    params
  })
}
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',
  })
}

// 添加备注
export function addRemarkI(data) {
  return request({
    url: '/train/addRemark',
    method: 'post',
    data,
  })
}
// 删除报名人
export function delSign(id) {
  return request({
    url: '/train/trainStuden/del?studentId=' + id,
    method: 'delete',
  })
}

// 师资班配置json
export function setJson(data) {
  return request({
    url: '/train/trainClass/editData',
    method: 'post',
    data,
  })
}
// 导出excel
export function exportExcelF(id) {
  return request({
    url: '/train/importStudent/' + id,
    method: 'get',
    responseType: 'blob',
  })
}


// 获取所有轮播图
export function getSwiperInfo() {
  return request({
    url: '/train/admin/banner/list',
    method: 'get',
  })
}

// 提交轮播图
export function addSwiperInfo(data) {
  return request({
    url: 'train/admin/banner/add',
    method: 'post',
    data
  })
}

// 获取轮播图班级类型
export function getSwiperClass() {
  return request({
    url: '/train/admin/bannerTrainClasses',
    method: 'get',
  })
}

// 删除轮播图
export function delteSwiper(id) {
  console.log(id);
  return request({
    url: '/train/admin/banner/' + id,
    method: 'delete',
  })
}

// 获取所有班级
export function getClassList() {
  return request({
    url: '/train/admin/trainClasses',
    method: 'get',
  })
}
// 获取所有课程
export function getCourseList(params) {
  return request({
    url: '/course/admin/findAll',
    method: 'get',
    params
  })
}

// 增加课程
export function addCourseItem(data) {
  return request({
    url: '/course/admin/add',
    method: 'post',
    data:JSON.stringify(data)
  })
}

// 修改课程
export function putCourseItem(data) {
  return request({
    url: '/course/admin/update',
    method: 'post',
    data
  })
}

// 删除课程
export function delCourse(id) {
  return request({
    url: '/course/admin/' + id,
    method: 'delete',
  })
}

// 根据课程ID获取改课程下所有签到用户信息
export function getSigninInfo(id) {
  return request({
    url: '/course/admin/singin/' + id,
    method: 'get',
  })
}
// 删除签到信息
export function delSigninItem(id) {
  return request({
    url: '/course/admin/singin/' + id,
    method: 'delete',
  })
}
// 考勤删除
export function delAttendance(id) {
  return request({
    url: '/course/admin/singin/class/' + id,
    method: 'delete',
  })
}
// 获取考勤信息表
export function getAttendanceList(id) {
  return request({
    url: '/course/admin/singin/class/' + id,
    method: 'get',
  })
}

// 导出考勤表
export function exportAttendance(id) {
  return request({
    url: '/course/admin/importSignIn/class/' + id,
    method: 'get',
    responseType: 'blob'
  })
}
// 导出所有签到信息
export function exportSignIn(id) {
  return request({
    url: '/course/admin/importSignIn/course/' + id,
    method: 'get',
    responseType: 'blob'
  })
}