feat:太阳能网控设置,新增功能。
This commit is contained in:
38
src/api/iot/index.ts
Normal file
38
src/api/iot/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
export interface SolarPropertyCommand {
|
||||
id: string | number;
|
||||
properties: Record<string, any>;
|
||||
cache?: boolean;
|
||||
}
|
||||
|
||||
export interface SolarPropertyCommandResult {
|
||||
deviceId: string | number;
|
||||
serialNum: string;
|
||||
online: boolean;
|
||||
statusCode?: number;
|
||||
properties: Record<string, any>;
|
||||
mode: 'direct' | 'cached';
|
||||
cached: boolean;
|
||||
sent: boolean;
|
||||
}
|
||||
|
||||
export const getDeviceStatus = (devicetype: number, serialnum: string): AxiosPromise<number> => {
|
||||
return request({
|
||||
url: '/iot/device/status',
|
||||
method: 'get',
|
||||
params: {
|
||||
devicetype,
|
||||
serialnum
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const sendSolarPropertyCommand = (data: SolarPropertyCommand): AxiosPromise<SolarPropertyCommandResult> => {
|
||||
return request({
|
||||
url: '/iot/device/solar/property-command',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user