123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- import 'package:fis_common/json_convert.dart';
- class DeviceInfo {
- String? deviceCode;
- String? serialNumber;
- String? description;
- String? deviceModel;
- String? deviceType;
- String? headPicUrl;
- String? deviceSoftwareVersion;
- String? sDKSoftwareVersion;
- String? organizationCode;
- String? shortCode;
- String? id;
- DateTime? createTime;
- DateTime? updateTime;
- bool isDelete;
- DeviceInfo({
- this.deviceCode,
- this.serialNumber,
- this.description,
- this.deviceModel,
- this.deviceType,
- this.headPicUrl,
- this.deviceSoftwareVersion,
- this.sDKSoftwareVersion,
- this.organizationCode,
- this.shortCode,
- this.id,
- this.createTime,
- this.updateTime,
- this.isDelete=false,
- });
- factory DeviceInfo.fromJson(Map<String, dynamic> map) {
- return DeviceInfo(
- deviceCode: map['DeviceCode'],
- serialNumber: map['SerialNumber'],
- description: map['Description'],
- deviceModel: map['DeviceModel'],
- deviceType: map['DeviceType'],
- headPicUrl: map['HeadPicUrl'],
- deviceSoftwareVersion: map['DeviceSoftwareVersion'],
- sDKSoftwareVersion: map['SDKSoftwareVersion'],
- organizationCode: map['OrganizationCode'],
- shortCode: map['ShortCode'],
- id: map['Id'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- isDelete: map['IsDelete'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- if(serialNumber != null)
- map['SerialNumber'] = serialNumber;
- if(description != null)
- map['Description'] = description;
- if(deviceModel != null)
- map['DeviceModel'] = deviceModel;
- if(deviceType != null)
- map['DeviceType'] = deviceType;
- if(headPicUrl != null)
- map['HeadPicUrl'] = headPicUrl;
- if(deviceSoftwareVersion != null)
- map['DeviceSoftwareVersion'] = deviceSoftwareVersion;
- if(sDKSoftwareVersion != null)
- map['SDKSoftwareVersion'] = sDKSoftwareVersion;
- if(organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if(shortCode != null)
- map['ShortCode'] = shortCode;
- if(id != null)
- map['Id'] = id;
- if(createTime != null)
- map['CreateTime'] = createTime;
- if(updateTime != null)
- map['UpdateTime'] = updateTime;
- map['IsDelete'] = isDelete;
- return map;
- }
- }
- class CreateDeviceInfoRequest {
- DeviceInfo? info;
- String? sessionId;
- CreateDeviceInfoRequest({
- this.info,
- this.sessionId,
- });
- factory CreateDeviceInfoRequest.fromJson(Map<String, dynamic> map) {
- return CreateDeviceInfoRequest(
- info: map['Info'],
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(info != null)
- map['Info'] = info;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
- class PageCollection<T> {
- int currentPage;
- int pageSize;
- int dataCount;
- List<T>? pageData;
- PageCollection({
- this.currentPage=0,
- this.pageSize=0,
- this.dataCount=0,
- this.pageData,
- });
- factory PageCollection.fromJson(Map<String, dynamic> map) {
- List<T> pageDataList = [];
- if (map['PageData'] != null) {
- pageDataList.addAll(
- (map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
- }
- return PageCollection(
- currentPage: map['CurrentPage'],
- pageSize: map['PageSize'],
- dataCount: map['DataCount'],
- pageData: pageDataList,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['CurrentPage'] = currentPage;
- map['PageSize'] = pageSize;
- map['DataCount'] = dataCount;
- if(pageData != null)
- map['PageData'] = pageData;
- return map;
- }
- }
- class PageRequest {
- int currentPage;
- int pageSize;
- Map<String,String>? filter;
- String? sessionId;
- PageRequest({
- this.currentPage=0,
- this.pageSize=0,
- this.filter,
- this.sessionId,
- });
- factory PageRequest.fromJson(Map<String, dynamic> map) {
- return PageRequest(
- currentPage: map['CurrentPage'],
- pageSize: map['PageSize'],
- filter: map['Filter'].cast<String,String>(),
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['CurrentPage'] = currentPage;
- map['PageSize'] = pageSize;
- if(filter != null)
- map['Filter'] = filter;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
|