device.m.dart 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'connect.m.dart';
  4. import 'package:fis_jsonrpc/utils.dart';
  5. import 'package:fis_common/json_convert.dart';
  6. class UploadDeviceDTO extends BaseDTO{
  7. String? serialNumber;
  8. String? deviceModel;
  9. String? deviceType;
  10. String? deviceSoftwareVersion;
  11. String? sDKSoftwareVersion;
  12. UploadDeviceDTO({
  13. this.serialNumber,
  14. this.deviceModel,
  15. this.deviceType,
  16. this.deviceSoftwareVersion,
  17. this.sDKSoftwareVersion,
  18. DateTime? createTime,
  19. DateTime? updateTime,
  20. }) : super(
  21. createTime: createTime,
  22. updateTime: updateTime,
  23. );
  24. factory UploadDeviceDTO.fromJson(Map<String, dynamic> map) {
  25. return UploadDeviceDTO(
  26. serialNumber: map['SerialNumber'],
  27. deviceModel: map['DeviceModel'],
  28. deviceType: map['DeviceType'],
  29. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  30. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  31. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  32. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  33. );
  34. }
  35. Map<String, dynamic> toJson() {
  36. final map = super.toJson();
  37. if(serialNumber != null)
  38. map['SerialNumber'] = serialNumber;
  39. if(deviceModel != null)
  40. map['DeviceModel'] = deviceModel;
  41. if(deviceType != null)
  42. map['DeviceType'] = deviceType;
  43. if(deviceSoftwareVersion != null)
  44. map['DeviceSoftwareVersion'] = deviceSoftwareVersion;
  45. if(sDKSoftwareVersion != null)
  46. map['SDKSoftwareVersion'] = sDKSoftwareVersion;
  47. return map;
  48. }
  49. }
  50. class CreateDeviceRequest extends UploadDeviceDTO{
  51. CreateDeviceRequest({
  52. String? serialNumber,
  53. String? deviceModel,
  54. String? deviceType,
  55. String? deviceSoftwareVersion,
  56. String? sDKSoftwareVersion,
  57. DateTime? createTime,
  58. DateTime? updateTime,
  59. }) : super(
  60. serialNumber: serialNumber,
  61. deviceModel: deviceModel,
  62. deviceType: deviceType,
  63. deviceSoftwareVersion: deviceSoftwareVersion,
  64. sDKSoftwareVersion: sDKSoftwareVersion,
  65. createTime: createTime,
  66. updateTime: updateTime,
  67. );
  68. factory CreateDeviceRequest.fromJson(Map<String, dynamic> map) {
  69. return CreateDeviceRequest(
  70. serialNumber: map['SerialNumber'],
  71. deviceModel: map['DeviceModel'],
  72. deviceType: map['DeviceType'],
  73. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  74. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  75. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  76. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  77. );
  78. }
  79. Map<String, dynamic> toJson() {
  80. final map = super.toJson();
  81. return map;
  82. }
  83. }
  84. class DictionaryLanguageConfigDTO {
  85. String? language;
  86. String? value;
  87. DictionaryLanguageConfigDTO({
  88. this.language,
  89. this.value,
  90. });
  91. factory DictionaryLanguageConfigDTO.fromJson(Map<String, dynamic> map) {
  92. return DictionaryLanguageConfigDTO(
  93. language: map['Language'],
  94. value: map['Value'],
  95. );
  96. }
  97. Map<String, dynamic> toJson() {
  98. final map = Map<String, dynamic>();
  99. if(language != null)
  100. map['Language'] = language;
  101. if(value != null)
  102. map['Value'] = value;
  103. return map;
  104. }
  105. }
  106. class DeviceExtendInfoDTO extends DeviceInfoDTO{
  107. String? organizationName;
  108. String? departmentName;
  109. bool isOnline;
  110. bool isLiving;
  111. String? organizationDirectorCode;
  112. String? organizationDirectorUserName;
  113. String? organizationDirectorFullName;
  114. List<DictionaryLanguageConfigDTO >? languageConfigs;
  115. DeviceExtendInfoDTO({
  116. this.organizationName,
  117. this.departmentName,
  118. this.isOnline = false,
  119. this.isLiving = false,
  120. this.organizationDirectorCode,
  121. this.organizationDirectorUserName,
  122. this.organizationDirectorFullName,
  123. this.languageConfigs,
  124. String? deviceCode,
  125. String? serialNumber,
  126. String? password,
  127. String? name,
  128. String? description,
  129. String? deviceModel,
  130. String? deviceType,
  131. String? headPicUrl,
  132. String? deviceSoftwareVersion,
  133. String? sDKSoftwareVersion,
  134. String? organizationCode,
  135. String? departmentCode,
  136. String? shortCode,
  137. bool isAutoShared = false,
  138. bool isEncryptedShow = false,
  139. DateTime? lastLoginTime,
  140. String? systemVersion,
  141. String? cPUModel,
  142. String? systemLanguage,
  143. List<String >? diagnosisModules,
  144. List<String >? reportPosterCodes,
  145. bool mergedChannel = false,
  146. int mergedVideoOutputWidth = 0,
  147. int mergedVideoOutputHeight = 0,
  148. List<VideoDeviceDTO >? videoDeviceInfos,
  149. DownloadModeSettingEnum downloadModeSetting = DownloadModeSettingEnum.Auto,
  150. bool liveOpened = false,
  151. DateTime? createTime,
  152. DateTime? updateTime,
  153. }) : super(
  154. deviceCode: deviceCode,
  155. serialNumber: serialNumber,
  156. password: password,
  157. name: name,
  158. description: description,
  159. deviceModel: deviceModel,
  160. deviceType: deviceType,
  161. headPicUrl: headPicUrl,
  162. deviceSoftwareVersion: deviceSoftwareVersion,
  163. sDKSoftwareVersion: sDKSoftwareVersion,
  164. organizationCode: organizationCode,
  165. departmentCode: departmentCode,
  166. shortCode: shortCode,
  167. isAutoShared: isAutoShared,
  168. isEncryptedShow: isEncryptedShow,
  169. lastLoginTime: lastLoginTime,
  170. systemVersion: systemVersion,
  171. cPUModel: cPUModel,
  172. systemLanguage: systemLanguage,
  173. diagnosisModules: diagnosisModules,
  174. reportPosterCodes: reportPosterCodes,
  175. mergedChannel: mergedChannel,
  176. mergedVideoOutputWidth: mergedVideoOutputWidth,
  177. mergedVideoOutputHeight: mergedVideoOutputHeight,
  178. videoDeviceInfos: videoDeviceInfos,
  179. downloadModeSetting: downloadModeSetting,
  180. liveOpened: liveOpened,
  181. createTime: createTime,
  182. updateTime: updateTime,
  183. );
  184. factory DeviceExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  185. return DeviceExtendInfoDTO(
  186. organizationName: map['OrganizationName'],
  187. departmentName: map['DepartmentName'],
  188. isOnline: map['IsOnline'],
  189. isLiving: map['IsLiving'],
  190. organizationDirectorCode: map['OrganizationDirectorCode'],
  191. organizationDirectorUserName: map['OrganizationDirectorUserName'],
  192. organizationDirectorFullName: map['OrganizationDirectorFullName'],
  193. languageConfigs: map['LanguageConfigs'] != null ? (map['LanguageConfigs'] as List).map((e)=>DictionaryLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  194. deviceCode: map['DeviceCode'],
  195. serialNumber: map['SerialNumber'],
  196. password: map['Password'],
  197. name: map['Name'],
  198. description: map['Description'],
  199. deviceModel: map['DeviceModel'],
  200. deviceType: map['DeviceType'],
  201. headPicUrl: map['HeadPicUrl'],
  202. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  203. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  204. organizationCode: map['OrganizationCode'],
  205. departmentCode: map['DepartmentCode'],
  206. shortCode: map['ShortCode'],
  207. isAutoShared: map['IsAutoShared'],
  208. isEncryptedShow: map['IsEncryptedShow'],
  209. lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
  210. systemVersion: map['SystemVersion'],
  211. cPUModel: map['CPUModel'],
  212. systemLanguage: map['SystemLanguage'],
  213. diagnosisModules: map['DiagnosisModules'] != null ? map['DiagnosisModules'].cast<String>().toList() : null,
  214. reportPosterCodes: map['ReportPosterCodes'] != null ? map['ReportPosterCodes'].cast<String>().toList() : null,
  215. mergedChannel: map['MergedChannel'],
  216. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  217. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  218. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  219. downloadModeSetting: DownloadModeSettingEnum.values.firstWhere((e) => e.index == map['DownloadModeSetting']),
  220. liveOpened: map['LiveOpened'],
  221. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  222. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  223. );
  224. }
  225. Map<String, dynamic> toJson() {
  226. final map = super.toJson();
  227. if(organizationName != null)
  228. map['OrganizationName'] = organizationName;
  229. if(departmentName != null)
  230. map['DepartmentName'] = departmentName;
  231. map['IsOnline'] = isOnline;
  232. map['IsLiving'] = isLiving;
  233. if(organizationDirectorCode != null)
  234. map['OrganizationDirectorCode'] = organizationDirectorCode;
  235. if(organizationDirectorUserName != null)
  236. map['OrganizationDirectorUserName'] = organizationDirectorUserName;
  237. if(organizationDirectorFullName != null)
  238. map['OrganizationDirectorFullName'] = organizationDirectorFullName;
  239. if(languageConfigs != null)
  240. map['LanguageConfigs'] = languageConfigs;
  241. return map;
  242. }
  243. }
  244. class GetDeviceRequest extends TokenRequest{
  245. String? deviceCode;
  246. GetDeviceRequest({
  247. this.deviceCode,
  248. String? token,
  249. }) : super(
  250. token: token,
  251. );
  252. factory GetDeviceRequest.fromJson(Map<String, dynamic> map) {
  253. return GetDeviceRequest(
  254. deviceCode: map['DeviceCode'],
  255. token: map['Token'],
  256. );
  257. }
  258. Map<String, dynamic> toJson() {
  259. final map = super.toJson();
  260. if(deviceCode != null)
  261. map['DeviceCode'] = deviceCode;
  262. return map;
  263. }
  264. }
  265. class GetDeviceByShortCodeRequest extends TokenRequest{
  266. String? shortCode;
  267. GetDeviceByShortCodeRequest({
  268. this.shortCode,
  269. String? token,
  270. }) : super(
  271. token: token,
  272. );
  273. factory GetDeviceByShortCodeRequest.fromJson(Map<String, dynamic> map) {
  274. return GetDeviceByShortCodeRequest(
  275. shortCode: map['ShortCode'],
  276. token: map['Token'],
  277. );
  278. }
  279. Map<String, dynamic> toJson() {
  280. final map = super.toJson();
  281. if(shortCode != null)
  282. map['ShortCode'] = shortCode;
  283. return map;
  284. }
  285. }
  286. class PageCollection<T> {
  287. int currentPage;
  288. int pageSize;
  289. int dataCount;
  290. List<T>? pageData;
  291. PageCollection({
  292. this.currentPage = 0,
  293. this.pageSize = 0,
  294. this.dataCount = 0,
  295. this.pageData,
  296. });
  297. factory PageCollection.fromJson(Map<String, dynamic> map) {
  298. List<T> pageDataList = [];
  299. if (map['PageData'] != null) {
  300. pageDataList.addAll(
  301. (map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
  302. }
  303. return PageCollection(
  304. currentPage: map['CurrentPage'],
  305. pageSize: map['PageSize'],
  306. dataCount: map['DataCount'],
  307. pageData: pageDataList,
  308. );
  309. }
  310. Map<String, dynamic> toJson() {
  311. final map = Map<String, dynamic>();
  312. map['CurrentPage'] = currentPage;
  313. map['PageSize'] = pageSize;
  314. map['DataCount'] = dataCount;
  315. if(pageData != null)
  316. map['PageData'] = pageData;
  317. return map;
  318. }
  319. }
  320. class PageFilterRequest extends BaseRequest{
  321. int currentPage;
  322. int pageSize;
  323. Map<String,String>? filter;
  324. bool isFuzzy;
  325. PageFilterRequest({
  326. this.currentPage = 0,
  327. this.pageSize = 0,
  328. this.filter,
  329. this.isFuzzy = false,
  330. }) : super(
  331. );
  332. factory PageFilterRequest.fromJson(Map<String, dynamic> map) {
  333. return PageFilterRequest(
  334. currentPage: map['CurrentPage'],
  335. pageSize: map['PageSize'],
  336. filter: map['Filter'] != null ? map['Filter'].cast<String,String>() : null,
  337. isFuzzy: map['IsFuzzy'],
  338. );
  339. }
  340. Map<String, dynamic> toJson() {
  341. final map = super.toJson();
  342. map['CurrentPage'] = currentPage;
  343. map['PageSize'] = pageSize;
  344. if(filter != null)
  345. map['Filter'] = filter;
  346. map['IsFuzzy'] = isFuzzy;
  347. return map;
  348. }
  349. }
  350. class BindDeviceRequest extends TokenRequest{
  351. String? serialNumber;
  352. String? name;
  353. String? description;
  354. String? headPicUrl;
  355. String? organizationCode;
  356. String? departmentCode;
  357. String? shortCode;
  358. bool isAutoShared;
  359. BindDeviceRequest({
  360. this.serialNumber,
  361. this.name,
  362. this.description,
  363. this.headPicUrl,
  364. this.organizationCode,
  365. this.departmentCode,
  366. this.shortCode,
  367. this.isAutoShared = false,
  368. String? token,
  369. }) : super(
  370. token: token,
  371. );
  372. factory BindDeviceRequest.fromJson(Map<String, dynamic> map) {
  373. return BindDeviceRequest(
  374. serialNumber: map['SerialNumber'],
  375. name: map['Name'],
  376. description: map['Description'],
  377. headPicUrl: map['HeadPicUrl'],
  378. organizationCode: map['OrganizationCode'],
  379. departmentCode: map['DepartmentCode'],
  380. shortCode: map['ShortCode'],
  381. isAutoShared: map['IsAutoShared'],
  382. token: map['Token'],
  383. );
  384. }
  385. Map<String, dynamic> toJson() {
  386. final map = super.toJson();
  387. if(serialNumber != null)
  388. map['SerialNumber'] = serialNumber;
  389. if(name != null)
  390. map['Name'] = name;
  391. if(description != null)
  392. map['Description'] = description;
  393. if(headPicUrl != null)
  394. map['HeadPicUrl'] = headPicUrl;
  395. if(organizationCode != null)
  396. map['OrganizationCode'] = organizationCode;
  397. if(departmentCode != null)
  398. map['DepartmentCode'] = departmentCode;
  399. if(shortCode != null)
  400. map['ShortCode'] = shortCode;
  401. map['IsAutoShared'] = isAutoShared;
  402. return map;
  403. }
  404. }
  405. class ModifyDeviceRequest extends TokenRequest{
  406. String? deviceCode;
  407. String? name;
  408. String? headPicUrl;
  409. String? departmentCode;
  410. bool isAutoShared;
  411. ModifyDeviceRequest({
  412. this.deviceCode,
  413. this.name,
  414. this.headPicUrl,
  415. this.departmentCode,
  416. this.isAutoShared = false,
  417. String? token,
  418. }) : super(
  419. token: token,
  420. );
  421. factory ModifyDeviceRequest.fromJson(Map<String, dynamic> map) {
  422. return ModifyDeviceRequest(
  423. deviceCode: map['DeviceCode'],
  424. name: map['Name'],
  425. headPicUrl: map['HeadPicUrl'],
  426. departmentCode: map['DepartmentCode'],
  427. isAutoShared: map['IsAutoShared'],
  428. token: map['Token'],
  429. );
  430. }
  431. Map<String, dynamic> toJson() {
  432. final map = super.toJson();
  433. if(deviceCode != null)
  434. map['DeviceCode'] = deviceCode;
  435. if(name != null)
  436. map['Name'] = name;
  437. if(headPicUrl != null)
  438. map['HeadPicUrl'] = headPicUrl;
  439. if(departmentCode != null)
  440. map['DepartmentCode'] = departmentCode;
  441. map['IsAutoShared'] = isAutoShared;
  442. return map;
  443. }
  444. }
  445. enum DictionaryTypeEnum {
  446. DeviceModel,
  447. DeviceType,
  448. }
  449. class CreateDictionaryItemRequest extends TokenRequest{
  450. DictionaryTypeEnum dictionaryType;
  451. String? dictionaryItemValue;
  452. String? parentCode;
  453. CreateDictionaryItemRequest({
  454. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  455. this.dictionaryItemValue,
  456. this.parentCode,
  457. String? token,
  458. }) : super(
  459. token: token,
  460. );
  461. factory CreateDictionaryItemRequest.fromJson(Map<String, dynamic> map) {
  462. return CreateDictionaryItemRequest(
  463. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  464. dictionaryItemValue: map['DictionaryItemValue'],
  465. parentCode: map['ParentCode'],
  466. token: map['Token'],
  467. );
  468. }
  469. Map<String, dynamic> toJson() {
  470. final map = super.toJson();
  471. map['DictionaryType'] = dictionaryType.index;
  472. if(dictionaryItemValue != null)
  473. map['DictionaryItemValue'] = dictionaryItemValue;
  474. if(parentCode != null)
  475. map['ParentCode'] = parentCode;
  476. return map;
  477. }
  478. }
  479. class DictionaryDTO extends BaseDTO{
  480. String? dictionaryCode;
  481. DictionaryTypeEnum dictionaryType;
  482. String? value;
  483. String? parentCode;
  484. List<DictionaryLanguageConfigDTO >? languageConfigs;
  485. DictionaryDTO({
  486. this.dictionaryCode,
  487. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  488. this.value,
  489. this.parentCode,
  490. this.languageConfigs,
  491. DateTime? createTime,
  492. DateTime? updateTime,
  493. }) : super(
  494. createTime: createTime,
  495. updateTime: updateTime,
  496. );
  497. factory DictionaryDTO.fromJson(Map<String, dynamic> map) {
  498. return DictionaryDTO(
  499. dictionaryCode: map['DictionaryCode'],
  500. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  501. value: map['Value'],
  502. parentCode: map['ParentCode'],
  503. languageConfigs: map['LanguageConfigs'] != null ? (map['LanguageConfigs'] as List).map((e)=>DictionaryLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  504. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  505. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  506. );
  507. }
  508. Map<String, dynamic> toJson() {
  509. final map = super.toJson();
  510. if(dictionaryCode != null)
  511. map['DictionaryCode'] = dictionaryCode;
  512. map['DictionaryType'] = dictionaryType.index;
  513. if(value != null)
  514. map['Value'] = value;
  515. if(parentCode != null)
  516. map['ParentCode'] = parentCode;
  517. if(languageConfigs != null)
  518. map['LanguageConfigs'] = languageConfigs;
  519. return map;
  520. }
  521. }
  522. class FindDeviceModelItemsRequest extends TokenRequest{
  523. DictionaryTypeEnum dictionaryType;
  524. String? deviceTypeCode;
  525. FindDeviceModelItemsRequest({
  526. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  527. this.deviceTypeCode,
  528. String? token,
  529. }) : super(
  530. token: token,
  531. );
  532. factory FindDeviceModelItemsRequest.fromJson(Map<String, dynamic> map) {
  533. return FindDeviceModelItemsRequest(
  534. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  535. deviceTypeCode: map['DeviceTypeCode'],
  536. token: map['Token'],
  537. );
  538. }
  539. Map<String, dynamic> toJson() {
  540. final map = super.toJson();
  541. map['DictionaryType'] = dictionaryType.index;
  542. if(deviceTypeCode != null)
  543. map['DeviceTypeCode'] = deviceTypeCode;
  544. return map;
  545. }
  546. }
  547. class FindDeviceTypeItemsRequest extends TokenRequest{
  548. DictionaryTypeEnum dictionaryType;
  549. FindDeviceTypeItemsRequest({
  550. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  551. String? token,
  552. }) : super(
  553. token: token,
  554. );
  555. factory FindDeviceTypeItemsRequest.fromJson(Map<String, dynamic> map) {
  556. return FindDeviceTypeItemsRequest(
  557. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  558. token: map['Token'],
  559. );
  560. }
  561. Map<String, dynamic> toJson() {
  562. final map = super.toJson();
  563. map['DictionaryType'] = dictionaryType.index;
  564. return map;
  565. }
  566. }
  567. class CreateShareDeviceToUserRequest extends TokenRequest{
  568. List<String >? userCodes;
  569. String? deviceCode;
  570. CreateShareDeviceToUserRequest({
  571. this.userCodes,
  572. this.deviceCode,
  573. String? token,
  574. }) : super(
  575. token: token,
  576. );
  577. factory CreateShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  578. return CreateShareDeviceToUserRequest(
  579. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  580. deviceCode: map['DeviceCode'],
  581. token: map['Token'],
  582. );
  583. }
  584. Map<String, dynamic> toJson() {
  585. final map = super.toJson();
  586. if(userCodes != null)
  587. map['UserCodes'] = userCodes;
  588. if(deviceCode != null)
  589. map['DeviceCode'] = deviceCode;
  590. return map;
  591. }
  592. }
  593. class DeleteShareDeviceToUserRequest extends TokenRequest{
  594. List<String >? userCodes;
  595. String? deviceCode;
  596. DeleteShareDeviceToUserRequest({
  597. this.userCodes,
  598. this.deviceCode,
  599. String? token,
  600. }) : super(
  601. token: token,
  602. );
  603. factory DeleteShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  604. return DeleteShareDeviceToUserRequest(
  605. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  606. deviceCode: map['DeviceCode'],
  607. token: map['Token'],
  608. );
  609. }
  610. Map<String, dynamic> toJson() {
  611. final map = super.toJson();
  612. if(userCodes != null)
  613. map['UserCodes'] = userCodes;
  614. if(deviceCode != null)
  615. map['DeviceCode'] = deviceCode;
  616. return map;
  617. }
  618. }
  619. class RemoveDeviceRelevancyRequest extends TokenRequest{
  620. String? organizationCode;
  621. String? departmentCode;
  622. String? deviceCode;
  623. RemoveDeviceRelevancyRequest({
  624. this.organizationCode,
  625. this.departmentCode,
  626. this.deviceCode,
  627. String? token,
  628. }) : super(
  629. token: token,
  630. );
  631. factory RemoveDeviceRelevancyRequest.fromJson(Map<String, dynamic> map) {
  632. return RemoveDeviceRelevancyRequest(
  633. organizationCode: map['OrganizationCode'],
  634. departmentCode: map['DepartmentCode'],
  635. deviceCode: map['DeviceCode'],
  636. token: map['Token'],
  637. );
  638. }
  639. Map<String, dynamic> toJson() {
  640. final map = super.toJson();
  641. if(organizationCode != null)
  642. map['OrganizationCode'] = organizationCode;
  643. if(departmentCode != null)
  644. map['DepartmentCode'] = departmentCode;
  645. if(deviceCode != null)
  646. map['DeviceCode'] = deviceCode;
  647. return map;
  648. }
  649. }
  650. class GetPersonDeviceRequest extends PageRequest{
  651. String? keyWord;
  652. String? deviceType;
  653. String? deviceModel;
  654. bool? isOnline;
  655. GetPersonDeviceRequest({
  656. this.keyWord,
  657. this.deviceType,
  658. this.deviceModel,
  659. this.isOnline,
  660. int pageIndex = 0,
  661. int pageSize = 0,
  662. String? token,
  663. }) : super(
  664. pageIndex: pageIndex,
  665. pageSize: pageSize,
  666. token: token,
  667. );
  668. factory GetPersonDeviceRequest.fromJson(Map<String, dynamic> map) {
  669. return GetPersonDeviceRequest(
  670. keyWord: map['KeyWord'],
  671. deviceType: map['DeviceType'],
  672. deviceModel: map['DeviceModel'],
  673. isOnline: map['IsOnline'],
  674. pageIndex: map['PageIndex'],
  675. pageSize: map['PageSize'],
  676. token: map['Token'],
  677. );
  678. }
  679. Map<String, dynamic> toJson() {
  680. final map = super.toJson();
  681. if(keyWord != null)
  682. map['KeyWord'] = keyWord;
  683. if(deviceType != null)
  684. map['DeviceType'] = deviceType;
  685. if(deviceModel != null)
  686. map['DeviceModel'] = deviceModel;
  687. if(isOnline != null)
  688. map['IsOnline'] = isOnline;
  689. return map;
  690. }
  691. }
  692. class FindDevicesByOrganizationCodeRequest extends TokenRequest{
  693. String? organizationCode;
  694. FindDevicesByOrganizationCodeRequest({
  695. this.organizationCode,
  696. String? token,
  697. }) : super(
  698. token: token,
  699. );
  700. factory FindDevicesByOrganizationCodeRequest.fromJson(Map<String, dynamic> map) {
  701. return FindDevicesByOrganizationCodeRequest(
  702. organizationCode: map['OrganizationCode'],
  703. token: map['Token'],
  704. );
  705. }
  706. Map<String, dynamic> toJson() {
  707. final map = super.toJson();
  708. if(organizationCode != null)
  709. map['OrganizationCode'] = organizationCode;
  710. return map;
  711. }
  712. }
  713. class SelectItemDTO {
  714. String? key;
  715. String? value;
  716. SelectItemDTO({
  717. this.key,
  718. this.value,
  719. });
  720. factory SelectItemDTO.fromJson(Map<String, dynamic> map) {
  721. return SelectItemDTO(
  722. key: map['Key'],
  723. value: map['Value'],
  724. );
  725. }
  726. Map<String, dynamic> toJson() {
  727. final map = Map<String, dynamic>();
  728. if(key != null)
  729. map['Key'] = key;
  730. if(value != null)
  731. map['Value'] = value;
  732. return map;
  733. }
  734. }
  735. class DeviceServerSettingResult {
  736. Map<String,String>? serverConfigList;
  737. bool isUploadThumbnail;
  738. OrganizationPatientTypeEnum patientType;
  739. int heartRateSeconds;
  740. String? notificationUrl;
  741. bool mergedChannel;
  742. int liveConsultationRateSeconds;
  743. int mergedVideoOutputWidth;
  744. int mergedVideoOutputHeight;
  745. bool isSelfRtcService;
  746. int remoteControlAskTimeoutSec;
  747. DeviceServerSettingResult({
  748. this.serverConfigList,
  749. this.isUploadThumbnail = false,
  750. this.patientType = OrganizationPatientTypeEnum.Person,
  751. this.heartRateSeconds = 0,
  752. this.notificationUrl,
  753. this.mergedChannel = false,
  754. this.liveConsultationRateSeconds = 0,
  755. this.mergedVideoOutputWidth = 0,
  756. this.mergedVideoOutputHeight = 0,
  757. this.isSelfRtcService = false,
  758. this.remoteControlAskTimeoutSec = 0,
  759. });
  760. factory DeviceServerSettingResult.fromJson(Map<String, dynamic> map) {
  761. return DeviceServerSettingResult(
  762. serverConfigList: map['ServerConfigList'] != null ? map['ServerConfigList'].cast<String,String>() : null,
  763. isUploadThumbnail: map['IsUploadThumbnail'],
  764. patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  765. heartRateSeconds: map['HeartRateSeconds'],
  766. notificationUrl: map['NotificationUrl'],
  767. mergedChannel: map['MergedChannel'],
  768. liveConsultationRateSeconds: map['LiveConsultationRateSeconds'],
  769. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  770. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  771. isSelfRtcService: map['IsSelfRtcService'],
  772. remoteControlAskTimeoutSec: map['RemoteControlAskTimeoutSec'],
  773. );
  774. }
  775. Map<String, dynamic> toJson() {
  776. final map = Map<String, dynamic>();
  777. if(serverConfigList != null)
  778. map['ServerConfigList'] = serverConfigList;
  779. map['IsUploadThumbnail'] = isUploadThumbnail;
  780. map['PatientType'] = patientType.index;
  781. map['HeartRateSeconds'] = heartRateSeconds;
  782. if(notificationUrl != null)
  783. map['NotificationUrl'] = notificationUrl;
  784. map['MergedChannel'] = mergedChannel;
  785. map['LiveConsultationRateSeconds'] = liveConsultationRateSeconds;
  786. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  787. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  788. map['IsSelfRtcService'] = isSelfRtcService;
  789. map['RemoteControlAskTimeoutSec'] = remoteControlAskTimeoutSec;
  790. return map;
  791. }
  792. }
  793. class AddDeviceToOrgRequest extends TokenRequest{
  794. String? uniqueCode;
  795. AddDeviceToOrgRequest({
  796. this.uniqueCode,
  797. String? token,
  798. }) : super(
  799. token: token,
  800. );
  801. factory AddDeviceToOrgRequest.fromJson(Map<String, dynamic> map) {
  802. return AddDeviceToOrgRequest(
  803. uniqueCode: map['UniqueCode'],
  804. token: map['Token'],
  805. );
  806. }
  807. Map<String, dynamic> toJson() {
  808. final map = super.toJson();
  809. if(uniqueCode != null)
  810. map['UniqueCode'] = uniqueCode;
  811. return map;
  812. }
  813. }
  814. class DiagnosisModuleDTO extends BaseDTO{
  815. String? diagnosisModuleCode;
  816. String? diagnosisModule;
  817. bool enabled;
  818. DiagnosisModuleDTO({
  819. this.diagnosisModuleCode,
  820. this.diagnosisModule,
  821. this.enabled = false,
  822. DateTime? createTime,
  823. DateTime? updateTime,
  824. }) : super(
  825. createTime: createTime,
  826. updateTime: updateTime,
  827. );
  828. factory DiagnosisModuleDTO.fromJson(Map<String, dynamic> map) {
  829. return DiagnosisModuleDTO(
  830. diagnosisModuleCode: map['DiagnosisModuleCode'],
  831. diagnosisModule: map['DiagnosisModule'],
  832. enabled: map['Enabled'],
  833. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  834. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  835. );
  836. }
  837. Map<String, dynamic> toJson() {
  838. final map = super.toJson();
  839. if(diagnosisModuleCode != null)
  840. map['DiagnosisModuleCode'] = diagnosisModuleCode;
  841. if(diagnosisModule != null)
  842. map['DiagnosisModule'] = diagnosisModule;
  843. map['Enabled'] = enabled;
  844. return map;
  845. }
  846. }
  847. class FindDeviceDiagnosisModulesRequest extends TokenRequest{
  848. String? deviceCode;
  849. FindDeviceDiagnosisModulesRequest({
  850. this.deviceCode,
  851. String? token,
  852. }) : super(
  853. token: token,
  854. );
  855. factory FindDeviceDiagnosisModulesRequest.fromJson(Map<String, dynamic> map) {
  856. return FindDeviceDiagnosisModulesRequest(
  857. deviceCode: map['DeviceCode'],
  858. token: map['Token'],
  859. );
  860. }
  861. Map<String, dynamic> toJson() {
  862. final map = super.toJson();
  863. if(deviceCode != null)
  864. map['DeviceCode'] = deviceCode;
  865. return map;
  866. }
  867. }
  868. class ModifyDeviceDiagnosisModuleStateRequest extends TokenRequest{
  869. String? deviceCode;
  870. String? diagnosisModule;
  871. bool enabled;
  872. ModifyDeviceDiagnosisModuleStateRequest({
  873. this.deviceCode,
  874. this.diagnosisModule,
  875. this.enabled = false,
  876. String? token,
  877. }) : super(
  878. token: token,
  879. );
  880. factory ModifyDeviceDiagnosisModuleStateRequest.fromJson(Map<String, dynamic> map) {
  881. return ModifyDeviceDiagnosisModuleStateRequest(
  882. deviceCode: map['DeviceCode'],
  883. diagnosisModule: map['DiagnosisModule'],
  884. enabled: map['Enabled'],
  885. token: map['Token'],
  886. );
  887. }
  888. Map<String, dynamic> toJson() {
  889. final map = super.toJson();
  890. if(deviceCode != null)
  891. map['DeviceCode'] = deviceCode;
  892. if(diagnosisModule != null)
  893. map['DiagnosisModule'] = diagnosisModule;
  894. map['Enabled'] = enabled;
  895. return map;
  896. }
  897. }
  898. class ReportVideoDeviceInfoResult {
  899. bool success;
  900. List<VideoDeviceDTO >? videoDeviceOutputInfos;
  901. ReportVideoDeviceInfoResult({
  902. this.success = false,
  903. this.videoDeviceOutputInfos,
  904. });
  905. factory ReportVideoDeviceInfoResult.fromJson(Map<String, dynamic> map) {
  906. return ReportVideoDeviceInfoResult(
  907. success: map['Success'],
  908. videoDeviceOutputInfos: map['VideoDeviceOutputInfos'] != null ? (map['VideoDeviceOutputInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  909. );
  910. }
  911. Map<String, dynamic> toJson() {
  912. final map = Map<String, dynamic>();
  913. map['Success'] = success;
  914. if(videoDeviceOutputInfos != null)
  915. map['VideoDeviceOutputInfos'] = videoDeviceOutputInfos;
  916. return map;
  917. }
  918. }
  919. class VideoDeviceInfo {
  920. String? videoDeviceId;
  921. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  922. int width;
  923. int height;
  924. int videoFps;
  925. int videoBitrate;
  926. int minVideoBitrate;
  927. VideoDeviceInfo({
  928. this.videoDeviceId,
  929. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  930. this.width = 0,
  931. this.height = 0,
  932. this.videoFps = 0,
  933. this.videoBitrate = 0,
  934. this.minVideoBitrate = 0,
  935. });
  936. factory VideoDeviceInfo.fromJson(Map<String, dynamic> map) {
  937. return VideoDeviceInfo(
  938. videoDeviceId: map['VideoDeviceId'],
  939. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  940. width: map['Width'],
  941. height: map['Height'],
  942. videoFps: map['VideoFps'],
  943. videoBitrate: map['VideoBitrate'],
  944. minVideoBitrate: map['MinVideoBitrate'],
  945. );
  946. }
  947. Map<String, dynamic> toJson() {
  948. final map = Map<String, dynamic>();
  949. if(videoDeviceId != null)
  950. map['VideoDeviceId'] = videoDeviceId;
  951. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  952. map['Width'] = width;
  953. map['Height'] = height;
  954. map['VideoFps'] = videoFps;
  955. map['VideoBitrate'] = videoBitrate;
  956. map['MinVideoBitrate'] = minVideoBitrate;
  957. return map;
  958. }
  959. }
  960. class ReportVideoDeviceInfoRequest extends TokenRequest{
  961. bool liveOpened;
  962. List<VideoDeviceInfo >? videoDeviceInfos;
  963. ReportVideoDeviceInfoRequest({
  964. this.liveOpened = false,
  965. this.videoDeviceInfos,
  966. String? token,
  967. }) : super(
  968. token: token,
  969. );
  970. factory ReportVideoDeviceInfoRequest.fromJson(Map<String, dynamic> map) {
  971. return ReportVideoDeviceInfoRequest(
  972. liveOpened: map['LiveOpened'],
  973. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  974. token: map['Token'],
  975. );
  976. }
  977. Map<String, dynamic> toJson() {
  978. final map = super.toJson();
  979. map['LiveOpened'] = liveOpened;
  980. if(videoDeviceInfos != null)
  981. map['VideoDeviceInfos'] = videoDeviceInfos;
  982. return map;
  983. }
  984. }
  985. class ApplicationSettingInfoDTO {
  986. String? id;
  987. String? name;
  988. bool isPreferred;
  989. bool isUserDefined;
  990. bool isHidden;
  991. ApplicationSettingInfoDTO({
  992. this.id,
  993. this.name,
  994. this.isPreferred = false,
  995. this.isUserDefined = false,
  996. this.isHidden = false,
  997. });
  998. factory ApplicationSettingInfoDTO.fromJson(Map<String, dynamic> map) {
  999. return ApplicationSettingInfoDTO(
  1000. id: map['Id'],
  1001. name: map['Name'],
  1002. isPreferred: map['IsPreferred'],
  1003. isUserDefined: map['IsUserDefined'],
  1004. isHidden: map['IsHidden'],
  1005. );
  1006. }
  1007. Map<String, dynamic> toJson() {
  1008. final map = Map<String, dynamic>();
  1009. if(id != null)
  1010. map['Id'] = id;
  1011. if(name != null)
  1012. map['Name'] = name;
  1013. map['IsPreferred'] = isPreferred;
  1014. map['IsUserDefined'] = isUserDefined;
  1015. map['IsHidden'] = isHidden;
  1016. return map;
  1017. }
  1018. }
  1019. class ProbeInfoDTO {
  1020. String? name;
  1021. List<String >? applications;
  1022. List<ApplicationSettingInfoDTO >? applicationInfos;
  1023. ProbeInfoDTO({
  1024. this.name,
  1025. this.applications,
  1026. this.applicationInfos,
  1027. });
  1028. factory ProbeInfoDTO.fromJson(Map<String, dynamic> map) {
  1029. return ProbeInfoDTO(
  1030. name: map['Name'],
  1031. applications: map['Applications'] != null ? map['Applications'].cast<String>().toList() : null,
  1032. applicationInfos: map['ApplicationInfos'] != null ? (map['ApplicationInfos'] as List).map((e)=>ApplicationSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1033. );
  1034. }
  1035. Map<String, dynamic> toJson() {
  1036. final map = Map<String, dynamic>();
  1037. if(name != null)
  1038. map['Name'] = name;
  1039. if(applications != null)
  1040. map['Applications'] = applications;
  1041. if(applicationInfos != null)
  1042. map['ApplicationInfos'] = applicationInfos;
  1043. return map;
  1044. }
  1045. }
  1046. class ProbeApplicationInfoDTO {
  1047. List<ProbeInfoDTO >? probes;
  1048. String? activeProbe;
  1049. String? activeApplication;
  1050. ProbeApplicationInfoDTO({
  1051. this.probes,
  1052. this.activeProbe,
  1053. this.activeApplication,
  1054. });
  1055. factory ProbeApplicationInfoDTO.fromJson(Map<String, dynamic> map) {
  1056. return ProbeApplicationInfoDTO(
  1057. probes: map['Probes'] != null ? (map['Probes'] as List).map((e)=>ProbeInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1058. activeProbe: map['ActiveProbe'],
  1059. activeApplication: map['ActiveApplication'],
  1060. );
  1061. }
  1062. Map<String, dynamic> toJson() {
  1063. final map = Map<String, dynamic>();
  1064. if(probes != null)
  1065. map['Probes'] = probes;
  1066. if(activeProbe != null)
  1067. map['ActiveProbe'] = activeProbe;
  1068. if(activeApplication != null)
  1069. map['ActiveApplication'] = activeApplication;
  1070. return map;
  1071. }
  1072. }
  1073. class ControlParameterDTO {
  1074. bool canExecute;
  1075. List<ControlParameterDTO >? children;
  1076. String? description;
  1077. String? displayValue;
  1078. String? parentDescription;
  1079. String? valuesMapString;
  1080. ControlParameterDTO({
  1081. this.canExecute = false,
  1082. this.children,
  1083. this.description,
  1084. this.displayValue,
  1085. this.parentDescription,
  1086. this.valuesMapString,
  1087. });
  1088. factory ControlParameterDTO.fromJson(Map<String, dynamic> map) {
  1089. return ControlParameterDTO(
  1090. canExecute: map['CanExecute'],
  1091. children: map['Children'] != null ? (map['Children'] as List).map((e)=>ControlParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1092. description: map['Description'],
  1093. displayValue: map['DisplayValue'],
  1094. parentDescription: map['ParentDescription'],
  1095. valuesMapString: map['ValuesMapString'],
  1096. );
  1097. }
  1098. Map<String, dynamic> toJson() {
  1099. final map = Map<String, dynamic>();
  1100. map['CanExecute'] = canExecute;
  1101. if(children != null)
  1102. map['Children'] = children;
  1103. if(description != null)
  1104. map['Description'] = description;
  1105. if(displayValue != null)
  1106. map['DisplayValue'] = displayValue;
  1107. if(parentDescription != null)
  1108. map['ParentDescription'] = parentDescription;
  1109. if(valuesMapString != null)
  1110. map['ValuesMapString'] = valuesMapString;
  1111. return map;
  1112. }
  1113. }
  1114. class SendControlParameterByDeviceRequest extends TokenRequest{
  1115. String? controlUserCode;
  1116. ProbeApplicationInfoDTO? probeApplication;
  1117. ControlParameterDTO? parameter;
  1118. SendControlParameterByDeviceRequest({
  1119. this.controlUserCode,
  1120. this.probeApplication,
  1121. this.parameter,
  1122. String? token,
  1123. }) : super(
  1124. token: token,
  1125. );
  1126. factory SendControlParameterByDeviceRequest.fromJson(Map<String, dynamic> map) {
  1127. return SendControlParameterByDeviceRequest(
  1128. controlUserCode: map['ControlUserCode'],
  1129. probeApplication: map['ProbeApplication'] != null ? ProbeApplicationInfoDTO.fromJson(map['ProbeApplication']) : null,
  1130. parameter: map['Parameter'] != null ? ControlParameterDTO.fromJson(map['Parameter']) : null,
  1131. token: map['Token'],
  1132. );
  1133. }
  1134. Map<String, dynamic> toJson() {
  1135. final map = super.toJson();
  1136. if(controlUserCode != null)
  1137. map['ControlUserCode'] = controlUserCode;
  1138. if(probeApplication != null)
  1139. map['ProbeApplication'] = probeApplication;
  1140. if(parameter != null)
  1141. map['Parameter'] = parameter;
  1142. return map;
  1143. }
  1144. }
  1145. class LiveDataDTO {
  1146. int width;
  1147. int height;
  1148. String? rtmpPushUrl;
  1149. String? rtmpPullUrl;
  1150. String? httpPullUrl;
  1151. String? hlsPullUrl;
  1152. LiveDataDTO({
  1153. this.width = 0,
  1154. this.height = 0,
  1155. this.rtmpPushUrl,
  1156. this.rtmpPullUrl,
  1157. this.httpPullUrl,
  1158. this.hlsPullUrl,
  1159. });
  1160. factory LiveDataDTO.fromJson(Map<String, dynamic> map) {
  1161. return LiveDataDTO(
  1162. width: map['Width'],
  1163. height: map['Height'],
  1164. rtmpPushUrl: map['RtmpPushUrl'],
  1165. rtmpPullUrl: map['RtmpPullUrl'],
  1166. httpPullUrl: map['HttpPullUrl'],
  1167. hlsPullUrl: map['HlsPullUrl'],
  1168. );
  1169. }
  1170. Map<String, dynamic> toJson() {
  1171. final map = Map<String, dynamic>();
  1172. map['Width'] = width;
  1173. map['Height'] = height;
  1174. if(rtmpPushUrl != null)
  1175. map['RtmpPushUrl'] = rtmpPushUrl;
  1176. if(rtmpPullUrl != null)
  1177. map['RtmpPullUrl'] = rtmpPullUrl;
  1178. if(httpPullUrl != null)
  1179. map['HttpPullUrl'] = httpPullUrl;
  1180. if(hlsPullUrl != null)
  1181. map['HlsPullUrl'] = hlsPullUrl;
  1182. return map;
  1183. }
  1184. }
  1185. class VideoDeviceInfoDTO {
  1186. String? videoDeviceId;
  1187. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  1188. LiveDataDTO? liveData;
  1189. VideoDeviceInfoDTO({
  1190. this.videoDeviceId,
  1191. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  1192. this.liveData,
  1193. });
  1194. factory VideoDeviceInfoDTO.fromJson(Map<String, dynamic> map) {
  1195. return VideoDeviceInfoDTO(
  1196. videoDeviceId: map['VideoDeviceId'],
  1197. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  1198. liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null,
  1199. );
  1200. }
  1201. Map<String, dynamic> toJson() {
  1202. final map = Map<String, dynamic>();
  1203. if(videoDeviceId != null)
  1204. map['VideoDeviceId'] = videoDeviceId;
  1205. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  1206. if(liveData != null)
  1207. map['LiveData'] = liveData;
  1208. return map;
  1209. }
  1210. }
  1211. class JoinDeviceLiveRoomResult extends TokenRequest{
  1212. int roomNo;
  1213. List<VideoDeviceInfoDTO >? videoDeviceInfos;
  1214. int reportStateIntervalSeconds;
  1215. JoinDeviceLiveRoomResult({
  1216. this.roomNo = 0,
  1217. this.videoDeviceInfos,
  1218. this.reportStateIntervalSeconds = 0,
  1219. String? token,
  1220. }) : super(
  1221. token: token,
  1222. );
  1223. factory JoinDeviceLiveRoomResult.fromJson(Map<String, dynamic> map) {
  1224. return JoinDeviceLiveRoomResult(
  1225. roomNo: map['RoomNo'],
  1226. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1227. reportStateIntervalSeconds: map['ReportStateIntervalSeconds'],
  1228. token: map['Token'],
  1229. );
  1230. }
  1231. Map<String, dynamic> toJson() {
  1232. final map = super.toJson();
  1233. map['RoomNo'] = roomNo;
  1234. if(videoDeviceInfos != null)
  1235. map['VideoDeviceInfos'] = videoDeviceInfos;
  1236. map['ReportStateIntervalSeconds'] = reportStateIntervalSeconds;
  1237. return map;
  1238. }
  1239. }
  1240. class JoinDeviceLiveRoomRequest extends TokenRequest{
  1241. String? deviceCode;
  1242. JoinDeviceLiveRoomRequest({
  1243. this.deviceCode,
  1244. String? token,
  1245. }) : super(
  1246. token: token,
  1247. );
  1248. factory JoinDeviceLiveRoomRequest.fromJson(Map<String, dynamic> map) {
  1249. return JoinDeviceLiveRoomRequest(
  1250. deviceCode: map['DeviceCode'],
  1251. token: map['Token'],
  1252. );
  1253. }
  1254. Map<String, dynamic> toJson() {
  1255. final map = super.toJson();
  1256. if(deviceCode != null)
  1257. map['DeviceCode'] = deviceCode;
  1258. return map;
  1259. }
  1260. }
  1261. class LeaveDeviceLiveRoomRequest extends TokenRequest{
  1262. String? deviceCode;
  1263. LeaveDeviceLiveRoomRequest({
  1264. this.deviceCode,
  1265. String? token,
  1266. }) : super(
  1267. token: token,
  1268. );
  1269. factory LeaveDeviceLiveRoomRequest.fromJson(Map<String, dynamic> map) {
  1270. return LeaveDeviceLiveRoomRequest(
  1271. deviceCode: map['DeviceCode'],
  1272. token: map['Token'],
  1273. );
  1274. }
  1275. Map<String, dynamic> toJson() {
  1276. final map = super.toJson();
  1277. if(deviceCode != null)
  1278. map['DeviceCode'] = deviceCode;
  1279. return map;
  1280. }
  1281. }
  1282. class ReportLiveViewStateRequest extends TokenRequest{
  1283. String? deviceCode;
  1284. ReportLiveViewStateRequest({
  1285. this.deviceCode,
  1286. String? token,
  1287. }) : super(
  1288. token: token,
  1289. );
  1290. factory ReportLiveViewStateRequest.fromJson(Map<String, dynamic> map) {
  1291. return ReportLiveViewStateRequest(
  1292. deviceCode: map['DeviceCode'],
  1293. token: map['Token'],
  1294. );
  1295. }
  1296. Map<String, dynamic> toJson() {
  1297. final map = super.toJson();
  1298. if(deviceCode != null)
  1299. map['DeviceCode'] = deviceCode;
  1300. return map;
  1301. }
  1302. }
  1303. enum DeviceLiveStateEnum {
  1304. Default,
  1305. Pushing,
  1306. Closed,
  1307. Error,
  1308. Warning,
  1309. }
  1310. class ReportLiveStateRequest extends TokenRequest{
  1311. int roomNo;
  1312. DeviceLiveStateEnum liveState;
  1313. String? message;
  1314. ReportLiveStateRequest({
  1315. this.roomNo = 0,
  1316. this.liveState = DeviceLiveStateEnum.Default,
  1317. this.message,
  1318. String? token,
  1319. }) : super(
  1320. token: token,
  1321. );
  1322. factory ReportLiveStateRequest.fromJson(Map<String, dynamic> map) {
  1323. return ReportLiveStateRequest(
  1324. roomNo: map['RoomNo'],
  1325. liveState: DeviceLiveStateEnum.values.firstWhere((e) => e.index == map['LiveState']),
  1326. message: map['Message'],
  1327. token: map['Token'],
  1328. );
  1329. }
  1330. Map<String, dynamic> toJson() {
  1331. final map = super.toJson();
  1332. map['RoomNo'] = roomNo;
  1333. map['LiveState'] = liveState.index;
  1334. if(message != null)
  1335. map['Message'] = message;
  1336. return map;
  1337. }
  1338. }
  1339. class CreateLiveRoomInfoResult {
  1340. String? userCode;
  1341. String? userSign;
  1342. int roomNo;
  1343. int appId;
  1344. bool isTrtc;
  1345. CreateLiveRoomInfoResult({
  1346. this.userCode,
  1347. this.userSign,
  1348. this.roomNo = 0,
  1349. this.appId = 0,
  1350. this.isTrtc = false,
  1351. });
  1352. factory CreateLiveRoomInfoResult.fromJson(Map<String, dynamic> map) {
  1353. return CreateLiveRoomInfoResult(
  1354. userCode: map['UserCode'],
  1355. userSign: map['UserSign'],
  1356. roomNo: map['RoomNo'],
  1357. appId: map['AppId'],
  1358. isTrtc: map['IsTrtc'],
  1359. );
  1360. }
  1361. Map<String, dynamic> toJson() {
  1362. final map = Map<String, dynamic>();
  1363. if(userCode != null)
  1364. map['UserCode'] = userCode;
  1365. if(userSign != null)
  1366. map['UserSign'] = userSign;
  1367. map['RoomNo'] = roomNo;
  1368. map['AppId'] = appId;
  1369. map['IsTrtc'] = isTrtc;
  1370. return map;
  1371. }
  1372. }
  1373. class CreateLiveRoomInfoRequest {
  1374. String? deviceUniqueCode;
  1375. String? deviceModel;
  1376. String? deviceType;
  1377. String? softwareVersion;
  1378. CreateLiveRoomInfoRequest({
  1379. this.deviceUniqueCode,
  1380. this.deviceModel,
  1381. this.deviceType,
  1382. this.softwareVersion,
  1383. });
  1384. factory CreateLiveRoomInfoRequest.fromJson(Map<String, dynamic> map) {
  1385. return CreateLiveRoomInfoRequest(
  1386. deviceUniqueCode: map['DeviceUniqueCode'],
  1387. deviceModel: map['DeviceModel'],
  1388. deviceType: map['DeviceType'],
  1389. softwareVersion: map['SoftwareVersion'],
  1390. );
  1391. }
  1392. Map<String, dynamic> toJson() {
  1393. final map = Map<String, dynamic>();
  1394. if(deviceUniqueCode != null)
  1395. map['DeviceUniqueCode'] = deviceUniqueCode;
  1396. if(deviceModel != null)
  1397. map['DeviceModel'] = deviceModel;
  1398. if(deviceType != null)
  1399. map['DeviceType'] = deviceType;
  1400. if(softwareVersion != null)
  1401. map['SoftwareVersion'] = softwareVersion;
  1402. return map;
  1403. }
  1404. }
  1405. class RemoteControlRequest extends TokenRequest{
  1406. String? controlUserCode;
  1407. RemoteControlRequest({
  1408. this.controlUserCode,
  1409. String? token,
  1410. }) : super(
  1411. token: token,
  1412. );
  1413. factory RemoteControlRequest.fromJson(Map<String, dynamic> map) {
  1414. return RemoteControlRequest(
  1415. controlUserCode: map['ControlUserCode'],
  1416. token: map['Token'],
  1417. );
  1418. }
  1419. Map<String, dynamic> toJson() {
  1420. final map = super.toJson();
  1421. if(controlUserCode != null)
  1422. map['ControlUserCode'] = controlUserCode;
  1423. return map;
  1424. }
  1425. }
  1426. class UploadConsultationDataRequest extends TokenRequest{
  1427. String? consultationCode;
  1428. String? previewFileToken;
  1429. String? fileToken;
  1430. int fileSize;
  1431. String? coverImageToken;
  1432. String? applicationCategory;
  1433. String? application;
  1434. RemedicalFileDataTypeEnum fileDataType;
  1435. MeasuredResultsDTO? measuredResult;
  1436. ScanImageDTO? commentResult;
  1437. UploadConsultationDataRequest({
  1438. this.consultationCode,
  1439. this.previewFileToken,
  1440. this.fileToken,
  1441. this.fileSize = 0,
  1442. this.coverImageToken,
  1443. this.applicationCategory,
  1444. this.application,
  1445. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  1446. this.measuredResult,
  1447. this.commentResult,
  1448. String? token,
  1449. }) : super(
  1450. token: token,
  1451. );
  1452. factory UploadConsultationDataRequest.fromJson(Map<String, dynamic> map) {
  1453. return UploadConsultationDataRequest(
  1454. consultationCode: map['ConsultationCode'],
  1455. previewFileToken: map['PreviewFileToken'],
  1456. fileToken: map['FileToken'],
  1457. fileSize: map['FileSize'],
  1458. coverImageToken: map['CoverImageToken'],
  1459. applicationCategory: map['ApplicationCategory'],
  1460. application: map['Application'],
  1461. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  1462. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  1463. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  1464. token: map['Token'],
  1465. );
  1466. }
  1467. Map<String, dynamic> toJson() {
  1468. final map = super.toJson();
  1469. if(consultationCode != null)
  1470. map['ConsultationCode'] = consultationCode;
  1471. if(previewFileToken != null)
  1472. map['PreviewFileToken'] = previewFileToken;
  1473. if(fileToken != null)
  1474. map['FileToken'] = fileToken;
  1475. map['FileSize'] = fileSize;
  1476. if(coverImageToken != null)
  1477. map['CoverImageToken'] = coverImageToken;
  1478. if(applicationCategory != null)
  1479. map['ApplicationCategory'] = applicationCategory;
  1480. if(application != null)
  1481. map['Application'] = application;
  1482. map['FileDataType'] = fileDataType.index;
  1483. if(measuredResult != null)
  1484. map['MeasuredResult'] = measuredResult;
  1485. if(commentResult != null)
  1486. map['CommentResult'] = commentResult;
  1487. return map;
  1488. }
  1489. }
  1490. class DeviceControlParameterDataDTO {
  1491. String? deviceCode;
  1492. String? probeApplication;
  1493. String? parameter;
  1494. DeviceControlParameterDataDTO({
  1495. this.deviceCode,
  1496. this.probeApplication,
  1497. this.parameter,
  1498. });
  1499. factory DeviceControlParameterDataDTO.fromJson(Map<String, dynamic> map) {
  1500. return DeviceControlParameterDataDTO(
  1501. deviceCode: map['DeviceCode'],
  1502. probeApplication: map['ProbeApplication'],
  1503. parameter: map['Parameter'],
  1504. );
  1505. }
  1506. Map<String, dynamic> toJson() {
  1507. final map = Map<String, dynamic>();
  1508. if(deviceCode != null)
  1509. map['DeviceCode'] = deviceCode;
  1510. if(probeApplication != null)
  1511. map['ProbeApplication'] = probeApplication;
  1512. if(parameter != null)
  1513. map['Parameter'] = parameter;
  1514. return map;
  1515. }
  1516. }
  1517. class GetControlParametersRequest extends TokenRequest{
  1518. String? deviceCode;
  1519. GetControlParametersRequest({
  1520. this.deviceCode,
  1521. String? token,
  1522. }) : super(
  1523. token: token,
  1524. );
  1525. factory GetControlParametersRequest.fromJson(Map<String, dynamic> map) {
  1526. return GetControlParametersRequest(
  1527. deviceCode: map['DeviceCode'],
  1528. token: map['Token'],
  1529. );
  1530. }
  1531. Map<String, dynamic> toJson() {
  1532. final map = super.toJson();
  1533. if(deviceCode != null)
  1534. map['DeviceCode'] = deviceCode;
  1535. return map;
  1536. }
  1537. }
  1538. class ControlDeviceConnectRequest extends BaseControlDeviceRequest{
  1539. String? deviceCode;
  1540. ControlDeviceConnectRequest({
  1541. this.deviceCode,
  1542. ControlDeviceParameterEnum controlType = ControlDeviceParameterEnum.Start,
  1543. String? token,
  1544. }) : super(
  1545. controlType: controlType,
  1546. token: token,
  1547. );
  1548. factory ControlDeviceConnectRequest.fromJson(Map<String, dynamic> map) {
  1549. return ControlDeviceConnectRequest(
  1550. deviceCode: map['DeviceCode'],
  1551. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1552. token: map['Token'],
  1553. );
  1554. }
  1555. Map<String, dynamic> toJson() {
  1556. final map = super.toJson();
  1557. if(deviceCode != null)
  1558. map['DeviceCode'] = deviceCode;
  1559. return map;
  1560. }
  1561. }
  1562. class ControlDeviceResponseRequest extends BaseControlDeviceRequest{
  1563. String? userCode;
  1564. ControlDeviceResponseRequest({
  1565. this.userCode,
  1566. ControlDeviceParameterEnum controlType = ControlDeviceParameterEnum.Start,
  1567. String? token,
  1568. }) : super(
  1569. controlType: controlType,
  1570. token: token,
  1571. );
  1572. factory ControlDeviceResponseRequest.fromJson(Map<String, dynamic> map) {
  1573. return ControlDeviceResponseRequest(
  1574. userCode: map['UserCode'],
  1575. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1576. token: map['Token'],
  1577. );
  1578. }
  1579. Map<String, dynamic> toJson() {
  1580. final map = super.toJson();
  1581. if(userCode != null)
  1582. map['UserCode'] = userCode;
  1583. return map;
  1584. }
  1585. }
  1586. class ControlDeviceParameterRequest extends BaseControlDeviceParameterRequest{
  1587. String? deviceCode;
  1588. ControlDeviceParameterRequest({
  1589. this.deviceCode,
  1590. List<AdditionParameterDTO >? parameters,
  1591. ControlDeviceParameterEnum controlType = ControlDeviceParameterEnum.Start,
  1592. String? token,
  1593. }) : super(
  1594. parameters: parameters,
  1595. controlType: controlType,
  1596. token: token,
  1597. );
  1598. factory ControlDeviceParameterRequest.fromJson(Map<String, dynamic> map) {
  1599. return ControlDeviceParameterRequest(
  1600. deviceCode: map['DeviceCode'],
  1601. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1602. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1603. token: map['Token'],
  1604. );
  1605. }
  1606. Map<String, dynamic> toJson() {
  1607. final map = super.toJson();
  1608. if(deviceCode != null)
  1609. map['DeviceCode'] = deviceCode;
  1610. return map;
  1611. }
  1612. }
  1613. class GetRemoteLogRequest extends TokenRequest{
  1614. String? deviceCode;
  1615. DateTime? startTime;
  1616. DateTime? endTime;
  1617. GetRemoteLogRequest({
  1618. this.deviceCode,
  1619. this.startTime,
  1620. this.endTime,
  1621. String? token,
  1622. }) : super(
  1623. token: token,
  1624. );
  1625. factory GetRemoteLogRequest.fromJson(Map<String, dynamic> map) {
  1626. return GetRemoteLogRequest(
  1627. deviceCode: map['DeviceCode'],
  1628. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1629. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  1630. token: map['Token'],
  1631. );
  1632. }
  1633. Map<String, dynamic> toJson() {
  1634. final map = super.toJson();
  1635. if(deviceCode != null)
  1636. map['DeviceCode'] = deviceCode;
  1637. if(startTime != null)
  1638. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1639. if(endTime != null)
  1640. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  1641. return map;
  1642. }
  1643. }
  1644. class RemoteLogResponseRequest extends TokenRequest{
  1645. String? userCode;
  1646. String? logFileToken;
  1647. RemoteLogResponseRequest({
  1648. this.userCode,
  1649. this.logFileToken,
  1650. String? token,
  1651. }) : super(
  1652. token: token,
  1653. );
  1654. factory RemoteLogResponseRequest.fromJson(Map<String, dynamic> map) {
  1655. return RemoteLogResponseRequest(
  1656. userCode: map['UserCode'],
  1657. logFileToken: map['LogFileToken'],
  1658. token: map['Token'],
  1659. );
  1660. }
  1661. Map<String, dynamic> toJson() {
  1662. final map = super.toJson();
  1663. if(userCode != null)
  1664. map['UserCode'] = userCode;
  1665. if(logFileToken != null)
  1666. map['LogFileToken'] = logFileToken;
  1667. return map;
  1668. }
  1669. }
  1670. class ScanBindDeviceRequest extends TokenRequest{
  1671. String? shortCode;
  1672. ScanBindDeviceRequest({
  1673. this.shortCode,
  1674. String? token,
  1675. }) : super(
  1676. token: token,
  1677. );
  1678. factory ScanBindDeviceRequest.fromJson(Map<String, dynamic> map) {
  1679. return ScanBindDeviceRequest(
  1680. shortCode: map['ShortCode'],
  1681. token: map['Token'],
  1682. );
  1683. }
  1684. Map<String, dynamic> toJson() {
  1685. final map = super.toJson();
  1686. if(shortCode != null)
  1687. map['ShortCode'] = shortCode;
  1688. return map;
  1689. }
  1690. }