import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ApplicationQuery, ApplicationVO, ApplicationForm } from './types';

export function listApplication(query: ApplicationQuery): AxiosPromise<ApplicationVO[]> {
  return request({ url: '/edu/application/list', method: 'get', params: query });
}

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

export function addApplication(data: ApplicationForm) {
  return request({ url: '/edu/application', method: 'post', data });
}

export function updateApplication(data: ApplicationForm) {
  return request({ url: '/edu/application', method: 'put', data });
}

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