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

/**
 * 获取列表
 * @param query
 */
export const fetchList = (query?: any) => {
	return request({
		url: '/recruit/recruitstudentschool/page',
		method: 'get',
		params: query,
	});
};

/**
 * 列表（按组ID）
 * @param query
 */
export const queryByGroupId = (query?: any) => {
	return request({
		url: '/recruit/recruitstudentschool/queryByGroupId',
		method: 'get',
		params: query,
	});
};

/**
 * 区域列表
 * @param query
 */
export const areaList = (query?: any) => {
	return request({
		url: '/recruit/recruitstudentschool/areaList',
		method: 'get',
		params: query,
	});
};

/**
 * 区域子列表
 * @param query
 */
export const areaSonList = (query?: any) => {
	return request({
		url: '/recruit/recruitstudentschool/areaSonList',
		method: 'get',
		params: query,
	});
};

/**
 * 新增
 * @param obj
 */
export const addObj = (obj: any) => {
	return request({
		url: '/recruit/recruitstudentschool/add',
		method: 'post',
		data: obj,
	});
};

/**
 * 获取详情
 * @param id
 */
export const getObj = (id: string | number) => {
	return request({
		url: `/recruit/recruitstudentschool/getById`,
		method: 'get',
		params:{id:id}
	});
};

/**
 * 删除
 * @param id
 */
export const delObj = (id: string | number) => {
	return request({
		url: `/recruit/recruitstudentschool/deleteByid`,
		method: 'post',
		data:{id:id}
	});
};

/**
 * 更新
 * @param obj
 */
export const putObj = (obj: any) => {
	return request({
		url: '/recruit/recruitstudentschool/edit',
		method: 'post',
		data: obj,
	});
};
