import request from '@/utils/request'

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

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

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

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

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

// 导出课程
export function exportUserCourse(query) {
  return request({
    url: '/course/userCourse/publicExport',
    method: 'get',
    params: query
  })
}

export function getAllCourse() {
  return request({
    url: '/course/userCourse/getAllList',
    method: 'get'
  })
}


export function updateIsShow(data) {
  return request({
    url: '/course/userCourse/publicUpdateIsShow',
    method: 'post',
    data: data
  })
}

export function putOn(courseIds) {
  return request({
    url: '/course/userCourse/publicPutOn/' + courseIds,
    method: 'post'
  })
}
export function pullOff(courseIds) {
  return request({
    url: '/course/userCourse/publicPutOff/' + courseIds,
    method: 'post'
  })
}
