mahjong_group/common/server/interface/sq.js
2025-09-12 21:00:34 +08:00

56 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from '@/common/system/request';
/**
* 获取预约记录
* @param {number} index
* @param {number} size
* @returns
*/
export const getReservationList = async (index = 1, size = 20) => {
console.log('getReservationList', index, size);
const res = await request.getOrCache("sq/GetReservationList", { pageIndex: index, pageSize: size }, 5);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取我的预约记录
* @param {number} type 0 参与者1发起者
* @param {number} index 起始页
* @param {number} size 页大小
* @returns {Promise<any>}
*/
export const getMyReservation = async (type = 0, index = 1, size = 10) => {
const res = await request.get("sq/GetMyReservation", {
type: type,
index: index,
size: size
});
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取正在进行的预约
* @returns {Promise<any>}
*/
export const getMyUseReservation = async () => {
const res = await request.get("sq/GetMyUseReservation");
if (res.code == 0) {
return res.data;
}
return null;
}
export const sqInterface = {
getReservationList,
getMyReservation,
getMyUseReservation
}