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.

48 lines
1.6 KiB
TypeScript

/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-25 16:53:15
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-01-25 17:40:01
* @FilePath: \general-ai-platform-web\mock\deviceCategory.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**设备组模块 mock */
import {
mockGetDeviceGroupFkSelectData,
mockGetDeviceGroupListData,
mockGetDeviceGroupTreeData,
} from './pools/deviceGroupData';
import { successMockApiProps } from './typing';
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from './utils/apiMock';
export default {
// 设备组列表分页
'POST /api/v1/device_group/getDeviceGroupList': async (req: Request, res: Response) => {
const { page, pageSize } = req.body;
const resData: successMockApiProps = {
...fetchCurrPageByList({
...mockGetDeviceGroupListData,
data: { ...mockGetDeviceGroupListData.data, page, pageSize: pageSize || 10 },
}),
};
res.send(resData);
},
// 设备组网点选项列表
'POST /api/v1/device_group/getDeviceGroupFkSelect': async (req: Request, res: Response) => {
const resData: successMockApiProps = {
...fetchMockSuccessFullByOther(mockGetDeviceGroupFkSelectData),
};
res.send(resData);
},
// 设备组网点树列表
'POST /api/v1/device_group/getDeviceGroupTree': async (req: Request, res: Response) => {
const resData: successMockApiProps = {
...fetchMockSuccessFullByOther(mockGetDeviceGroupTreeData),
};
res.send(resData);
},
};