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

/**
 * 分页查询德育论文和案例列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/classpaper/page',
    method: 'get',
    params: query
  });
};

/**
 * 新增德育论文和案例
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/classpaper',
    method: 'post',
    data
  });
};

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

/**
 * 编辑德育论文和案例
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/classpaper/edit',
    method: 'post',
    data
  });
};

/**
 * 删除德育论文和案例
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/classpaper/delete',
    method: 'post',
    data: ids
  });
};

/**
 * 班主任考核加分
 * @param data
 */
export const addScore = (data: any) => {
  return request({
    url: '/stuwork/classpaper/addScore',
    method: 'post',
    data
  });
};

/**
 * 生成班级论文上传统计
 * @param data
 */
export const generateSummary = (data: any) => {
  return request({
    url: '/stuwork/classpaper/generateSummary',
    method: 'get',
    params: data
  });
};

/**
 * 初始化班级论文数据
 * @param data
 */
export const initClassPaper = (data: any) => {
  return request({
    url: '/stuwork/classpaper/init',
    method: 'post',
    data
  });
};

/**
 * 查询班级论文统计列表
 * @param data
 */
export const getSummaryList = (data: any) => {
  return request({
    url: '/stuwork/classpaper/summaryList',
    method: 'get',
    params: data
  });
};
