import request from '@/utils/request'

// 创建广告设置
export function createBanner(data) {
  return request({
    url: '/ecw/banner/create',
    method: 'post',
    data: data
  })
}

// 更新广告设置
export function updateBanner(data) {
  return request({
    url: '/ecw/banner/update',
    method: 'put',
    data: data
  })
}

// 删除广告设置
export function deleteBanner(id) {
  return request({
    url: '/ecw/banner/delete?id=' + id,
    method: 'delete'
  })
}

// 获得广告设置
export function getBanner(id) {
  return request({
    url: '/ecw/banner/get?id=' + id,
    method: 'get'
  })
}

// 获得广告设置分页
export function getBannerPage(query) {
  return request({
    url: '/ecw/banner/page',
    method: 'get',
    params: query
  })
}

// 导出广告设置 Excel
export function exportBannerExcel(query) {
  return request({
    url: '/ecw/banner/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
