import request from '@/utils/request'

// 创建轮播图
export function createCarousel(data) {
  return request({
    url: '/system/carousel/create',
    method: 'post',
    data: data
  })
}

// 更新轮播图
export function updateCarousel(data) {
  return request({
    url: '/system/carousel/update',
    method: 'put',
    data: data
  })
}

// 删除轮播图
export function deleteCarousel(id) {
  return request({
    url: '/system/carousel/delete?id=' + id,
    method: 'delete'
  })
}

// 获得轮播图
export function getCarousel(id) {
  return request({
    url: '/system/carousel/get?id=' + id,
    method: 'get'
  })
}

// 获得轮播图分页
export function getCarouselPage(query) {
  return request({
    url: '/system/carousel/page',
    method: 'get',
    params: query
  })
}

// 导出轮播图 Excel
export function exportCarouselExcel(query) {
  return request({
    url: '/system/carousel/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
