import baseAxios from '../index'
import { ActivityItem } from './type'
import { getVisitorId } from '@/utils/visitorId'

export async function queryActivityList(data: {
  limit: number
  offset: number
}) {
  const id = await getVisitorId()

  return baseAxios<{
    count: number
    items: ActivityItem[]
    total: number
  }>({
    url: '/activity/query/list',
    method: 'POST',
    data,
    headers: {
      'X-Signature': id,
    },
  })
}

export function queryActivityInfo(data: { uuid: string }) {
  return baseAxios({
    url: '/activity/query/info',
    method: 'GET',
    params: data,
  })
}
