import request from '@/utils/request'

// 查询课程列表
export function listCourse(query) {
  return request({
    url: '/hezhi/course/list',
    method: 'get',
    params: query
  })
}

// 查询课程详细
export function getCourse(courseId) {
  return request({
    url: '/hezhi/course/' + courseId,
    method: 'get'
  })
}

// 新增课程
export function addCourse(data) {
  return request({
    url: '/hezhi/course',
    method: 'post',
    data: data
  })
}

// 修改课程
export function updateCourse(data) {
  return request({
    url: '/hezhi/course',
    method: 'put',
    data: data
  })
}

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

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