import service from '@/utils/request'
const api = {
  // 课程api
  getCourseList : data => {
    return service({
      url: '/sys-course',
      method: 'get',
      params:data
    })
  },
  getCourse : data => { // 获取课程详情
    return service({
      url: '/sys-course/'+data.id,
      method: 'get'
    })
  },
  addCourse : data => { // 添加课程
    return service({
      url: '/sys-course',
      method: 'post',
      data
    })
  },
  editCourse : data => { // 编辑课程
    return service({
      url: '/sys-course',
      method: 'put',
      data
    })
  },
  delCourse : data => { // 删除课程
    return service({
      url: '/sys-course',
      method: 'delete',
      data
    })
  },
  // 课程分类api
  getSubjectList : data => {
    return service({
      url: '/sys-course-category',
      method: 'get',
      params:data
    })
  },
  addSubject : data => {
    return service({
      url: '/sys-course-category',
      method: 'post',
      data
    })
  },
  editSubject : data => {
    return service({
      url: '/sys-course-category/'+data.id,
      method: 'put',
      data
    })
  },
  delSubject : data => {
    return service({
      url: '/sys-course-category',
      method: 'delete',
      data
    })
  },
  // 章节api
  getChapter:data => {
    return service({
      url: '/sys-course-ware/'+data.id,
      method: 'get'
    })
  },
  addChapter : data => {
    return service({
      url: '/sys-course-ware',
      method: 'post',
      data
    })
  },
  editChapter : data => {
    return service({
      url: '/sys-course-ware/update',
      method: 'put',
      data
    })
  },
  delChapter : data => {
    return service({
      url: '/sys-course-ware',
      method: 'delete',
      data
    })
  },
  verifyCourse : data => { // 审核课程
    return service({
      url: '/sys-course/verify',
      method: 'post',
      data
    })
  },
  getTeacherCourseList: data => { // 教师课程列表
    return service({
      url: '/sys-course/teacher/'+data.teacherId,
      method: 'get',
      params:data
    })
  },
}
export default api
