import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ActivityQuery, ActivityVO, ActivityForm } from './types';

export function listActivity(query: ActivityQuery): AxiosPromise<ActivityVO[]> {
  return request({ url: '/edu/activity/list', method: 'get', params: query });
}

export function getActivity(id: number | string): AxiosPromise<ActivityVO> {
  return request({ url: '/edu/activity/' + id, method: 'get' });
}

export function addActivity(data: ActivityForm) {
  return request({ url: '/edu/activity', method: 'post', data });
}

export function updateActivity(data: ActivityForm) {
  return request({ url: '/edu/activity', method: 'put', data });
}

export function delActivity(ids: string | number | (string | number)[]) {
  return request({ url: '/edu/activity/' + ids, method: 'delete' });
}
