/**
 * 营销活动管理 API
 */
import { get, post, put, del } from '@/utils/request';

export interface ActivityQueryParams { page?: number; pageSize?: number; activityName?: string; activityType?: number; status?: number; }
export interface ActivityListResponse { list: any[]; total: number; pageSize: number; currentPage: number; }

export function getActivityList(params: ActivityQueryParams): Promise<ActivityListResponse> { return get('/marketing/activity/list', params); }
export function getActivityById(id: number): Promise<any> { return get('/marketing/activity/' + id); }
export function createActivity(data: any): Promise<any> { return post('/marketing/activity', data); }
export function updateActivity(id: number, data: any): Promise<any> { return put('/marketing/activity/' + id, data); }
export function publishActivity(id: number): Promise<any> { return put('/marketing/activity/' + id + '/publish'); }
export function pauseActivity(id: number): Promise<any> { return put('/marketing/activity/' + id + '/pause'); }
export function resumeActivity(id: number): Promise<any> { return put('/marketing/activity/' + id + '/resume'); }
export function deleteActivity(id: number): Promise<any> { return del('/marketing/activity/' + id); }
export function getActivityStatistics(id: number): Promise<any> { return get('/marketing/activity/' + id + '/statistics'); }
export function getOngoingActivities(): Promise<any[]> { return get('/marketing/activity/ongoing'); }
