import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { RewardPunishQuery, RewardPunishVO, RewardPunishForm } from './types';

// 查询奖惩列表
export function listRewardPunish(query: RewardPunishQuery): AxiosPromise<RewardPunishVO[]> {
  return request({ url: '/edu/reward/list', method: 'get', params: query });
}

// 查询奖惩详情
export function getRewardPunish(id: number | string): AxiosPromise<RewardPunishVO> {
  return request({ url: '/edu/reward/' + id, method: 'get' });
}

// 新增奖惩
export function addRewardPunish(data: RewardPunishForm) {
  return request({ url: '/edu/reward', method: 'post', data });
}

// 修改奖惩
export function updateRewardPunish(data: RewardPunishForm) {
  return request({ url: '/edu/reward', method: 'put', data });
}

// 删除奖惩
export function delRewardPunish(ids: string | number | (string | number)[]) {
  return request({ url: '/edu/reward/' + ids, method: 'delete' });
}
