import request from '@/utils/request'

// 分页查询回传账号列表
export function pageCallbackAccount(query) {
  return request({
    url: '/adv/callback-account/page',
    method: 'get',
    params: query
  })
}

// 根据ID查询回传账号详情
export function getCallbackAccount(id) {
  return request({
    url: '/adv/callback-account/' + id,
    method: 'get'
  })
}

// 创建回传账号
export function addCallbackAccount(data) {
  return request({
    url: '/adv/callback-account',
    method: 'post',
    data: data
  })
}

// 更新回传账号
export function updateCallbackAccount(id, data) {
  return request({
    url: '/adv/callback-account/' + id,
    method: 'put',
    data: data
  })
}

// 删除回传账号
export function delCallbackAccount(id) {
  return request({
    url: '/adv/callback-account/' + id,
    method: 'delete'
  })
}

// 批量删除回传账号
export function batchDelCallbackAccount(ids) {
  return request({
    url: '/adv/callback-account/batch',
    method: 'delete',
    data: ids
  })
}

// 查询事件类型
export function queryEventType(advertiserId) {
  return request({
    url: '/adv/callback-account/queryEventType/' + advertiserId,
    method: 'post'
  })
}

// 保存转换事件
export function saveEventType(id, data) {
  return request({
    url: '/adv/callback-account/saveEventType/' + id,
    method: 'post',
    data: data
  })
}