import http from '@/http/api.js'

/**
 * 获取部门列表
 * @param {*} params
 * @returns
 */
export const deptList = params => {
	return http.request({
		url: '/api/blade-system/dept/list-page',
		method: 'GET',
		params: {
			...params
		},
	});
};

/**
 * 获取事项列表
 * @param {*} params
 * @returns
 */
export const itemList = params => {
	return http.request({
		url: '/api/blade-biz/item/list',
		method: 'GET',
		params: {
			...params
		},
	});
};

/**
 * 预约须知
 * @param {*} params
 * @returns
 */
export const noticeData = params => {
	return http.request({
		url: '/api/blade-noticeinfo/noticeInfo/list',
		method: 'GET',
		params: {
			...params
		},
	});
};

/**
 * 获取可用日历
 * @param {*} params
 * @returns
 */
export const availableDate = params => {
	return http.request({
		url: '/api/blade-bookingdate/bookingDate/available-week-dates',
		method: 'GET',
		params: {
			...params
		},
	});
};

/**
 * 查询用户信息
 * @param {*} params
 * @returns
 */
export const getUserInfo = params => {
	return http.request({
		url: '/api/blade-system/user/info',
		method: 'GET',
		params: {
			...params
		},
	});
};

/**
 * 提交预约
 * @param {*} params
 * @returns
 */
export const submit = params => {
	return http.request({
		url: '/api/blade-biz/booking/submit-booking',
		method: 'POST',
		data: {
			...params
		},
	});
};

/**
 * 查询我的预约
 * @param {*} params
 * @returns
 */
export const myReserve = params => {
	return http.request({
		url: '/api/blade-biz/booking/list',
		method: 'GET',
		params: {
			...params
		},
	});
};

/**
 * 取消预约
 * @param {*} params
 * @returns
 */
export const cancel = params => {
	return http.request({
		url: '/api/blade-biz/booking/cancel',
		method: 'POST',
		params: {
			...params
		},
	});
};

/**
 * 获取详情
 * @param {*} params
 * @returns
 */
export const getDetail = params => {
	return http.request({
		url: '/api/blade-biz/booking/detail',
		method: 'GET',
		params: {
			...params
		},
	});
};

/**
 * 获取是否无感取号成功
 * @param {*} params
 * @returns
 */
export const getIsSuccessTicket = params => {
	return http.request({
		url: '/api/blade-onlineticket/onlineTicket/getByYyNo',
		method: 'GET',
		params: {
			...params
		},
	});
};