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

/**
 * 分页查询主题班会课教案列表（实际上查询的是上传记录）
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/classthemerecord/page',
    method: 'get',
    params: query
  });
};

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

/**
 * 删除主题班会课教案
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/classtheme/delete',
    method: 'post',
    data: ids
  });
};

/**
 * 初始化班级主题班会
 * @param data
 */
export const initObj = (data: any) => {
  return request({
    url: '/stuwork/classthemerecord',
    method: 'post',
    data
  });
};

/**
 * 分页查询主题班会上传记录
 * @param query
 */
export const fetchRecordList = (query?: any) => {
  return request({
    url: '/stuwork/classthemerecord/page',
    method: 'get',
    params: query
  });
};

/**
 * 新增主题班会（上传记录）
 * @param data
 */
export const addRecord = (data: any) => {
  return request({
    url: '/stuwork/classtheme',
    method: 'post',
    data
  });
};

/**
 * 编辑主题班会（上传记录）
 * @param data
 */
export const editRecord = (data: any) => {
  return request({
    url: '/stuwork/classtheme/edit',
    method: 'post',
    data
  });
};

/**
 * 获取主题班会详情
 * @param id
 */
export const getRecordDetail = (id: string) => {
  return request({
    url: '/stuwork/classtheme/detail',
    method: 'get',
    params: { id }
  });
};

/**
 * 删除主题班会（上传记录）
 * @param ids
 */
export const delRecord = (ids: string[]) => {
  return request({
    url: '/stuwork/classtheme/delete',
    method: 'post',
    data: ids
  });
};

