import request from '@/utils/request'

/**
 * 同步转化归因数据
 * @param {Number} orgAccountId 组织账户ID
 * @param {Number} accountId 广告账户ID
 */
export function syncConversions(orgAccountId, accountId) {
  return request({
    url: '/api/gdt/conversion/sync',
    method: 'post',
    params: { orgAccountId, accountId }
  })
}

/**
 * 查询转化归因列表（分页）
 * @param {Number} page 页码
 * @param {Number} pageSize 每页数量
 */
export function getConversionList(page = 1, pageSize = 20) {
  return request({
    url: '/api/gdt/conversion/list',
    method: 'get',
    params: { page, pageSize }
  })
}

/**
 * 查询转化详情
 * @param {Number} conversionId 转化ID
 */
export function getConversionDetail(conversionId) {
  return request({
    url: '/api/gdt/conversion/detail',
    method: 'get',
    params: { conversionId }
  })
}

export function getConversions() {
  return request({
    url: '/api/gdt/conversion/all',
    method: 'get'
  })
}
