import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ScoreListVO, ScoreListForm, ScoreListQuery } from '@/api/ygpassport/scoreList/types';

/**
 * 查询学生成绩信息列列表
 * @param query
 * @returns {*}
 */

export const listScoreList = (query?: ScoreListQuery): AxiosPromise<ScoreListVO[]> => {
  return request({
    url: '/ygpassport/scoreList/listNew',
    method: 'get',
    params: query
  });
};

/**
 * 查询学生成绩信息列详细
 * @param id
 */
export const getScoreList = (id: string | number): AxiosPromise<ScoreListVO> => {
  return request({
    url: '/ygpassport/scoreList/' + id,
    method: 'get'
  });
};

/**
 * 新增学生成绩信息列
 * @param data
 */
export const addScoreList = (data: ScoreListForm) => {
  return request({
    url: '/ygpassport/scoreList',
    method: 'post',
    data: data
  });
};

/**
 * 修改学生成绩信息列
 * @param data
 */
export const updateScoreList = (data: ScoreListForm) => {
  return request({
    url: '/ygpassport/scoreList',
    method: 'put',
    data: data
  });
};

/**
 * 删除学生成绩信息列
 * @param id
 */
export const delScoreList = (id: string | number | Array<string | number>) => {
  return request({
    url: '/ygpassport/scoreList/' + id,
    method: 'delete'
  });
};
