This commit is contained in:
2025-01-08 09:44:25 +08:00
parent 06f6e29972
commit 4d21314fc6
60 changed files with 5477 additions and 4495 deletions
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ThinkMachineOpenLog, ThinkMachineOpenLogParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询闸机开门记录
*/
export async function pageThinkMachineOpenLog(params: ThinkMachineOpenLogParam) {
const res = await request.get<ApiResult<PageResult<ThinkMachineOpenLog>>>(
MODULES_API_URL + '/think/think-machine-open-log/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询闸机开门记录列表
*/
export async function listThinkMachineOpenLog(params?: ThinkMachineOpenLogParam) {
const res = await request.get<ApiResult<ThinkMachineOpenLog[]>>(
MODULES_API_URL + '/think/think-machine-open-log',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加闸机开门记录
*/
export async function addThinkMachineOpenLog(data: ThinkMachineOpenLog) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-machine-open-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改闸机开门记录
*/
export async function updateThinkMachineOpenLog(data: ThinkMachineOpenLog) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-machine-open-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除闸机开门记录
*/
export async function removeThinkMachineOpenLog(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-machine-open-log/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除闸机开门记录
*/
export async function removeBatchThinkMachineOpenLog(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/think/think-machine-open-log/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询闸机开门记录
*/
export async function getThinkMachineOpenLog(id: number) {
const res = await request.get<ApiResult<ThinkMachineOpenLog>>(
MODULES_API_URL + '/think/think-machine-open-log/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}