import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SchoolQuery, SchoolVO, SchoolForm } from './types';

export function listSchool(query: SchoolQuery): AxiosPromise<SchoolVO[]> {
  return request({ url: '/edu/school/list', method: 'get', params: query });
}

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

export function addSchool(data: SchoolForm) {
  return request({ url: '/edu/school', method: 'post', data });
}

export function updateSchool(data: SchoolForm) {
  return request({ url: '/edu/school', method: 'put', data });
}

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