43 lines
886 B
JavaScript
43 lines
886 B
JavaScript
const http = uni.$u.http;
|
|
|
|
// 指令编码
|
|
export function encode(params) {
|
|
return http.get('/iot/message/encode', {
|
|
params: params
|
|
});
|
|
}
|
|
|
|
// 指令解码
|
|
export function decode(params) {
|
|
return http.get('/iot/message/decode', {
|
|
params: params
|
|
});
|
|
}
|
|
|
|
// 平台下发指令
|
|
export function messagePost(data) {
|
|
return http.post('/iot/message/post', data);
|
|
}
|
|
|
|
// 查询设备指令偏好设置列表
|
|
export function preferencesList(params) {
|
|
return http.get('/iot/preferences/list', {
|
|
params: params
|
|
});
|
|
}
|
|
|
|
// 新增设备指令偏好设置
|
|
export function addPreferences(data) {
|
|
return http.post('/iot/preferences', data);
|
|
}
|
|
|
|
// 修改设备指令偏好设置
|
|
export function editPreferences(data) {
|
|
return http.put('/iot/preferences', data);
|
|
}
|
|
|
|
// 删除设备指令偏好设置
|
|
export function delPreferences(data) {
|
|
return http.delete('/iot/preferences/' + data.id);
|
|
}
|