import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ScoreQuery, ScoreVO, ScoreForm } from './types';

export function listScore(query: ScoreQuery): AxiosPromise<ScoreVO[]> {
  return request({ url: '/edu/score/list', method: 'get', params: query });
}

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

export function addScore(data: ScoreForm) {
  return request({ url: '/edu/score', method: 'post', data });
}

export function updateScore(data: ScoreForm) {
  return request({ url: '/edu/score', method: 'put', data });
}

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