import request from '@/utils/request'

// 分页查询广告商列表
export function pageAdvertiser(query) {
  return request({
    url: '/adv/advertiser/page',
    method: 'get',
    params: query
  })
}

// 根据ID查询广告商详情
export function getAdvertiser(id) {
  return request({
    url: '/adv/advertiser/' + id,
    method: 'get'
  })
}

// 创建广告商
export function addAdvertiser(data) {
  return request({
    url: '/adv/advertiser',
    method: 'post',
    data: data
  })
}

// 更新广告商
export function updateAdvertiser(id, data) {
  return request({
    url: '/adv/advertiser/' + id,
    method: 'put',
    data: data
  })
}

// 删除广告商
export function delAdvertiser(id) {
  return request({
    url: '/adv/advertiser/' + id,
    method: 'delete'
  })
}

// 批量删除广告商
export function batchDelAdvertiser(ids) {
  return request({
    url: '/adv/advertiser/batch',
    method: 'delete',
    data: ids
  })
}

// 启用/停用广告商
export function enableAdvertiser(id) {
  return request({
    url: '/adv/advertiser/enable/' + id,
    method: 'post'
  })
}

