import api from '@/utils/request';

export const getPage = params =>
	api.post(`/yxl-back-end/admin/kindergarten/page`, params);
export const getCount = params =>
	api.post(`/yxl-back-end/admin/kindergarten/count`, params);
export const getList = params =>
	api.post(`/yxl-back-end/admin/kindergarten/list`, params);
export const getItem = ({ id, ...params }) =>
	api.get(`/yxl-back-end/admin/kindergarten/${id}`, params);
export const saveItem = ({ id, ...params }) => {
	if (id) {
		return api.put(`/yxl-back-end/admin/kindergarten/${id}`, params);
	} else {
		return api.post(`/yxl-back-end/admin/kindergarten`, params);
	}
};
export const delItem = ({ id, ...params }) =>
	api.del(`/yxl-back-end/admin/kindergarten/${id}`, params);
export const auditItem = ({ id, ...params }) =>
	api.put(`/yxl-back-end/admin/kindergarten/${id}/audit`, params);

export const sendCode = ({ id, ...params }) =>
	api.put(`/yxl-back-end/admin/kindergarten/${id}/send-qrcode`, params);
