【功能完善】IoT: 场景联动产品设备信息回显

This commit is contained in:
puhui999
2025-03-29 12:07:27 +08:00
parent 5fa9e4e855
commit 6b99fdb41f
4 changed files with 136 additions and 7 deletions

View File

@@ -165,5 +165,16 @@ export const DeviceApi = {
// 获取设备MQTT连接参数
getMqttConnectionParams: async (deviceId: number) => {
return await request.get({ url: `/iot/device/mqtt-connection-params`, params: { deviceId } })
},
// 根据ProductKey和DeviceNames获取设备列表
getDevicesByProductKeyAndNames: async (productKey: string, deviceNames: string[]) => {
return await request.get({
url: `/iot/device/get-by-product-key-and-names`,
params: {
productKey,
deviceNames: deviceNames.join(',')
}
})
}
}

View File

@@ -78,5 +78,10 @@ export const ProductApi = {
// 查询产品(精简)列表
getSimpleProductList() {
return request.get({ url: '/iot/product/simple-list' })
},
// 根据ProductKey获取产品信息
getProductByKey: async (productKey: string) => {
return await request.get({ url: `/iot/product/get-by-key`, params: { productKey } })
}
}