import request from '@/utils/request'

// 查询广告信息列表
export function listAdvertisement(query) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.market.marketAdvertisementInfo',
      _mt: 'list',
      ...query
    }
  })
}

// 查询广告信息详细
export function getAdvertisement(id) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.market.marketAdvertisementInfo',
      _mt: 'get',
      id: id
    }
  })
}

// 新增广告信息
export function addAdvertisement(data) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.market.marketAdvertisementInfo',
      _mt: 'add',
      marketAdvertisementInfo: data
    }
  })
}

// 修改广告信息
export function updateAdvertisement(data) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.market.marketAdvertisementInfo',
      _mt: 'update',
      marketAdvertisementInfo: data
    }
  })
}

// 删除广告信息
export function delAdvertisement(id) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.market.marketAdvertisementInfo',
      _mt: 'delete',
      id: id
    }
  })
}

// 导出广告信息
export function exportAdvertisement(query) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.market.marketAdvertisementInfo',
      _mt: 'export',
      ...query
    }
  })
}
