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

/**
 * 分页查询评优评先奖项列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/rewardrule/page',
    method: 'get',
    params: query
  });
};

/**
 * 获取评优评先奖项列表（不分页）
 * @param query
 */
export const getList = (query?: any) => {
  return request({
    url: '/stuwork/rewardrule/list',
    method: 'get',
    params: query
  });
};

/**
 * 新增评优评先奖项
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/rewardrule',
    method: 'post',
    data
  });
};

/**
 * 获取详情
 * @param id
 */
export const getDetail = (id: string) => {
  return request({
    url: '/stuwork/rewardrule/detail',
    method: 'get',
    params: { id }
  });
};

/**
 * 编辑评优评先奖项
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/rewardrule/edit',
    method: 'post',
    data
  });
};

/**
 * 删除评优评先奖项
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/rewardrule/delete',
    method: 'post',
    data: ids
  });
};

