From 312004000fe987a8db8847589a80fe614c4019c3 Mon Sep 17 00:00:00 2001 From: Administrator <425053404@qq.com> Date: Mon, 13 Oct 2025 08:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/iot/device/device/index.ts | 22 +++++++++++++------ apps/web-antd/src/api/iot/thingmodel/index.ts | 17 +++++++------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/apps/web-antd/src/api/iot/device/device/index.ts b/apps/web-antd/src/api/iot/device/device/index.ts index 26770f975..3a87726c7 100644 --- a/apps/web-antd/src/api/iot/device/device/index.ts +++ b/apps/web-antd/src/api/iot/device/device/index.ts @@ -191,11 +191,18 @@ export function getDeviceMessagePairPage(params: PageParam) { } /** 发送设备消息 */ -export function sendDeviceMessage(params: IotDeviceApi.DeviceMessageSendReq) { - return requestClient.post('/iot/device/message/send', params); +export function sendDeviceMessage(data: IotDeviceApi.DeviceMessageSendReq) { + return requestClient.post('/iot/device/message/send', data); } -// Export aliases for compatibility +/** 查询设备日志分页 */ +export function getDeviceLogPage(params: PageParam) { + return requestClient.get>('/iot/device/log/page', { + params, + }); +} + +// Export object with all functions for backward compatibility export const DeviceApi = { getDevicePage, getDevice, @@ -215,10 +222,11 @@ export const DeviceApi = { getDeviceMessagePage, getDeviceMessagePairPage, sendDeviceMessage, + getDeviceLogPage, }; -export type DeviceVO = IotDeviceApi.Device; -export type IotDeviceAuthInfoVO = IotDeviceApi.DeviceAuthInfo; -export type IotDevicePropertyDetailRespVO = IotDeviceApi.DevicePropertyDetail; -export type IotDevicePropertyRespVO = IotDeviceApi.DeviceProperty; +// Re-export types for backward compatibility (use with: import type { ... } from ...) +export type { + IotDeviceApi as DeviceApiTypes, +}; diff --git a/apps/web-antd/src/api/iot/thingmodel/index.ts b/apps/web-antd/src/api/iot/thingmodel/index.ts index eac8bea39..5884fa976 100644 --- a/apps/web-antd/src/api/iot/thingmodel/index.ts +++ b/apps/web-antd/src/api/iot/thingmodel/index.ts @@ -56,7 +56,7 @@ export interface ThingModelData { identifier?: string; name?: string; desc?: string; - type?: string; + type?: number; dataType?: string; property?: ThingModelProperty; event?: ThingModelEvent; @@ -175,14 +175,13 @@ export function deleteThingModelList(ids: number[]) { }); } -/** 导入物模型 TSL */ -export function importThingModelTSL(productId: number, tslData: any) { - return requestClient.post('/iot/thing-model/import-tsl', { - productId, - tslData, - }); +/** 获取物模型 TSL */ +export function getThingModelTSL(productId: number) { + return requestClient.get( + '/iot/thing-model/get-tsl', + { params: { productId } }, + ); } - /** 导出物模型 TSL */ export function exportThingModelTSL(productId: number) { return requestClient.get('/iot/thing-model/export-tsl', { @@ -201,6 +200,6 @@ export const ThingModelApi = { updateThingModel, deleteThingModel, deleteThingModelList, - importThingModelTSL, + getThingModelTSL, exportThingModelTSL, };