123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475 |
- import 'authentication.m.dart';
- import 'aIDiagnosis.m.dart';
- import 'package:fis_jsonrpc/utils.dart';
- class ConnectResult {
- String? token;
- String? uniqueCode;
- ConnectResult({
- this.token,
- this.uniqueCode,
- });
- factory ConnectResult.fromJson(Map<String, dynamic> map) {
- return ConnectResult(
- token: map['Token'],
- uniqueCode: map['UniqueCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(token != null)
- map['Token'] = token;
- if(uniqueCode != null)
- map['UniqueCode'] = uniqueCode;
- return map;
- }
- }
- class ConnectRequest {
- String? deviceUniqueCode;
- String? password;
- String? deviceModel;
- String? deviceType;
- String? softwareVersion;
- String? systemVersion;
- String? cPUModel;
- String? systemLanguage;
- String? description;
- String? name;
- String? organizationCode;
- String? departmentCode;
- Platform platform;
- LoginSource loginSource;
- ConnectRequest({
- this.deviceUniqueCode,
- this.password,
- this.deviceModel,
- this.deviceType,
- this.softwareVersion,
- this.systemVersion,
- this.cPUModel,
- this.systemLanguage,
- this.description,
- this.name,
- this.organizationCode,
- this.departmentCode,
- this.platform = Platform.Windows,
- this.loginSource = LoginSource.PC,
- });
- factory ConnectRequest.fromJson(Map<String, dynamic> map) {
- return ConnectRequest(
- deviceUniqueCode: map['DeviceUniqueCode'],
- password: map['Password'],
- deviceModel: map['DeviceModel'],
- deviceType: map['DeviceType'],
- softwareVersion: map['SoftwareVersion'],
- systemVersion: map['SystemVersion'],
- cPUModel: map['CPUModel'],
- systemLanguage: map['SystemLanguage'],
- description: map['Description'],
- name: map['Name'],
- organizationCode: map['OrganizationCode'],
- departmentCode: map['DepartmentCode'],
- platform: Platform.values.firstWhere((e) => e.index == map['Platform']),
- loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(deviceUniqueCode != null)
- map['DeviceUniqueCode'] = deviceUniqueCode;
- if(password != null)
- map['Password'] = password;
- if(deviceModel != null)
- map['DeviceModel'] = deviceModel;
- if(deviceType != null)
- map['DeviceType'] = deviceType;
- if(softwareVersion != null)
- map['SoftwareVersion'] = softwareVersion;
- if(systemVersion != null)
- map['SystemVersion'] = systemVersion;
- if(cPUModel != null)
- map['CPUModel'] = cPUModel;
- if(systemLanguage != null)
- map['SystemLanguage'] = systemLanguage;
- if(description != null)
- map['Description'] = description;
- if(name != null)
- map['Name'] = name;
- if(organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if(departmentCode != null)
- map['DepartmentCode'] = departmentCode;
- map['Platform'] = platform.index;
- map['LoginSource'] = loginSource.index;
- return map;
- }
- }
- class BaseDTO {
- DateTime? createTime;
- DateTime? updateTime;
- BaseDTO({
- this.createTime,
- this.updateTime,
- });
- factory BaseDTO.fromJson(Map<String, dynamic> map) {
- return BaseDTO(
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(createTime != null)
- map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
- if(updateTime != null)
- map['UpdateTime'] = JsonRpcUtils.dateFormat(updateTime!);
- return map;
- }
- }
- enum VideoDeviceSourceTypeEnum {
- Desktop,
- Camera,
- }
- class VideoDeviceDTO {
- String? videoDeviceId;
- VideoDeviceSourceTypeEnum videoDeviceSourceType;
- int width;
- int height;
- int outputWidth;
- int outputHeight;
- VideoDeviceDTO({
- this.videoDeviceId,
- this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
- this.width = 0,
- this.height = 0,
- this.outputWidth = 0,
- this.outputHeight = 0,
- });
- factory VideoDeviceDTO.fromJson(Map<String, dynamic> map) {
- return VideoDeviceDTO(
- videoDeviceId: map['VideoDeviceId'],
- videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
- width: map['Width'],
- height: map['Height'],
- outputWidth: map['OutputWidth'],
- outputHeight: map['OutputHeight'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(videoDeviceId != null)
- map['VideoDeviceId'] = videoDeviceId;
- map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
- map['Width'] = width;
- map['Height'] = height;
- map['OutputWidth'] = outputWidth;
- map['OutputHeight'] = outputHeight;
- return map;
- }
- }
- enum DownloadModeSettingEnum {
- Auto,
- Origin,
- CDN,
- }
- class DeviceInfoDTO extends BaseDTO{
- 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;
- bool isEncryptedShow;
- DateTime? lastLoginTime;
- String? systemVersion;
- String? cPUModel;
- String? systemLanguage;
- List<String >? diagnosisModules;
- List<String >? reportPosterCodes;
- bool mergedChannel;
- int mergedVideoOutputWidth;
- int mergedVideoOutputHeight;
- List<VideoDeviceDTO >? videoDeviceInfos;
- DownloadModeSettingEnum downloadModeSetting;
- DeviceInfoDTO({
- this.deviceCode,
- this.serialNumber,
- this.password,
- this.name,
- this.description,
- this.deviceModel,
- this.deviceType,
- this.headPicUrl,
- this.deviceSoftwareVersion,
- this.sDKSoftwareVersion,
- this.organizationCode,
- this.departmentCode,
- this.shortCode,
- this.isAutoShared = false,
- this.isEncryptedShow = false,
- this.lastLoginTime,
- this.systemVersion,
- this.cPUModel,
- this.systemLanguage,
- this.diagnosisModules,
- this.reportPosterCodes,
- this.mergedChannel = false,
- this.mergedVideoOutputWidth = 0,
- this.mergedVideoOutputHeight = 0,
- this.videoDeviceInfos,
- this.downloadModeSetting = DownloadModeSettingEnum.Auto,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory DeviceInfoDTO.fromJson(Map<String, dynamic> map) {
- return DeviceInfoDTO(
- 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'],
- isEncryptedShow: map['IsEncryptedShow'],
- lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
- systemVersion: map['SystemVersion'],
- cPUModel: map['CPUModel'],
- systemLanguage: map['SystemLanguage'],
- diagnosisModules: map['DiagnosisModules'] != null ? map['DiagnosisModules'].cast<String>().toList() : null,
- reportPosterCodes: map['ReportPosterCodes'] != null ? map['ReportPosterCodes'].cast<String>().toList() : null,
- mergedChannel: map['MergedChannel'],
- mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
- mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
- videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- downloadModeSetting: DownloadModeSettingEnum.values.firstWhere((e) => e.index == map['DownloadModeSetting']),
- 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(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- if(serialNumber != null)
- map['SerialNumber'] = serialNumber;
- if(password != null)
- map['Password'] = password;
- if(name != null)
- map['Name'] = name;
- 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(departmentCode != null)
- map['DepartmentCode'] = departmentCode;
- if(shortCode != null)
- map['ShortCode'] = shortCode;
- map['IsAutoShared'] = isAutoShared;
- map['IsEncryptedShow'] = isEncryptedShow;
- if(lastLoginTime != null)
- map['LastLoginTime'] = JsonRpcUtils.dateFormat(lastLoginTime!);
- if(systemVersion != null)
- map['SystemVersion'] = systemVersion;
- if(cPUModel != null)
- map['CPUModel'] = cPUModel;
- if(systemLanguage != null)
- map['SystemLanguage'] = systemLanguage;
- if(diagnosisModules != null)
- map['DiagnosisModules'] = diagnosisModules;
- if(reportPosterCodes != null)
- map['ReportPosterCodes'] = reportPosterCodes;
- map['MergedChannel'] = mergedChannel;
- map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
- map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
- if(videoDeviceInfos != null)
- map['VideoDeviceInfos'] = videoDeviceInfos;
- map['DownloadModeSetting'] = downloadModeSetting.index;
- return map;
- }
- }
- class CacheDeviceDTO extends DeviceInfoDTO{
- bool isOnline;
- String? sourceUrl;
- CacheDeviceDTO({
- this.isOnline = false,
- this.sourceUrl,
- 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,
- bool isEncryptedShow = false,
- DateTime? lastLoginTime,
- String? systemVersion,
- String? cPUModel,
- String? systemLanguage,
- List<String >? diagnosisModules,
- List<String >? reportPosterCodes,
- bool mergedChannel = false,
- int mergedVideoOutputWidth = 0,
- int mergedVideoOutputHeight = 0,
- List<VideoDeviceDTO >? videoDeviceInfos,
- DownloadModeSettingEnum downloadModeSetting = DownloadModeSettingEnum.Auto,
- 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,
- isEncryptedShow: isEncryptedShow,
- lastLoginTime: lastLoginTime,
- systemVersion: systemVersion,
- cPUModel: cPUModel,
- systemLanguage: systemLanguage,
- diagnosisModules: diagnosisModules,
- reportPosterCodes: reportPosterCodes,
- mergedChannel: mergedChannel,
- mergedVideoOutputWidth: mergedVideoOutputWidth,
- mergedVideoOutputHeight: mergedVideoOutputHeight,
- videoDeviceInfos: videoDeviceInfos,
- downloadModeSetting: downloadModeSetting,
- createTime: createTime,
- updateTime: updateTime,
- );
- factory CacheDeviceDTO.fromJson(Map<String, dynamic> map) {
- return CacheDeviceDTO(
- isOnline: map['IsOnline'],
- sourceUrl: map['SourceUrl'],
- 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'],
- isEncryptedShow: map['IsEncryptedShow'],
- lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
- systemVersion: map['SystemVersion'],
- cPUModel: map['CPUModel'],
- systemLanguage: map['SystemLanguage'],
- diagnosisModules: map['DiagnosisModules'] != null ? map['DiagnosisModules'].cast<String>().toList() : null,
- reportPosterCodes: map['ReportPosterCodes'] != null ? map['ReportPosterCodes'].cast<String>().toList() : null,
- mergedChannel: map['MergedChannel'],
- mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
- mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
- videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- downloadModeSetting: DownloadModeSettingEnum.values.firstWhere((e) => e.index == map['DownloadModeSetting']),
- 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();
- map['IsOnline'] = isOnline;
- if(sourceUrl != null)
- map['SourceUrl'] = sourceUrl;
- return map;
- }
- }
- class SetDeviceIsEncryptedShowRequest extends TokenRequest{
- bool isEncryptedShow;
- SetDeviceIsEncryptedShowRequest({
- this.isEncryptedShow = false,
- String? token,
- }) : super(
- token: token,
- );
- factory SetDeviceIsEncryptedShowRequest.fromJson(Map<String, dynamic> map) {
- return SetDeviceIsEncryptedShowRequest(
- isEncryptedShow: map['IsEncryptedShow'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['IsEncryptedShow'] = isEncryptedShow;
- return map;
- }
- }
|