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

/**
 * 分页查询班级建设方案列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/classconstruction/page',
    method: 'get',
    params: query
  });
};

/**
 * 初始化班级建设方案
 * @param data
 */
export const initObj = (data?: any) => {
  return request({
    url: '/stuwork/classconstruction',
    method: 'post',
    data
  });
};

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

/**
 * 编辑班级建设方案（新增和修改都用这个接口）
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/classconstruction/edit',
    method: 'post',
    data
  });
};

/**
 * 新增班级建设方案（使用编辑接口）
 * @param data
 */
export const addObj = (data: any) => {
  return editObj(data);
};

/**
 * 删除班级建设方案
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/classconstruction/delete',
    method: 'post',
    data: ids
  });
};
