import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AdmissionQuery, AdmissionVO, AdmissionForm } from './types';

export function listAdmission(query: AdmissionQuery): AxiosPromise<AdmissionVO[]> {
  return request({ url: '/edu/admission/list', method: 'get', params: query });
}

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

export function addAdmission(data: AdmissionForm) {
  return request({ url: '/edu/admission', method: 'post', data });
}

export function updateAdmission(data: AdmissionForm) {
  return request({ url: '/edu/admission', method: 'put', data });
}

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