更新分享
This commit is contained in:
@@ -8,7 +8,7 @@ class BleDeviceData {
|
||||
final int flag; // 设备属性
|
||||
final int version; // 软件版本
|
||||
final int qsn; // 广播帧序列号高16位
|
||||
bool? bind = true; // 设备状态
|
||||
bool? bind = false; // 设备状态
|
||||
String? name; //设备名称
|
||||
int? rssi;
|
||||
String? mac; //mac地址
|
||||
|
||||
16
lib/model/WebSocketMessage.dart
Normal file
16
lib/model/WebSocketMessage.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'WebSocketMessage.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class WebSocketMessage {
|
||||
String path;
|
||||
int? type;
|
||||
dynamic data;
|
||||
|
||||
WebSocketMessage({required this.path, this.type, this.data});
|
||||
|
||||
static WebSocketMessage fromJson(Map<String, dynamic> json) =>
|
||||
_$WebSocketMessageFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$WebSocketMessageToJson(this);
|
||||
}
|
||||
21
lib/model/WebSocketMessage.g.dart
Normal file
21
lib/model/WebSocketMessage.g.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'WebSocketMessage.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
WebSocketMessage _$WebSocketMessageFromJson(Map<String, dynamic> json) =>
|
||||
WebSocketMessage(
|
||||
path: json['path'] as String,
|
||||
type: (json['type'] as num?)?.toInt(),
|
||||
data: json['data'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$WebSocketMessageToJson(WebSocketMessage instance) =>
|
||||
<String, dynamic>{
|
||||
'path': instance.path,
|
||||
'type': instance.type,
|
||||
'data': instance.data,
|
||||
};
|
||||
@@ -1,17 +1,17 @@
|
||||
|
||||
|
||||
class ApiResponse<T> {
|
||||
int? code;
|
||||
T? data;
|
||||
String? msg;
|
||||
int? total;
|
||||
|
||||
ApiResponse({required this.code, this.data, this.msg});
|
||||
ApiResponse({required this.code, this.data, this.msg, this.total});
|
||||
factory ApiResponse.fromJson(
|
||||
Map<String, dynamic> json, T Function(Object?) fromJsonT) {
|
||||
return ApiResponse<T>(
|
||||
code: json['code'] as int,
|
||||
data: json['data'] != null ? fromJsonT(json['data']) : null,
|
||||
msg: json['msg'] as String?,
|
||||
total: json['total'] as int?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,16 @@ part 'user_data.g.dart';
|
||||
class UserModel {
|
||||
String? uid;
|
||||
String? userName;
|
||||
String? nickName;
|
||||
String? tel;
|
||||
String? nick_name;
|
||||
String? phone;
|
||||
String? exp1;
|
||||
String? head;
|
||||
String? avatar;
|
||||
String? tmpHead;
|
||||
String? tmpNickName;
|
||||
int? deleted;
|
||||
String? status;
|
||||
int? created_at;
|
||||
String? email;
|
||||
|
||||
UserModel();
|
||||
static UserModel fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -9,20 +9,28 @@ part of 'user_data.dart';
|
||||
UserModel _$UserModelFromJson(Map<String, dynamic> json) => UserModel()
|
||||
..uid = json['uid'] as String?
|
||||
..userName = json['userName'] as String?
|
||||
..nickName = json['nickName'] as String?
|
||||
..tel = json['tel'] as String?
|
||||
..nick_name = json['nick_name'] as String?
|
||||
..phone = json['phone'] as String?
|
||||
..exp1 = json['exp1'] as String?
|
||||
..head = json['head'] as String?
|
||||
..avatar = json['avatar'] as String?
|
||||
..tmpHead = json['tmpHead'] as String?
|
||||
..tmpNickName = json['tmpNickName'] as String?;
|
||||
..tmpNickName = json['tmpNickName'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..status = json['status'] as String?
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..email = json['email'] as String?;
|
||||
|
||||
Map<String, dynamic> _$UserModelToJson(UserModel instance) => <String, dynamic>{
|
||||
'uid': instance.uid,
|
||||
'userName': instance.userName,
|
||||
'nickName': instance.nickName,
|
||||
'tel': instance.tel,
|
||||
'nick_name': instance.nick_name,
|
||||
'phone': instance.phone,
|
||||
'exp1': instance.exp1,
|
||||
'head': instance.head,
|
||||
'avatar': instance.avatar,
|
||||
'tmpHead': instance.tmpHead,
|
||||
'tmpNickName': instance.tmpNickName,
|
||||
'deleted': instance.deleted,
|
||||
'status': instance.status,
|
||||
'created_at': instance.created_at,
|
||||
'email': instance.email,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user