You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB
TypeScript

/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-25 15:45:17
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-10 17:13:12
* @FilePath: \general-ai-platform-web\mock\device.ts
* @Description: mock设备数据
*/
import { mockGetAllDeviceList, mockGetDeviceListByGroup } from './pools/deviceData';
import { successMockApiProps } from './typing';
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from './utils/apiMock';
export default {
// 设备列表
'GET /api/device/listByGroup': async (req: Request, res: Response) => {
const { page, pageSize } = req.query;
const resData: successMockApiProps = {
...fetchCurrPageByList({
...mockGetDeviceListByGroup,
data: { ...mockGetDeviceListByGroup.data, page, pageSize: pageSize || 10 },
}),
};
res.json(resData);
},
// // 设备分类
'GET /api/device/allDevice': async (req: Request, res: Response) => {
const resData: successMockApiProps = {
...fetchMockSuccessFullByOther(mockGetAllDeviceList),
};
res.json(resData);
},
};