1
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
This commit is contained in:
78
apps/web-antd/src/api/admin/booking.ts
Normal file
78
apps/web-antd/src/api/admin/booking.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BookingApi {
|
||||
/** 预订列表查询参数 */
|
||||
export interface ListParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
classroom_id?: number;
|
||||
booking_date?: string;
|
||||
status?: number;
|
||||
student_id?: number;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
/** 预订信息 */
|
||||
export interface BookingInfo {
|
||||
id?: number;
|
||||
booking_no?: string | null;
|
||||
classroom_id?: number;
|
||||
seat_number?: string;
|
||||
user_id?: number | null;
|
||||
user_name?: string | null;
|
||||
booking_date?: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
purpose?: string | null;
|
||||
status?: number;
|
||||
remark?: string | null;
|
||||
create_time?: string;
|
||||
update_time?: string;
|
||||
seat_row_index?: number;
|
||||
seat_col_index?: number;
|
||||
student_id?: number;
|
||||
classroom_name?: string;
|
||||
time_range?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 同意座位变更申请参数 */
|
||||
export interface ApproveParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 拒绝座位变更申请参数 */
|
||||
export interface RejectParams {
|
||||
id: number;
|
||||
reason: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预订列表
|
||||
* GET /api/admin/booking/list
|
||||
*/
|
||||
export async function getBookingListApi(params?: BookingApi.ListParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/booking/list', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 同意座位变更申请
|
||||
* POST /api/admin/booking/approve
|
||||
*/
|
||||
export async function approveBookingApi(data: BookingApi.ApproveParams) {
|
||||
return requestClient.post('/api/admin/booking/approve', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拒绝座位变更申请
|
||||
* POST /api/admin/booking/reject
|
||||
*/
|
||||
export async function rejectBookingApi(data: BookingApi.RejectParams) {
|
||||
return requestClient.post('/api/admin/booking/reject', data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user