import request from '@/utils/request'

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


// select
export function select(query) {
  return request({
    url: '/api/sc/course/list/select',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getCourse(courseId) {
  return request({
    url: '/api/sc/course/info/detailById/' + courseId,
    method: 'get'
  })
}

// 新增
export function addCourse(data) {
  return request({
    url: '/api/sc/course/add/addScCourse',
    method: 'post',
    data: data
  })
}

// 修改
export function updateCourse(data) {
  return request({
    url: '/api/sc/course/update/updateScCourse',
    method: 'put',
    data: data
  })
}

// 删除
export function delCourse(courseId) {
  return request({
    url: '/api/sc/course/delete/deleteById/' + courseId,
    method: 'delete'
  })
}



// 是否开售
export function changeCourseSale(courseId, sale) {
  return request({
    url: '/api/sc/course/update/changeCourseSale',
    method: 'put',
    data: {
      courseId,
      sale
    }
  })
}


