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

/**
 * 分页查询社团列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/stuassociation/page',
    method: 'get',
    params: query
  });
};

/**
 * 新增社团
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/stuassociation',
    method: 'post',
    data
  });
};

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

/**
 * 编辑社团
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/stuassociation/edit',
    method: 'post',
    data
  });
};

/**
 * 删除社团
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/stuassociation',
    method: 'delete',
    data: ids
  });
};

/**
 * 社团统计 - 根据学院统计社团数量
 */
export const getAssociationStats = () => {
  return request({
    url: '/stuwork/stuassociation/stats',
    method: 'get'
  });
};

