261024
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ThinkUserInAccess, ThinkUserInAccessParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询能刷脸开闸的用户列表
|
||||
*/
|
||||
export async function pageThinkUserInAccess(params: ThinkUserInAccessParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ThinkUserInAccess>>>(
|
||||
MODULES_API_URL + '/think/think-user-in-access/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询能刷脸开闸的用户列表列表
|
||||
*/
|
||||
export async function listThinkUserInAccess(params?: ThinkUserInAccessParam) {
|
||||
const res = await request.get<ApiResult<ThinkUserInAccess[]>>(
|
||||
MODULES_API_URL + '/think/think-user-in-access',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加能刷脸开闸的用户列表
|
||||
*/
|
||||
export async function addThinkUserInAccess(data: ThinkUserInAccess) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/think/think-user-in-access',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改能刷脸开闸的用户列表
|
||||
*/
|
||||
export async function updateThinkUserInAccess(data: ThinkUserInAccess) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/think/think-user-in-access',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除能刷脸开闸的用户列表
|
||||
*/
|
||||
export async function removeThinkUserInAccess(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/think/think-user-in-access/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除能刷脸开闸的用户列表
|
||||
*/
|
||||
export async function removeBatchThinkUserInAccess(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/think/think-user-in-access/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询能刷脸开闸的用户列表
|
||||
*/
|
||||
export async function getThinkUserInAccess(id: number) {
|
||||
const res = await request.get<ApiResult<ThinkUserInAccess>>(
|
||||
MODULES_API_URL + '/think/think-user-in-access/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 能刷脸开闸的用户列表
|
||||
*/
|
||||
export interface ThinkUserInAccess {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
uid?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 能刷脸开闸的用户列表搜索条件
|
||||
*/
|
||||
export interface ThinkUserInAccessParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user