123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678 |
- import 'connect.m.dart';
- import 'authentication.m.dart';
- import 'package:fis_common/json_convert.dart';
- class UploadDeviceDTO extends BaseDTO{
- String? serialNumber;
- String? deviceModel;
- String? deviceType;
- String? deviceSoftwareVersion;
- String? sDKSoftwareVersion;
- UploadDeviceDTO({
- this.serialNumber,
- this.deviceModel,
- this.deviceType,
- this.deviceSoftwareVersion,
- this.sDKSoftwareVersion,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory UploadDeviceDTO.fromJson(Map<String, dynamic> map) {
- return UploadDeviceDTO(
- serialNumber: map['SerialNumber'],
- deviceModel: map['DeviceModel'],
- deviceType: map['DeviceType'],
- deviceSoftwareVersion: map['DeviceSoftwareVersion'],
- sDKSoftwareVersion: map['SDKSoftwareVersion'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(serialNumber != null)
- map['SerialNumber'] = serialNumber;
- if(deviceModel != null)
- map['DeviceModel'] = deviceModel;
- if(deviceType != null)
- map['DeviceType'] = deviceType;
- if(deviceSoftwareVersion != null)
- map['DeviceSoftwareVersion'] = deviceSoftwareVersion;
- if(sDKSoftwareVersion != null)
- map['SDKSoftwareVersion'] = sDKSoftwareVersion;
- return map;
- }
- }
- class CreateDeviceRequest extends UploadDeviceDTO{
- CreateDeviceRequest({
- String? serialNumber,
- String? deviceModel,
- String? deviceType,
- String? deviceSoftwareVersion,
- String? sDKSoftwareVersion,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- serialNumber: serialNumber,
- deviceModel: deviceModel,
- deviceType: deviceType,
- deviceSoftwareVersion: deviceSoftwareVersion,
- sDKSoftwareVersion: sDKSoftwareVersion,
- createTime: createTime,
- updateTime: updateTime,
- );
- factory CreateDeviceRequest.fromJson(Map<String, dynamic> map) {
- return CreateDeviceRequest(
- serialNumber: map['SerialNumber'],
- deviceModel: map['DeviceModel'],
- deviceType: map['DeviceType'],
- deviceSoftwareVersion: map['DeviceSoftwareVersion'],
- sDKSoftwareVersion: map['SDKSoftwareVersion'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class DeviceExtendInfoDTO extends DeviceInfoDTO{
- String? organizationName;
- String? departmentName;
- bool isOnline;
- DeviceExtendInfoDTO({
- this.organizationName,
- this.departmentName,
- this.isOnline = false,
- String? deviceCode,
- String? serialNumber,
- String? password,
- String? name,
- String? description,
- String? deviceModel,
- String? deviceType,
- String? headPicUrl,
- String? deviceSoftwareVersion,
- String? sDKSoftwareVersion,
- String? organizationCode,
- String? departmentCode,
- String? shortCode,
- bool isAutoShared = false,
- DateTime? lastLoginTime,
- String? systemVersion,
- String? cPUModel,
- String? systemLanguage,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- deviceCode: deviceCode,
- serialNumber: serialNumber,
- password: password,
- name: name,
- description: description,
- deviceModel: deviceModel,
- deviceType: deviceType,
- headPicUrl: headPicUrl,
- deviceSoftwareVersion: deviceSoftwareVersion,
- sDKSoftwareVersion: sDKSoftwareVersion,
- organizationCode: organizationCode,
- departmentCode: departmentCode,
- shortCode: shortCode,
- isAutoShared: isAutoShared,
- lastLoginTime: lastLoginTime,
- systemVersion: systemVersion,
- cPUModel: cPUModel,
- systemLanguage: systemLanguage,
- createTime: createTime,
- updateTime: updateTime,
- );
- factory DeviceExtendInfoDTO.fromJson(Map<String, dynamic> map) {
- return DeviceExtendInfoDTO(
- organizationName: map['OrganizationName'],
- departmentName: map['DepartmentName'],
- isOnline: map['IsOnline'],
- deviceCode: map['DeviceCode'],
- serialNumber: map['SerialNumber'],
- password: map['Password'],
- name: map['Name'],
- description: map['Description'],
- deviceModel: map['DeviceModel'],
- deviceType: map['DeviceType'],
- headPicUrl: map['HeadPicUrl'],
- deviceSoftwareVersion: map['DeviceSoftwareVersion'],
- sDKSoftwareVersion: map['SDKSoftwareVersion'],
- organizationCode: map['OrganizationCode'],
- departmentCode: map['DepartmentCode'],
- shortCode: map['ShortCode'],
- isAutoShared: map['IsAutoShared'],
- lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
- systemVersion: map['SystemVersion'],
- cPUModel: map['CPUModel'],
- systemLanguage: map['SystemLanguage'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(organizationName != null)
- map['OrganizationName'] = organizationName;
- if(departmentName != null)
- map['DepartmentName'] = departmentName;
- map['IsOnline'] = isOnline;
- return map;
- }
- }
- class GetDeviceRequest extends TokenRequest{
- String? deviceCode;
- GetDeviceRequest({
- this.deviceCode,
- String? token,
- }) : super(
- token: token,
- );
- factory GetDeviceRequest.fromJson(Map<String, dynamic> map) {
- return GetDeviceRequest(
- deviceCode: map['DeviceCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- 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 PageFilterRequest extends BaseRequest{
- int currentPage;
- int pageSize;
- Map<String,String>? filter;
- bool isFuzzy;
- PageFilterRequest({
- this.currentPage = 0,
- this.pageSize = 0,
- this.filter,
- this.isFuzzy = false,
- }) : super(
- );
- factory PageFilterRequest.fromJson(Map<String, dynamic> map) {
- return PageFilterRequest(
- currentPage: map['CurrentPage'],
- pageSize: map['PageSize'],
- filter: map['Filter'] != null ? map['Filter'].cast<String,String>() : null,
- isFuzzy: map['IsFuzzy'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['CurrentPage'] = currentPage;
- map['PageSize'] = pageSize;
- if(filter != null)
- map['Filter'] = filter;
- map['IsFuzzy'] = isFuzzy;
- return map;
- }
- }
- class BindDeviceRequest extends TokenRequest{
- String? serialNumber;
- String? name;
- String? description;
- String? headPicUrl;
- String? organizationCode;
- String? departmentCode;
- String? shortCode;
- bool isAutoShared;
- BindDeviceRequest({
- this.serialNumber,
- this.name,
- this.description,
- this.headPicUrl,
- this.organizationCode,
- this.departmentCode,
- this.shortCode,
- this.isAutoShared = false,
- String? token,
- }) : super(
- token: token,
- );
- factory BindDeviceRequest.fromJson(Map<String, dynamic> map) {
- return BindDeviceRequest(
- serialNumber: map['SerialNumber'],
- name: map['Name'],
- description: map['Description'],
- headPicUrl: map['HeadPicUrl'],
- organizationCode: map['OrganizationCode'],
- departmentCode: map['DepartmentCode'],
- shortCode: map['ShortCode'],
- isAutoShared: map['IsAutoShared'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(serialNumber != null)
- map['SerialNumber'] = serialNumber;
- if(name != null)
- map['Name'] = name;
- if(description != null)
- map['Description'] = description;
- if(headPicUrl != null)
- map['HeadPicUrl'] = headPicUrl;
- if(organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if(departmentCode != null)
- map['DepartmentCode'] = departmentCode;
- if(shortCode != null)
- map['ShortCode'] = shortCode;
- map['IsAutoShared'] = isAutoShared;
- return map;
- }
- }
- class AlterDeviceRequest extends TokenRequest{
- String? deviceCode;
- String? serialNumber;
- String? name;
- String? description;
- String? headPicUrl;
- String? organizationCode;
- String? departmentCode;
- bool isAutoShared;
- AlterDeviceRequest({
- this.deviceCode,
- this.serialNumber,
- this.name,
- this.description,
- this.headPicUrl,
- this.organizationCode,
- this.departmentCode,
- this.isAutoShared = false,
- String? token,
- }) : super(
- token: token,
- );
- factory AlterDeviceRequest.fromJson(Map<String, dynamic> map) {
- return AlterDeviceRequest(
- deviceCode: map['DeviceCode'],
- serialNumber: map['SerialNumber'],
- name: map['Name'],
- description: map['Description'],
- headPicUrl: map['HeadPicUrl'],
- organizationCode: map['OrganizationCode'],
- departmentCode: map['DepartmentCode'],
- isAutoShared: map['IsAutoShared'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- if(serialNumber != null)
- map['SerialNumber'] = serialNumber;
- if(name != null)
- map['Name'] = name;
- if(description != null)
- map['Description'] = description;
- if(headPicUrl != null)
- map['HeadPicUrl'] = headPicUrl;
- if(organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if(departmentCode != null)
- map['DepartmentCode'] = departmentCode;
- map['IsAutoShared'] = isAutoShared;
- return map;
- }
- }
- enum DictionaryTypeEnum {
- DeviceModel,
- DeviceType,
- }
- class CreateDictionaryItemRequest extends TokenRequest{
- DictionaryTypeEnum dictionaryType;
- String? dictionaryItemValue;
- String? parentCode;
- CreateDictionaryItemRequest({
- this.dictionaryType = DictionaryTypeEnum.DeviceModel,
- this.dictionaryItemValue,
- this.parentCode,
- String? token,
- }) : super(
- token: token,
- );
- factory CreateDictionaryItemRequest.fromJson(Map<String, dynamic> map) {
- return CreateDictionaryItemRequest(
- dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
- dictionaryItemValue: map['DictionaryItemValue'],
- parentCode: map['ParentCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['DictionaryType'] = dictionaryType.index;
- if(dictionaryItemValue != null)
- map['DictionaryItemValue'] = dictionaryItemValue;
- if(parentCode != null)
- map['ParentCode'] = parentCode;
- return map;
- }
- }
- class DictionaryDTO extends BaseDTO{
- String? dictionaryCode;
- DictionaryTypeEnum dictionaryType;
- String? value;
- String? parentCode;
- DictionaryDTO({
- this.dictionaryCode,
- this.dictionaryType = DictionaryTypeEnum.DeviceModel,
- this.value,
- this.parentCode,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory DictionaryDTO.fromJson(Map<String, dynamic> map) {
- return DictionaryDTO(
- dictionaryCode: map['DictionaryCode'],
- dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
- value: map['Value'],
- parentCode: map['ParentCode'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(dictionaryCode != null)
- map['DictionaryCode'] = dictionaryCode;
- map['DictionaryType'] = dictionaryType.index;
- if(value != null)
- map['Value'] = value;
- if(parentCode != null)
- map['ParentCode'] = parentCode;
- return map;
- }
- }
- class FindDeviceModelItemsRequest extends TokenRequest{
- DictionaryTypeEnum dictionaryType;
- String? deviceTypeCode;
- FindDeviceModelItemsRequest({
- this.dictionaryType = DictionaryTypeEnum.DeviceModel,
- this.deviceTypeCode,
- String? token,
- }) : super(
- token: token,
- );
- factory FindDeviceModelItemsRequest.fromJson(Map<String, dynamic> map) {
- return FindDeviceModelItemsRequest(
- dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
- deviceTypeCode: map['DeviceTypeCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['DictionaryType'] = dictionaryType.index;
- if(deviceTypeCode != null)
- map['DeviceTypeCode'] = deviceTypeCode;
- return map;
- }
- }
- class FindDeviceTypeItemsRequest extends TokenRequest{
- DictionaryTypeEnum dictionaryType;
- FindDeviceTypeItemsRequest({
- this.dictionaryType = DictionaryTypeEnum.DeviceModel,
- String? token,
- }) : super(
- token: token,
- );
- factory FindDeviceTypeItemsRequest.fromJson(Map<String, dynamic> map) {
- return FindDeviceTypeItemsRequest(
- dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['DictionaryType'] = dictionaryType.index;
- return map;
- }
- }
- class CreateShareDeviceToUserRequest extends TokenRequest{
- List<String>? userCodes;
- String? deviceCode;
- CreateShareDeviceToUserRequest({
- this.userCodes,
- this.deviceCode,
- String? token,
- }) : super(
- token: token,
- );
- factory CreateShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
- return CreateShareDeviceToUserRequest(
- userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
- deviceCode: map['DeviceCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(userCodes != null)
- map['UserCodes'] = userCodes;
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- return map;
- }
- }
- class DeleteShareDeviceToUserRequest extends TokenRequest{
- List<String>? userCodes;
- String? deviceCode;
- DeleteShareDeviceToUserRequest({
- this.userCodes,
- this.deviceCode,
- String? token,
- }) : super(
- token: token,
- );
- factory DeleteShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
- return DeleteShareDeviceToUserRequest(
- userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
- deviceCode: map['DeviceCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(userCodes != null)
- map['UserCodes'] = userCodes;
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- return map;
- }
- }
- class RemoveDeviceRelevancyRequest extends TokenRequest{
- String? organizationCode;
- String? departmentCode;
- String? deviceCode;
- RemoveDeviceRelevancyRequest({
- this.organizationCode,
- this.departmentCode,
- this.deviceCode,
- String? token,
- }) : super(
- token: token,
- );
- factory RemoveDeviceRelevancyRequest.fromJson(Map<String, dynamic> map) {
- return RemoveDeviceRelevancyRequest(
- organizationCode: map['OrganizationCode'],
- departmentCode: map['DepartmentCode'],
- deviceCode: map['DeviceCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if(departmentCode != null)
- map['DepartmentCode'] = departmentCode;
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- return map;
- }
- }
- class FindDevicesByOrganizationCodeRequest extends TokenRequest{
- String? organizationCode;
- FindDevicesByOrganizationCodeRequest({
- this.organizationCode,
- String? token,
- }) : super(
- token: token,
- );
- factory FindDevicesByOrganizationCodeRequest.fromJson(Map<String, dynamic> map) {
- return FindDevicesByOrganizationCodeRequest(
- organizationCode: map['OrganizationCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- return map;
- }
- }
- class SelectItemDTO {
- String? key;
- String? value;
- SelectItemDTO({
- this.key,
- this.value,
- });
- factory SelectItemDTO.fromJson(Map<String, dynamic> map) {
- return SelectItemDTO(
- key: map['Key'],
- value: map['Value'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(key != null)
- map['Key'] = key;
- if(value != null)
- map['Value'] = value;
- return map;
- }
- }
|