import { get, post } from '@/utils/request';

// 获取活动列表
export const getActivityList = () =>
  get('/api/app/activity/list');

// 获取邀请活动配置
export const getInviteConfig = () =>
  get('/api/app/activity/invite/config');

// 获取我的邀请统计
export const getInviteStats = () =>
  get('/api/app/activity/invite/stats');

// 绑定邀请关系
export const bindInvitation = (inviteCode: string) =>
  post('/api/app/activity/invite/bind', { inviteCode });

// 邀请记录列表
export const getInviteRecords = (params?: { page?: number; pageSize?: number }) =>
  get('/api/app/activity/invite/records', params);

// 返现记录列表
export const getCashbackRecords = (params?: { page?: number; pageSize?: number }) =>
  get('/api/app/activity/invite/cashbacks', params);

// 申请提现
export const createInviteWithdrawal = (amount: number) =>
  post('/api/app/activity/invite/withdraw', { amount });

// 提现记录列表
export const getInviteWithdrawals = (params?: { page?: number; pageSize?: number }) =>
  get('/api/app/activity/invite/withdrawals', params);
