import { defAxios as request } from '@/utils/http'

/**
 * @description: 分页查询广告列表
 * @return {*}
 */
export function fetchAdList(params) {
  return request({
    url: '/ad/index',
    method: 'get',
    params
  })
}
/**
 * @description: 创建广告
 * @return {*}
 */
export function advertisingCreate(data) {
  return request({
    url: '/ad/add',
    method: 'post',
    data
  })
}

/**
 * @description: 更新广告信息
 * @return {*}
 */
export function advertisingUpdate(data) {
  return request({
    url: `/ad/edit`,
    method: 'put',
    data
  })
}

/**
 * @description: 删除广告
 * @return {*}
 */
export function advertisingDelete(ids) {
  return request({
    url: `/ad/delete/${ids}`,
    method: 'delete'
  })
}
