分享设备用户列表
This commit is contained in:
@@ -3,12 +3,14 @@ import 'dart:ui';
|
||||
|
||||
import 'package:EasyDartModule/EasyDartModule.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
|
||||
import 'package:vbvs_app/controller/mh_controller/device.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
@@ -19,7 +21,7 @@ part 'device_list_controller.g.dart';
|
||||
class DeviceListModel {
|
||||
//设备列表
|
||||
List<dynamic> deviceList = [];
|
||||
List<dynamic>vitalList=[];
|
||||
List<dynamic> vitalList = [];
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
String? keyword;
|
||||
@@ -71,6 +73,7 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
|
||||
}
|
||||
return ApiResponse(code: -1, msg: "未知错误".tr); // Default return statement
|
||||
}
|
||||
|
||||
//体征传感器
|
||||
getVitalList(String mac) async {
|
||||
try {
|
||||
@@ -133,4 +136,27 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
|
||||
);
|
||||
return msg;
|
||||
}
|
||||
|
||||
unbindShareDevice(String id, String mac, BuildContext context) async {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.device_bind;
|
||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||
String msg = '';
|
||||
|
||||
await requestWithLog(
|
||||
logTitle: '解绑设备',
|
||||
method: MyHttpMethod.delete,
|
||||
queryUrl: queryUrl,
|
||||
data: {"mac": mac, "uid": id},
|
||||
onSuccess: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: res.msg!, textColor: Color(0XFF00C1AA));
|
||||
},
|
||||
onFailure: (err) {
|
||||
TopSlideNotification.show(context,
|
||||
text: err.msg!, textColor: Color(0xFFFF7159));
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ class MHDeviceShareModel {
|
||||
// {"type": 2}
|
||||
// ];
|
||||
List<dynamic>? shareUser = [];
|
||||
Map mainShare = {};
|
||||
|
||||
MHDeviceShareModel();
|
||||
static MHDeviceShareModel fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -17,8 +17,7 @@ MHDeviceShareModel _$MHDeviceShareModelFromJson(Map<String, dynamic> json) =>
|
||||
..offset = (json['offset'] as num).toInt()
|
||||
..isLoading = json['isLoading'] as bool
|
||||
..hasMore = json['hasMore'] as bool
|
||||
..shareUser = json['shareUser'] as List<dynamic>?
|
||||
..mainShare = json['mainShare'] as Map<String, dynamic>;
|
||||
..shareUser = json['shareUser'] as List<dynamic>?;
|
||||
|
||||
Map<String, dynamic> _$MHDeviceShareModelToJson(MHDeviceShareModel instance) =>
|
||||
<String, dynamic>{
|
||||
@@ -32,5 +31,4 @@ Map<String, dynamic> _$MHDeviceShareModelToJson(MHDeviceShareModel instance) =>
|
||||
'isLoading': instance.isLoading,
|
||||
'hasMore': instance.hasMore,
|
||||
'shareUser': instance.shareUser,
|
||||
'mainShare': instance.mainShare,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user