import request from '/@/utils/request';

/**
 * 获取学生评优评先列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/rewardstudent/getList',
    method: 'get',
    params: query
  });
};

/**
 * 导出学生评优评先
 * @param query
 */
export const exportExcel = (query?: any) => {
  return request({
    url: '/stuwork/rewardstudent/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  });
};

/**
 * 更新学生评优奖项
 * @param data
 */
export const updateStuAward = (data: any) => {
  return request({
    url: '/stuwork/rewardstudent/updateStuAward',
    method: 'post',
    data
  });
};

/**
 * 查询学生评优记录
 * @param stuNo 学号
 * @param schoolYear 学年
 * @param schoolTerm 学期
 */
export const getStuRewardList = (stuNo: string, schoolYear: string, schoolTerm: string) => {
  return request({
    url: '/stuwork/rewardstudent/getStuRewardList',
    method: 'get',
    params: { stuNo, schoolYear, schoolTerm }
  });
};

/**
 * 获取奖项规则列表
 */
export const getRewardRuleList = () => {
  return request({
    url: '/stuwork/rewardrule/getRewardRule',
    method: 'get'
  });
};

