修复接口问题

pull/229/head
Administrator 2025-10-13 08:19:30 +08:00
parent dea99acd78
commit 312004000f
2 changed files with 23 additions and 16 deletions

View File

@ -191,11 +191,18 @@ export function getDeviceMessagePairPage(params: PageParam) {
} }
/** 发送设备消息 */ /** 发送设备消息 */
export function sendDeviceMessage(params: IotDeviceApi.DeviceMessageSendReq) { export function sendDeviceMessage(data: IotDeviceApi.DeviceMessageSendReq) {
return requestClient.post('/iot/device/message/send', params); return requestClient.post('/iot/device/message/send', data);
} }
// Export aliases for compatibility /** 查询设备日志分页 */
export function getDeviceLogPage(params: PageParam) {
return requestClient.get<PageResult<any>>('/iot/device/log/page', {
params,
});
}
// Export object with all functions for backward compatibility
export const DeviceApi = { export const DeviceApi = {
getDevicePage, getDevicePage,
getDevice, getDevice,
@ -215,10 +222,11 @@ export const DeviceApi = {
getDeviceMessagePage, getDeviceMessagePage,
getDeviceMessagePairPage, getDeviceMessagePairPage,
sendDeviceMessage, sendDeviceMessage,
getDeviceLogPage,
}; };
export type DeviceVO = IotDeviceApi.Device; // Re-export types for backward compatibility (use with: import type { ... } from ...)
export type IotDeviceAuthInfoVO = IotDeviceApi.DeviceAuthInfo; export type {
export type IotDevicePropertyDetailRespVO = IotDeviceApi.DevicePropertyDetail; IotDeviceApi as DeviceApiTypes,
export type IotDevicePropertyRespVO = IotDeviceApi.DeviceProperty; };

View File

@ -56,7 +56,7 @@ export interface ThingModelData {
identifier?: string; identifier?: string;
name?: string; name?: string;
desc?: string; desc?: string;
type?: string; type?: number;
dataType?: string; dataType?: string;
property?: ThingModelProperty; property?: ThingModelProperty;
event?: ThingModelEvent; event?: ThingModelEvent;
@ -175,14 +175,13 @@ export function deleteThingModelList(ids: number[]) {
}); });
} }
/** 导入物模型 TSL */ /** 获取物模型 TSL */
export function importThingModelTSL(productId: number, tslData: any) { export function getThingModelTSL(productId: number) {
return requestClient.post('/iot/thing-model/import-tsl', { return requestClient.get<ThingModelApi.ThingModel[]>(
productId, '/iot/thing-model/get-tsl',
tslData, { params: { productId } },
}); );
} }
/** 导出物模型 TSL */ /** 导出物模型 TSL */
export function exportThingModelTSL(productId: number) { export function exportThingModelTSL(productId: number) {
return requestClient.get<any>('/iot/thing-model/export-tsl', { return requestClient.get<any>('/iot/thing-model/export-tsl', {
@ -201,6 +200,6 @@ export const ThingModelApi = {
updateThingModel, updateThingModel,
deleteThingModel, deleteThingModel,
deleteThingModelList, deleteThingModelList,
importThingModelTSL, getThingModelTSL,
exportThingModelTSL, exportThingModelTSL,
}; };