import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SalaryRecordQuery, SalaryRecordVO, SalaryRecordForm } from './types';

export function listSalaryRecord(query: SalaryRecordQuery): AxiosPromise<SalaryRecordVO[]> {
  return request({ url: '/edu/salary/list', method: 'get', params: query });
}

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

export function addSalaryRecord(data: SalaryRecordForm) {
  return request({ url: '/edu/salary', method: 'post', data });
}

export function updateSalaryRecord(data: SalaryRecordForm) {
  return request({ url: '/edu/salary', method: 'put', data });
}

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