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.

41 lines
1.1 KiB
TypeScript

/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2025-03-07 14:57:20
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2025-03-13 14:34:44
* @FilePath: \5G-Loading-Bay-Web\mock\deviceStatus.ts
* @Description: 设备状态
*/
import { MockMethod } from "vite-plugin-mock";
import { deviceStatusListData, deviceHistoryListData } from "./pools/deviceStatusData";
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from "./utils/apiMock";
export default [
{
url: "/api/v1/device/device/",
method: "post",
response: req => {
const { page, pageSize } = req.body;
// console.log(req);
return {
...fetchCurrPageByList({
...deviceStatusListData,
data: {
...deviceStatusListData.data,
page,
pageSize: pageSize || 10
}
})
};
}
},
{
url: "/api/v1/device/device_history/",
method: "post",
response: req => {
const { page, pageSize } = req.body;
// console.log(req);
return {...fetchMockSuccessFullByOther(deviceHistoryListData)}
}
}
] as MockMethod[];