device.m.dart 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'package:fis_jsonrpc/utils.dart';
  4. import 'package:fis_common/json_convert.dart';
  5. class UploadDeviceDTO extends BaseDTO{
  6. String? serialNumber;
  7. String? deviceModel;
  8. String? deviceType;
  9. String? deviceSoftwareVersion;
  10. String? sDKSoftwareVersion;
  11. UploadDeviceDTO({
  12. this.serialNumber,
  13. this.deviceModel,
  14. this.deviceType,
  15. this.deviceSoftwareVersion,
  16. this.sDKSoftwareVersion,
  17. DateTime? createTime,
  18. DateTime? updateTime,
  19. }) : super(
  20. createTime: createTime,
  21. updateTime: updateTime,
  22. );
  23. factory UploadDeviceDTO.fromJson(Map<String, dynamic> map) {
  24. return UploadDeviceDTO(
  25. serialNumber: map['SerialNumber'],
  26. deviceModel: map['DeviceModel'],
  27. deviceType: map['DeviceType'],
  28. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  29. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  30. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  31. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  32. );
  33. }
  34. Map<String, dynamic> toJson() {
  35. final map = super.toJson();
  36. if(serialNumber != null)
  37. map['SerialNumber'] = serialNumber;
  38. if(deviceModel != null)
  39. map['DeviceModel'] = deviceModel;
  40. if(deviceType != null)
  41. map['DeviceType'] = deviceType;
  42. if(deviceSoftwareVersion != null)
  43. map['DeviceSoftwareVersion'] = deviceSoftwareVersion;
  44. if(sDKSoftwareVersion != null)
  45. map['SDKSoftwareVersion'] = sDKSoftwareVersion;
  46. return map;
  47. }
  48. }
  49. class CreateDeviceRequest extends UploadDeviceDTO{
  50. CreateDeviceRequest({
  51. String? serialNumber,
  52. String? deviceModel,
  53. String? deviceType,
  54. String? deviceSoftwareVersion,
  55. String? sDKSoftwareVersion,
  56. DateTime? createTime,
  57. DateTime? updateTime,
  58. }) : super(
  59. serialNumber: serialNumber,
  60. deviceModel: deviceModel,
  61. deviceType: deviceType,
  62. deviceSoftwareVersion: deviceSoftwareVersion,
  63. sDKSoftwareVersion: sDKSoftwareVersion,
  64. createTime: createTime,
  65. updateTime: updateTime,
  66. );
  67. factory CreateDeviceRequest.fromJson(Map<String, dynamic> map) {
  68. return CreateDeviceRequest(
  69. serialNumber: map['SerialNumber'],
  70. deviceModel: map['DeviceModel'],
  71. deviceType: map['DeviceType'],
  72. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  73. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  74. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  75. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  76. );
  77. }
  78. Map<String, dynamic> toJson() {
  79. final map = super.toJson();
  80. return map;
  81. }
  82. }
  83. class DictionaryLanguageConfigDTO {
  84. String? language;
  85. String? value;
  86. DictionaryLanguageConfigDTO({
  87. this.language,
  88. this.value,
  89. });
  90. factory DictionaryLanguageConfigDTO.fromJson(Map<String, dynamic> map) {
  91. return DictionaryLanguageConfigDTO(
  92. language: map['Language'],
  93. value: map['Value'],
  94. );
  95. }
  96. Map<String, dynamic> toJson() {
  97. final map = Map<String, dynamic>();
  98. if(language != null)
  99. map['Language'] = language;
  100. if(value != null)
  101. map['Value'] = value;
  102. return map;
  103. }
  104. }
  105. class DeviceExtendInfoDTO extends DeviceInfoDTO{
  106. String? organizationName;
  107. String? departmentName;
  108. bool isOnline;
  109. bool isLiving;
  110. String? organizationDirectorCode;
  111. String? organizationDirectorUserName;
  112. String? organizationDirectorFullName;
  113. List<DictionaryLanguageConfigDTO >? languageConfigs;
  114. bool isEmergencyDevice;
  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. this.isEmergencyDevice = false,
  125. String? deviceCode,
  126. String? serialNumber,
  127. String? password,
  128. String? name,
  129. String? description,
  130. String? deviceModel,
  131. String? deviceType,
  132. String? headPicUrl,
  133. String? deviceSoftwareVersion,
  134. String? sDKSoftwareVersion,
  135. String? organizationCode,
  136. String? departmentCode,
  137. String? shortCode,
  138. bool isAutoShared = false,
  139. bool isEncryptedShow = false,
  140. DateTime? lastLoginTime,
  141. String? systemVersion,
  142. String? cPUModel,
  143. String? systemLanguage,
  144. List<String >? diagnosisModules,
  145. List<String >? reportPosterCodes,
  146. bool mergedChannel = false,
  147. int mergedVideoOutputWidth = 0,
  148. int mergedVideoOutputHeight = 0,
  149. List<VideoDeviceDTO >? videoDeviceInfos,
  150. DownloadModeSettingEnum downloadModeSetting = DownloadModeSettingEnum.Auto,
  151. bool liveOpened = false,
  152. DateTime? createTime,
  153. DateTime? updateTime,
  154. }) : super(
  155. deviceCode: deviceCode,
  156. serialNumber: serialNumber,
  157. password: password,
  158. name: name,
  159. description: description,
  160. deviceModel: deviceModel,
  161. deviceType: deviceType,
  162. headPicUrl: headPicUrl,
  163. deviceSoftwareVersion: deviceSoftwareVersion,
  164. sDKSoftwareVersion: sDKSoftwareVersion,
  165. organizationCode: organizationCode,
  166. departmentCode: departmentCode,
  167. shortCode: shortCode,
  168. isAutoShared: isAutoShared,
  169. isEncryptedShow: isEncryptedShow,
  170. lastLoginTime: lastLoginTime,
  171. systemVersion: systemVersion,
  172. cPUModel: cPUModel,
  173. systemLanguage: systemLanguage,
  174. diagnosisModules: diagnosisModules,
  175. reportPosterCodes: reportPosterCodes,
  176. mergedChannel: mergedChannel,
  177. mergedVideoOutputWidth: mergedVideoOutputWidth,
  178. mergedVideoOutputHeight: mergedVideoOutputHeight,
  179. videoDeviceInfos: videoDeviceInfos,
  180. downloadModeSetting: downloadModeSetting,
  181. liveOpened: liveOpened,
  182. createTime: createTime,
  183. updateTime: updateTime,
  184. );
  185. factory DeviceExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  186. return DeviceExtendInfoDTO(
  187. organizationName: map['OrganizationName'],
  188. departmentName: map['DepartmentName'],
  189. isOnline: map['IsOnline'],
  190. isLiving: map['IsLiving'],
  191. organizationDirectorCode: map['OrganizationDirectorCode'],
  192. organizationDirectorUserName: map['OrganizationDirectorUserName'],
  193. organizationDirectorFullName: map['OrganizationDirectorFullName'],
  194. languageConfigs: map['LanguageConfigs'] != null ? (map['LanguageConfigs'] as List).map((e)=>DictionaryLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  195. isEmergencyDevice: map['IsEmergencyDevice'],
  196. deviceCode: map['DeviceCode'],
  197. serialNumber: map['SerialNumber'],
  198. password: map['Password'],
  199. name: map['Name'],
  200. description: map['Description'],
  201. deviceModel: map['DeviceModel'],
  202. deviceType: map['DeviceType'],
  203. headPicUrl: map['HeadPicUrl'],
  204. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  205. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  206. organizationCode: map['OrganizationCode'],
  207. departmentCode: map['DepartmentCode'],
  208. shortCode: map['ShortCode'],
  209. isAutoShared: map['IsAutoShared'],
  210. isEncryptedShow: map['IsEncryptedShow'],
  211. lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
  212. systemVersion: map['SystemVersion'],
  213. cPUModel: map['CPUModel'],
  214. systemLanguage: map['SystemLanguage'],
  215. diagnosisModules: map['DiagnosisModules'] != null ? map['DiagnosisModules'].cast<String>().toList() : null,
  216. reportPosterCodes: map['ReportPosterCodes'] != null ? map['ReportPosterCodes'].cast<String>().toList() : null,
  217. mergedChannel: map['MergedChannel'],
  218. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  219. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  220. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  221. downloadModeSetting: DownloadModeSettingEnum.values.firstWhere((e) => e.index == map['DownloadModeSetting']),
  222. liveOpened: map['LiveOpened'],
  223. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  224. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  225. );
  226. }
  227. Map<String, dynamic> toJson() {
  228. final map = super.toJson();
  229. if(organizationName != null)
  230. map['OrganizationName'] = organizationName;
  231. if(departmentName != null)
  232. map['DepartmentName'] = departmentName;
  233. map['IsOnline'] = isOnline;
  234. map['IsLiving'] = isLiving;
  235. if(organizationDirectorCode != null)
  236. map['OrganizationDirectorCode'] = organizationDirectorCode;
  237. if(organizationDirectorUserName != null)
  238. map['OrganizationDirectorUserName'] = organizationDirectorUserName;
  239. if(organizationDirectorFullName != null)
  240. map['OrganizationDirectorFullName'] = organizationDirectorFullName;
  241. if(languageConfigs != null)
  242. map['LanguageConfigs'] = languageConfigs;
  243. map['IsEmergencyDevice'] = isEmergencyDevice;
  244. return map;
  245. }
  246. }
  247. class GetDeviceRequest extends TokenRequest{
  248. String? deviceCode;
  249. bool isNeedSyn;
  250. GetDeviceRequest({
  251. this.deviceCode,
  252. this.isNeedSyn = false,
  253. String? token,
  254. }) : super(
  255. token: token,
  256. );
  257. factory GetDeviceRequest.fromJson(Map<String, dynamic> map) {
  258. return GetDeviceRequest(
  259. deviceCode: map['DeviceCode'],
  260. isNeedSyn: map['IsNeedSyn'],
  261. token: map['Token'],
  262. );
  263. }
  264. Map<String, dynamic> toJson() {
  265. final map = super.toJson();
  266. if(deviceCode != null)
  267. map['DeviceCode'] = deviceCode;
  268. map['IsNeedSyn'] = isNeedSyn;
  269. return map;
  270. }
  271. }
  272. class GetDeviceByShortCodeRequest extends TokenRequest{
  273. String? shortCode;
  274. GetDeviceByShortCodeRequest({
  275. this.shortCode,
  276. String? token,
  277. }) : super(
  278. token: token,
  279. );
  280. factory GetDeviceByShortCodeRequest.fromJson(Map<String, dynamic> map) {
  281. return GetDeviceByShortCodeRequest(
  282. shortCode: map['ShortCode'],
  283. token: map['Token'],
  284. );
  285. }
  286. Map<String, dynamic> toJson() {
  287. final map = super.toJson();
  288. if(shortCode != null)
  289. map['ShortCode'] = shortCode;
  290. return map;
  291. }
  292. }
  293. class PageCollection<T> {
  294. int currentPage;
  295. int pageSize;
  296. int dataCount;
  297. List<T>? pageData;
  298. PageCollection({
  299. this.currentPage = 0,
  300. this.pageSize = 0,
  301. this.dataCount = 0,
  302. this.pageData,
  303. });
  304. factory PageCollection.fromJson(Map<String, dynamic> map) {
  305. List<T> pageDataList = [];
  306. if (map['PageData'] != null) {
  307. pageDataList.addAll(
  308. (map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
  309. }
  310. return PageCollection(
  311. currentPage: map['CurrentPage'],
  312. pageSize: map['PageSize'],
  313. dataCount: map['DataCount'],
  314. pageData: pageDataList,
  315. );
  316. }
  317. Map<String, dynamic> toJson() {
  318. final map = Map<String, dynamic>();
  319. map['CurrentPage'] = currentPage;
  320. map['PageSize'] = pageSize;
  321. map['DataCount'] = dataCount;
  322. if(pageData != null)
  323. map['PageData'] = pageData;
  324. return map;
  325. }
  326. }
  327. class PageFilterRequest extends BaseRequest{
  328. int currentPage;
  329. int pageSize;
  330. Map<String,String>? filter;
  331. bool isFuzzy;
  332. PageFilterRequest({
  333. this.currentPage = 0,
  334. this.pageSize = 0,
  335. this.filter,
  336. this.isFuzzy = false,
  337. }) : super(
  338. );
  339. factory PageFilterRequest.fromJson(Map<String, dynamic> map) {
  340. return PageFilterRequest(
  341. currentPage: map['CurrentPage'],
  342. pageSize: map['PageSize'],
  343. filter: map['Filter'] != null ? map['Filter'].cast<String,String>() : null,
  344. isFuzzy: map['IsFuzzy'],
  345. );
  346. }
  347. Map<String, dynamic> toJson() {
  348. final map = super.toJson();
  349. map['CurrentPage'] = currentPage;
  350. map['PageSize'] = pageSize;
  351. if(filter != null)
  352. map['Filter'] = filter;
  353. map['IsFuzzy'] = isFuzzy;
  354. return map;
  355. }
  356. }
  357. class BindDeviceRequest extends TokenRequest{
  358. String? serialNumber;
  359. String? name;
  360. String? description;
  361. String? headPicUrl;
  362. String? organizationCode;
  363. String? departmentCode;
  364. String? shortCode;
  365. bool isAutoShared;
  366. BindDeviceRequest({
  367. this.serialNumber,
  368. this.name,
  369. this.description,
  370. this.headPicUrl,
  371. this.organizationCode,
  372. this.departmentCode,
  373. this.shortCode,
  374. this.isAutoShared = false,
  375. String? token,
  376. }) : super(
  377. token: token,
  378. );
  379. factory BindDeviceRequest.fromJson(Map<String, dynamic> map) {
  380. return BindDeviceRequest(
  381. serialNumber: map['SerialNumber'],
  382. name: map['Name'],
  383. description: map['Description'],
  384. headPicUrl: map['HeadPicUrl'],
  385. organizationCode: map['OrganizationCode'],
  386. departmentCode: map['DepartmentCode'],
  387. shortCode: map['ShortCode'],
  388. isAutoShared: map['IsAutoShared'],
  389. token: map['Token'],
  390. );
  391. }
  392. Map<String, dynamic> toJson() {
  393. final map = super.toJson();
  394. if(serialNumber != null)
  395. map['SerialNumber'] = serialNumber;
  396. if(name != null)
  397. map['Name'] = name;
  398. if(description != null)
  399. map['Description'] = description;
  400. if(headPicUrl != null)
  401. map['HeadPicUrl'] = headPicUrl;
  402. if(organizationCode != null)
  403. map['OrganizationCode'] = organizationCode;
  404. if(departmentCode != null)
  405. map['DepartmentCode'] = departmentCode;
  406. if(shortCode != null)
  407. map['ShortCode'] = shortCode;
  408. map['IsAutoShared'] = isAutoShared;
  409. return map;
  410. }
  411. }
  412. class ModifyDeviceRequest extends TokenRequest{
  413. String? deviceCode;
  414. String? name;
  415. String? headPicUrl;
  416. String? departmentCode;
  417. bool isAutoShared;
  418. ModifyDeviceRequest({
  419. this.deviceCode,
  420. this.name,
  421. this.headPicUrl,
  422. this.departmentCode,
  423. this.isAutoShared = false,
  424. String? token,
  425. }) : super(
  426. token: token,
  427. );
  428. factory ModifyDeviceRequest.fromJson(Map<String, dynamic> map) {
  429. return ModifyDeviceRequest(
  430. deviceCode: map['DeviceCode'],
  431. name: map['Name'],
  432. headPicUrl: map['HeadPicUrl'],
  433. departmentCode: map['DepartmentCode'],
  434. isAutoShared: map['IsAutoShared'],
  435. token: map['Token'],
  436. );
  437. }
  438. Map<String, dynamic> toJson() {
  439. final map = super.toJson();
  440. if(deviceCode != null)
  441. map['DeviceCode'] = deviceCode;
  442. if(name != null)
  443. map['Name'] = name;
  444. if(headPicUrl != null)
  445. map['HeadPicUrl'] = headPicUrl;
  446. if(departmentCode != null)
  447. map['DepartmentCode'] = departmentCode;
  448. map['IsAutoShared'] = isAutoShared;
  449. return map;
  450. }
  451. }
  452. enum DictionaryTypeEnum {
  453. DeviceModel,
  454. DeviceType,
  455. }
  456. class CreateDictionaryItemRequest extends TokenRequest{
  457. DictionaryTypeEnum dictionaryType;
  458. String? dictionaryItemValue;
  459. String? parentCode;
  460. CreateDictionaryItemRequest({
  461. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  462. this.dictionaryItemValue,
  463. this.parentCode,
  464. String? token,
  465. }) : super(
  466. token: token,
  467. );
  468. factory CreateDictionaryItemRequest.fromJson(Map<String, dynamic> map) {
  469. return CreateDictionaryItemRequest(
  470. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  471. dictionaryItemValue: map['DictionaryItemValue'],
  472. parentCode: map['ParentCode'],
  473. token: map['Token'],
  474. );
  475. }
  476. Map<String, dynamic> toJson() {
  477. final map = super.toJson();
  478. map['DictionaryType'] = dictionaryType.index;
  479. if(dictionaryItemValue != null)
  480. map['DictionaryItemValue'] = dictionaryItemValue;
  481. if(parentCode != null)
  482. map['ParentCode'] = parentCode;
  483. return map;
  484. }
  485. }
  486. class DictionaryDTO extends BaseDTO{
  487. String? dictionaryCode;
  488. DictionaryTypeEnum dictionaryType;
  489. String? value;
  490. String? parentCode;
  491. List<DictionaryLanguageConfigDTO >? languageConfigs;
  492. DictionaryDTO({
  493. this.dictionaryCode,
  494. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  495. this.value,
  496. this.parentCode,
  497. this.languageConfigs,
  498. DateTime? createTime,
  499. DateTime? updateTime,
  500. }) : super(
  501. createTime: createTime,
  502. updateTime: updateTime,
  503. );
  504. factory DictionaryDTO.fromJson(Map<String, dynamic> map) {
  505. return DictionaryDTO(
  506. dictionaryCode: map['DictionaryCode'],
  507. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  508. value: map['Value'],
  509. parentCode: map['ParentCode'],
  510. languageConfigs: map['LanguageConfigs'] != null ? (map['LanguageConfigs'] as List).map((e)=>DictionaryLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  511. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  512. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  513. );
  514. }
  515. Map<String, dynamic> toJson() {
  516. final map = super.toJson();
  517. if(dictionaryCode != null)
  518. map['DictionaryCode'] = dictionaryCode;
  519. map['DictionaryType'] = dictionaryType.index;
  520. if(value != null)
  521. map['Value'] = value;
  522. if(parentCode != null)
  523. map['ParentCode'] = parentCode;
  524. if(languageConfigs != null)
  525. map['LanguageConfigs'] = languageConfigs;
  526. return map;
  527. }
  528. }
  529. class FindDeviceModelItemsRequest extends TokenRequest{
  530. DictionaryTypeEnum dictionaryType;
  531. String? deviceTypeCode;
  532. FindDeviceModelItemsRequest({
  533. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  534. this.deviceTypeCode,
  535. String? token,
  536. }) : super(
  537. token: token,
  538. );
  539. factory FindDeviceModelItemsRequest.fromJson(Map<String, dynamic> map) {
  540. return FindDeviceModelItemsRequest(
  541. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  542. deviceTypeCode: map['DeviceTypeCode'],
  543. token: map['Token'],
  544. );
  545. }
  546. Map<String, dynamic> toJson() {
  547. final map = super.toJson();
  548. map['DictionaryType'] = dictionaryType.index;
  549. if(deviceTypeCode != null)
  550. map['DeviceTypeCode'] = deviceTypeCode;
  551. return map;
  552. }
  553. }
  554. class FindDeviceTypeItemsRequest extends TokenRequest{
  555. DictionaryTypeEnum dictionaryType;
  556. FindDeviceTypeItemsRequest({
  557. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  558. String? token,
  559. }) : super(
  560. token: token,
  561. );
  562. factory FindDeviceTypeItemsRequest.fromJson(Map<String, dynamic> map) {
  563. return FindDeviceTypeItemsRequest(
  564. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  565. token: map['Token'],
  566. );
  567. }
  568. Map<String, dynamic> toJson() {
  569. final map = super.toJson();
  570. map['DictionaryType'] = dictionaryType.index;
  571. return map;
  572. }
  573. }
  574. class CreateShareDeviceToUserRequest extends TokenRequest{
  575. List<String >? userCodes;
  576. String? deviceCode;
  577. CreateShareDeviceToUserRequest({
  578. this.userCodes,
  579. this.deviceCode,
  580. String? token,
  581. }) : super(
  582. token: token,
  583. );
  584. factory CreateShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  585. return CreateShareDeviceToUserRequest(
  586. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  587. deviceCode: map['DeviceCode'],
  588. token: map['Token'],
  589. );
  590. }
  591. Map<String, dynamic> toJson() {
  592. final map = super.toJson();
  593. if(userCodes != null)
  594. map['UserCodes'] = userCodes;
  595. if(deviceCode != null)
  596. map['DeviceCode'] = deviceCode;
  597. return map;
  598. }
  599. }
  600. class DeleteShareDeviceToUserRequest extends TokenRequest{
  601. List<String >? userCodes;
  602. String? deviceCode;
  603. DeleteShareDeviceToUserRequest({
  604. this.userCodes,
  605. this.deviceCode,
  606. String? token,
  607. }) : super(
  608. token: token,
  609. );
  610. factory DeleteShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  611. return DeleteShareDeviceToUserRequest(
  612. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  613. deviceCode: map['DeviceCode'],
  614. token: map['Token'],
  615. );
  616. }
  617. Map<String, dynamic> toJson() {
  618. final map = super.toJson();
  619. if(userCodes != null)
  620. map['UserCodes'] = userCodes;
  621. if(deviceCode != null)
  622. map['DeviceCode'] = deviceCode;
  623. return map;
  624. }
  625. }
  626. class RemoveDeviceRelevancyRequest extends TokenRequest{
  627. String? organizationCode;
  628. String? departmentCode;
  629. String? deviceCode;
  630. RemoveDeviceRelevancyRequest({
  631. this.organizationCode,
  632. this.departmentCode,
  633. this.deviceCode,
  634. String? token,
  635. }) : super(
  636. token: token,
  637. );
  638. factory RemoveDeviceRelevancyRequest.fromJson(Map<String, dynamic> map) {
  639. return RemoveDeviceRelevancyRequest(
  640. organizationCode: map['OrganizationCode'],
  641. departmentCode: map['DepartmentCode'],
  642. deviceCode: map['DeviceCode'],
  643. token: map['Token'],
  644. );
  645. }
  646. Map<String, dynamic> toJson() {
  647. final map = super.toJson();
  648. if(organizationCode != null)
  649. map['OrganizationCode'] = organizationCode;
  650. if(departmentCode != null)
  651. map['DepartmentCode'] = departmentCode;
  652. if(deviceCode != null)
  653. map['DeviceCode'] = deviceCode;
  654. return map;
  655. }
  656. }
  657. class GetPersonDeviceRequest extends PageRequest{
  658. String? keyWord;
  659. String? deviceType;
  660. String? deviceModel;
  661. bool? isOnline;
  662. GetPersonDeviceRequest({
  663. this.keyWord,
  664. this.deviceType,
  665. this.deviceModel,
  666. this.isOnline,
  667. int pageIndex = 0,
  668. int pageSize = 0,
  669. String? token,
  670. }) : super(
  671. pageIndex: pageIndex,
  672. pageSize: pageSize,
  673. token: token,
  674. );
  675. factory GetPersonDeviceRequest.fromJson(Map<String, dynamic> map) {
  676. return GetPersonDeviceRequest(
  677. keyWord: map['KeyWord'],
  678. deviceType: map['DeviceType'],
  679. deviceModel: map['DeviceModel'],
  680. isOnline: map['IsOnline'],
  681. pageIndex: map['PageIndex'],
  682. pageSize: map['PageSize'],
  683. token: map['Token'],
  684. );
  685. }
  686. Map<String, dynamic> toJson() {
  687. final map = super.toJson();
  688. if(keyWord != null)
  689. map['KeyWord'] = keyWord;
  690. if(deviceType != null)
  691. map['DeviceType'] = deviceType;
  692. if(deviceModel != null)
  693. map['DeviceModel'] = deviceModel;
  694. if(isOnline != null)
  695. map['IsOnline'] = isOnline;
  696. return map;
  697. }
  698. }
  699. class FindDevicesByOrganizationCodeRequest extends TokenRequest{
  700. String? organizationCode;
  701. FindDevicesByOrganizationCodeRequest({
  702. this.organizationCode,
  703. String? token,
  704. }) : super(
  705. token: token,
  706. );
  707. factory FindDevicesByOrganizationCodeRequest.fromJson(Map<String, dynamic> map) {
  708. return FindDevicesByOrganizationCodeRequest(
  709. organizationCode: map['OrganizationCode'],
  710. token: map['Token'],
  711. );
  712. }
  713. Map<String, dynamic> toJson() {
  714. final map = super.toJson();
  715. if(organizationCode != null)
  716. map['OrganizationCode'] = organizationCode;
  717. return map;
  718. }
  719. }
  720. class SelectItemDTO {
  721. String? key;
  722. String? value;
  723. SelectItemDTO({
  724. this.key,
  725. this.value,
  726. });
  727. factory SelectItemDTO.fromJson(Map<String, dynamic> map) {
  728. return SelectItemDTO(
  729. key: map['Key'],
  730. value: map['Value'],
  731. );
  732. }
  733. Map<String, dynamic> toJson() {
  734. final map = Map<String, dynamic>();
  735. if(key != null)
  736. map['Key'] = key;
  737. if(value != null)
  738. map['Value'] = value;
  739. return map;
  740. }
  741. }
  742. class DeviceServerSettingResult {
  743. Map<String,String>? serverConfigList;
  744. bool isUploadThumbnail;
  745. OrganizationPatientTypeEnum patientType;
  746. int heartRateSeconds;
  747. String? notificationUrl;
  748. bool mergedChannel;
  749. int liveConsultationRateSeconds;
  750. int mergedVideoOutputWidth;
  751. int mergedVideoOutputHeight;
  752. bool isSelfRtcService;
  753. int remoteControlAskTimeoutSec;
  754. String? liveProtocol;
  755. DeviceServerSettingResult({
  756. this.serverConfigList,
  757. this.isUploadThumbnail = false,
  758. this.patientType = OrganizationPatientTypeEnum.Person,
  759. this.heartRateSeconds = 0,
  760. this.notificationUrl,
  761. this.mergedChannel = false,
  762. this.liveConsultationRateSeconds = 0,
  763. this.mergedVideoOutputWidth = 0,
  764. this.mergedVideoOutputHeight = 0,
  765. this.isSelfRtcService = false,
  766. this.remoteControlAskTimeoutSec = 0,
  767. this.liveProtocol,
  768. });
  769. factory DeviceServerSettingResult.fromJson(Map<String, dynamic> map) {
  770. return DeviceServerSettingResult(
  771. serverConfigList: map['ServerConfigList'] != null ? map['ServerConfigList'].cast<String,String>() : null,
  772. isUploadThumbnail: map['IsUploadThumbnail'],
  773. patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
  774. heartRateSeconds: map['HeartRateSeconds'],
  775. notificationUrl: map['NotificationUrl'],
  776. mergedChannel: map['MergedChannel'],
  777. liveConsultationRateSeconds: map['LiveConsultationRateSeconds'],
  778. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  779. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  780. isSelfRtcService: map['IsSelfRtcService'],
  781. remoteControlAskTimeoutSec: map['RemoteControlAskTimeoutSec'],
  782. liveProtocol: map['LiveProtocol'],
  783. );
  784. }
  785. Map<String, dynamic> toJson() {
  786. final map = Map<String, dynamic>();
  787. if(serverConfigList != null)
  788. map['ServerConfigList'] = serverConfigList;
  789. map['IsUploadThumbnail'] = isUploadThumbnail;
  790. map['PatientType'] = patientType.index;
  791. map['HeartRateSeconds'] = heartRateSeconds;
  792. if(notificationUrl != null)
  793. map['NotificationUrl'] = notificationUrl;
  794. map['MergedChannel'] = mergedChannel;
  795. map['LiveConsultationRateSeconds'] = liveConsultationRateSeconds;
  796. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  797. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  798. map['IsSelfRtcService'] = isSelfRtcService;
  799. map['RemoteControlAskTimeoutSec'] = remoteControlAskTimeoutSec;
  800. if(liveProtocol != null)
  801. map['LiveProtocol'] = liveProtocol;
  802. return map;
  803. }
  804. }
  805. class AddDeviceToOrgRequest extends TokenRequest{
  806. String? uniqueCode;
  807. AddDeviceToOrgRequest({
  808. this.uniqueCode,
  809. String? token,
  810. }) : super(
  811. token: token,
  812. );
  813. factory AddDeviceToOrgRequest.fromJson(Map<String, dynamic> map) {
  814. return AddDeviceToOrgRequest(
  815. uniqueCode: map['UniqueCode'],
  816. token: map['Token'],
  817. );
  818. }
  819. Map<String, dynamic> toJson() {
  820. final map = super.toJson();
  821. if(uniqueCode != null)
  822. map['UniqueCode'] = uniqueCode;
  823. return map;
  824. }
  825. }
  826. class DiagnosisModuleDTO extends BaseDTO{
  827. String? diagnosisModuleCode;
  828. String? diagnosisModule;
  829. bool enabled;
  830. DiagnosisModuleDTO({
  831. this.diagnosisModuleCode,
  832. this.diagnosisModule,
  833. this.enabled = false,
  834. DateTime? createTime,
  835. DateTime? updateTime,
  836. }) : super(
  837. createTime: createTime,
  838. updateTime: updateTime,
  839. );
  840. factory DiagnosisModuleDTO.fromJson(Map<String, dynamic> map) {
  841. return DiagnosisModuleDTO(
  842. diagnosisModuleCode: map['DiagnosisModuleCode'],
  843. diagnosisModule: map['DiagnosisModule'],
  844. enabled: map['Enabled'],
  845. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  846. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  847. );
  848. }
  849. Map<String, dynamic> toJson() {
  850. final map = super.toJson();
  851. if(diagnosisModuleCode != null)
  852. map['DiagnosisModuleCode'] = diagnosisModuleCode;
  853. if(diagnosisModule != null)
  854. map['DiagnosisModule'] = diagnosisModule;
  855. map['Enabled'] = enabled;
  856. return map;
  857. }
  858. }
  859. class FindDeviceDiagnosisModulesRequest extends TokenRequest{
  860. String? deviceCode;
  861. FindDeviceDiagnosisModulesRequest({
  862. this.deviceCode,
  863. String? token,
  864. }) : super(
  865. token: token,
  866. );
  867. factory FindDeviceDiagnosisModulesRequest.fromJson(Map<String, dynamic> map) {
  868. return FindDeviceDiagnosisModulesRequest(
  869. deviceCode: map['DeviceCode'],
  870. token: map['Token'],
  871. );
  872. }
  873. Map<String, dynamic> toJson() {
  874. final map = super.toJson();
  875. if(deviceCode != null)
  876. map['DeviceCode'] = deviceCode;
  877. return map;
  878. }
  879. }
  880. class ModifyDeviceDiagnosisModuleStateRequest extends TokenRequest{
  881. String? deviceCode;
  882. String? diagnosisModule;
  883. bool enabled;
  884. ModifyDeviceDiagnosisModuleStateRequest({
  885. this.deviceCode,
  886. this.diagnosisModule,
  887. this.enabled = false,
  888. String? token,
  889. }) : super(
  890. token: token,
  891. );
  892. factory ModifyDeviceDiagnosisModuleStateRequest.fromJson(Map<String, dynamic> map) {
  893. return ModifyDeviceDiagnosisModuleStateRequest(
  894. deviceCode: map['DeviceCode'],
  895. diagnosisModule: map['DiagnosisModule'],
  896. enabled: map['Enabled'],
  897. token: map['Token'],
  898. );
  899. }
  900. Map<String, dynamic> toJson() {
  901. final map = super.toJson();
  902. if(deviceCode != null)
  903. map['DeviceCode'] = deviceCode;
  904. if(diagnosisModule != null)
  905. map['DiagnosisModule'] = diagnosisModule;
  906. map['Enabled'] = enabled;
  907. return map;
  908. }
  909. }
  910. class ReportVideoDeviceInfoResult {
  911. bool success;
  912. List<VideoDeviceDTO >? videoDeviceOutputInfos;
  913. ReportVideoDeviceInfoResult({
  914. this.success = false,
  915. this.videoDeviceOutputInfos,
  916. });
  917. factory ReportVideoDeviceInfoResult.fromJson(Map<String, dynamic> map) {
  918. return ReportVideoDeviceInfoResult(
  919. success: map['Success'],
  920. videoDeviceOutputInfos: map['VideoDeviceOutputInfos'] != null ? (map['VideoDeviceOutputInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  921. );
  922. }
  923. Map<String, dynamic> toJson() {
  924. final map = Map<String, dynamic>();
  925. map['Success'] = success;
  926. if(videoDeviceOutputInfos != null)
  927. map['VideoDeviceOutputInfos'] = videoDeviceOutputInfos;
  928. return map;
  929. }
  930. }
  931. class VideoDeviceInfo {
  932. String? videoDeviceId;
  933. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  934. int width;
  935. int height;
  936. int videoFps;
  937. int videoBitrate;
  938. int minVideoBitrate;
  939. VideoDeviceInfo({
  940. this.videoDeviceId,
  941. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  942. this.width = 0,
  943. this.height = 0,
  944. this.videoFps = 0,
  945. this.videoBitrate = 0,
  946. this.minVideoBitrate = 0,
  947. });
  948. factory VideoDeviceInfo.fromJson(Map<String, dynamic> map) {
  949. return VideoDeviceInfo(
  950. videoDeviceId: map['VideoDeviceId'],
  951. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  952. width: map['Width'],
  953. height: map['Height'],
  954. videoFps: map['VideoFps'],
  955. videoBitrate: map['VideoBitrate'],
  956. minVideoBitrate: map['MinVideoBitrate'],
  957. );
  958. }
  959. Map<String, dynamic> toJson() {
  960. final map = Map<String, dynamic>();
  961. if(videoDeviceId != null)
  962. map['VideoDeviceId'] = videoDeviceId;
  963. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  964. map['Width'] = width;
  965. map['Height'] = height;
  966. map['VideoFps'] = videoFps;
  967. map['VideoBitrate'] = videoBitrate;
  968. map['MinVideoBitrate'] = minVideoBitrate;
  969. return map;
  970. }
  971. }
  972. class ReportVideoDeviceInfoRequest extends TokenRequest{
  973. bool liveOpened;
  974. List<VideoDeviceInfo >? videoDeviceInfos;
  975. ReportVideoDeviceInfoRequest({
  976. this.liveOpened = false,
  977. this.videoDeviceInfos,
  978. String? token,
  979. }) : super(
  980. token: token,
  981. );
  982. factory ReportVideoDeviceInfoRequest.fromJson(Map<String, dynamic> map) {
  983. return ReportVideoDeviceInfoRequest(
  984. liveOpened: map['LiveOpened'],
  985. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  986. token: map['Token'],
  987. );
  988. }
  989. Map<String, dynamic> toJson() {
  990. final map = super.toJson();
  991. map['LiveOpened'] = liveOpened;
  992. if(videoDeviceInfos != null)
  993. map['VideoDeviceInfos'] = videoDeviceInfos;
  994. return map;
  995. }
  996. }
  997. class ApplicationSettingInfoDTO {
  998. String? id;
  999. String? name;
  1000. bool isPreferred;
  1001. bool isUserDefined;
  1002. bool isHidden;
  1003. ApplicationSettingInfoDTO({
  1004. this.id,
  1005. this.name,
  1006. this.isPreferred = false,
  1007. this.isUserDefined = false,
  1008. this.isHidden = false,
  1009. });
  1010. factory ApplicationSettingInfoDTO.fromJson(Map<String, dynamic> map) {
  1011. return ApplicationSettingInfoDTO(
  1012. id: map['Id'],
  1013. name: map['Name'],
  1014. isPreferred: map['IsPreferred'],
  1015. isUserDefined: map['IsUserDefined'],
  1016. isHidden: map['IsHidden'],
  1017. );
  1018. }
  1019. Map<String, dynamic> toJson() {
  1020. final map = Map<String, dynamic>();
  1021. if(id != null)
  1022. map['Id'] = id;
  1023. if(name != null)
  1024. map['Name'] = name;
  1025. map['IsPreferred'] = isPreferred;
  1026. map['IsUserDefined'] = isUserDefined;
  1027. map['IsHidden'] = isHidden;
  1028. return map;
  1029. }
  1030. }
  1031. class ProbeInfoDTO {
  1032. String? name;
  1033. List<String >? applications;
  1034. List<ApplicationSettingInfoDTO >? applicationInfos;
  1035. ProbeInfoDTO({
  1036. this.name,
  1037. this.applications,
  1038. this.applicationInfos,
  1039. });
  1040. factory ProbeInfoDTO.fromJson(Map<String, dynamic> map) {
  1041. return ProbeInfoDTO(
  1042. name: map['Name'],
  1043. applications: map['Applications'] != null ? map['Applications'].cast<String>().toList() : null,
  1044. applicationInfos: map['ApplicationInfos'] != null ? (map['ApplicationInfos'] as List).map((e)=>ApplicationSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1045. );
  1046. }
  1047. Map<String, dynamic> toJson() {
  1048. final map = Map<String, dynamic>();
  1049. if(name != null)
  1050. map['Name'] = name;
  1051. if(applications != null)
  1052. map['Applications'] = applications;
  1053. if(applicationInfos != null)
  1054. map['ApplicationInfos'] = applicationInfos;
  1055. return map;
  1056. }
  1057. }
  1058. class ProbeApplicationInfoDTO {
  1059. List<ProbeInfoDTO >? probes;
  1060. String? activeProbe;
  1061. String? activeApplication;
  1062. ProbeApplicationInfoDTO({
  1063. this.probes,
  1064. this.activeProbe,
  1065. this.activeApplication,
  1066. });
  1067. factory ProbeApplicationInfoDTO.fromJson(Map<String, dynamic> map) {
  1068. return ProbeApplicationInfoDTO(
  1069. probes: map['Probes'] != null ? (map['Probes'] as List).map((e)=>ProbeInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1070. activeProbe: map['ActiveProbe'],
  1071. activeApplication: map['ActiveApplication'],
  1072. );
  1073. }
  1074. Map<String, dynamic> toJson() {
  1075. final map = Map<String, dynamic>();
  1076. if(probes != null)
  1077. map['Probes'] = probes;
  1078. if(activeProbe != null)
  1079. map['ActiveProbe'] = activeProbe;
  1080. if(activeApplication != null)
  1081. map['ActiveApplication'] = activeApplication;
  1082. return map;
  1083. }
  1084. }
  1085. class ControlParameterDTO {
  1086. bool canExecute;
  1087. List<ControlParameterDTO >? children;
  1088. String? description;
  1089. String? displayValue;
  1090. String? parentDescription;
  1091. String? valuesMapString;
  1092. ControlParameterDTO({
  1093. this.canExecute = false,
  1094. this.children,
  1095. this.description,
  1096. this.displayValue,
  1097. this.parentDescription,
  1098. this.valuesMapString,
  1099. });
  1100. factory ControlParameterDTO.fromJson(Map<String, dynamic> map) {
  1101. return ControlParameterDTO(
  1102. canExecute: map['CanExecute'],
  1103. children: map['Children'] != null ? (map['Children'] as List).map((e)=>ControlParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1104. description: map['Description'],
  1105. displayValue: map['DisplayValue'],
  1106. parentDescription: map['ParentDescription'],
  1107. valuesMapString: map['ValuesMapString'],
  1108. );
  1109. }
  1110. Map<String, dynamic> toJson() {
  1111. final map = Map<String, dynamic>();
  1112. map['CanExecute'] = canExecute;
  1113. if(children != null)
  1114. map['Children'] = children;
  1115. if(description != null)
  1116. map['Description'] = description;
  1117. if(displayValue != null)
  1118. map['DisplayValue'] = displayValue;
  1119. if(parentDescription != null)
  1120. map['ParentDescription'] = parentDescription;
  1121. if(valuesMapString != null)
  1122. map['ValuesMapString'] = valuesMapString;
  1123. return map;
  1124. }
  1125. }
  1126. class SendControlParameterByDeviceRequest extends TokenRequest{
  1127. String? controlUserCode;
  1128. ProbeApplicationInfoDTO? probeApplication;
  1129. ControlParameterDTO? parameter;
  1130. SendControlParameterByDeviceRequest({
  1131. this.controlUserCode,
  1132. this.probeApplication,
  1133. this.parameter,
  1134. String? token,
  1135. }) : super(
  1136. token: token,
  1137. );
  1138. factory SendControlParameterByDeviceRequest.fromJson(Map<String, dynamic> map) {
  1139. return SendControlParameterByDeviceRequest(
  1140. controlUserCode: map['ControlUserCode'],
  1141. probeApplication: map['ProbeApplication'] != null ? ProbeApplicationInfoDTO.fromJson(map['ProbeApplication']) : null,
  1142. parameter: map['Parameter'] != null ? ControlParameterDTO.fromJson(map['Parameter']) : null,
  1143. token: map['Token'],
  1144. );
  1145. }
  1146. Map<String, dynamic> toJson() {
  1147. final map = super.toJson();
  1148. if(controlUserCode != null)
  1149. map['ControlUserCode'] = controlUserCode;
  1150. if(probeApplication != null)
  1151. map['ProbeApplication'] = probeApplication;
  1152. if(parameter != null)
  1153. map['Parameter'] = parameter;
  1154. return map;
  1155. }
  1156. }
  1157. class LiveDataDTO {
  1158. int width;
  1159. int height;
  1160. String? rtmpPushUrl;
  1161. String? rtmpPullUrl;
  1162. String? httpPullUrl;
  1163. String? hlsPullUrl;
  1164. LiveDataDTO({
  1165. this.width = 0,
  1166. this.height = 0,
  1167. this.rtmpPushUrl,
  1168. this.rtmpPullUrl,
  1169. this.httpPullUrl,
  1170. this.hlsPullUrl,
  1171. });
  1172. factory LiveDataDTO.fromJson(Map<String, dynamic> map) {
  1173. return LiveDataDTO(
  1174. width: map['Width'],
  1175. height: map['Height'],
  1176. rtmpPushUrl: map['RtmpPushUrl'],
  1177. rtmpPullUrl: map['RtmpPullUrl'],
  1178. httpPullUrl: map['HttpPullUrl'],
  1179. hlsPullUrl: map['HlsPullUrl'],
  1180. );
  1181. }
  1182. Map<String, dynamic> toJson() {
  1183. final map = Map<String, dynamic>();
  1184. map['Width'] = width;
  1185. map['Height'] = height;
  1186. if(rtmpPushUrl != null)
  1187. map['RtmpPushUrl'] = rtmpPushUrl;
  1188. if(rtmpPullUrl != null)
  1189. map['RtmpPullUrl'] = rtmpPullUrl;
  1190. if(httpPullUrl != null)
  1191. map['HttpPullUrl'] = httpPullUrl;
  1192. if(hlsPullUrl != null)
  1193. map['HlsPullUrl'] = hlsPullUrl;
  1194. return map;
  1195. }
  1196. }
  1197. class VideoDeviceInfoDTO {
  1198. String? videoDeviceId;
  1199. VideoDeviceSourceTypeEnum videoDeviceSourceType;
  1200. LiveDataDTO? liveData;
  1201. VideoDeviceInfoDTO({
  1202. this.videoDeviceId,
  1203. this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
  1204. this.liveData,
  1205. });
  1206. factory VideoDeviceInfoDTO.fromJson(Map<String, dynamic> map) {
  1207. return VideoDeviceInfoDTO(
  1208. videoDeviceId: map['VideoDeviceId'],
  1209. videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
  1210. liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null,
  1211. );
  1212. }
  1213. Map<String, dynamic> toJson() {
  1214. final map = Map<String, dynamic>();
  1215. if(videoDeviceId != null)
  1216. map['VideoDeviceId'] = videoDeviceId;
  1217. map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
  1218. if(liveData != null)
  1219. map['LiveData'] = liveData;
  1220. return map;
  1221. }
  1222. }
  1223. class JoinDeviceLiveRoomResult extends TokenRequest{
  1224. int roomNo;
  1225. String? liveProtocol;
  1226. String? deviceCode;
  1227. bool mergedChannel;
  1228. int mergedVideoOutputWidth;
  1229. int mergedVideoOutputHeight;
  1230. List<VideoDeviceInfoDTO >? videoDeviceInfos;
  1231. int reportStateIntervalSeconds;
  1232. JoinDeviceLiveRoomResult({
  1233. this.roomNo = 0,
  1234. this.liveProtocol,
  1235. this.deviceCode,
  1236. this.mergedChannel = false,
  1237. this.mergedVideoOutputWidth = 0,
  1238. this.mergedVideoOutputHeight = 0,
  1239. this.videoDeviceInfos,
  1240. this.reportStateIntervalSeconds = 0,
  1241. String? token,
  1242. }) : super(
  1243. token: token,
  1244. );
  1245. factory JoinDeviceLiveRoomResult.fromJson(Map<String, dynamic> map) {
  1246. return JoinDeviceLiveRoomResult(
  1247. roomNo: map['RoomNo'],
  1248. liveProtocol: map['LiveProtocol'],
  1249. deviceCode: map['DeviceCode'],
  1250. mergedChannel: map['MergedChannel'],
  1251. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  1252. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  1253. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1254. reportStateIntervalSeconds: map['ReportStateIntervalSeconds'],
  1255. token: map['Token'],
  1256. );
  1257. }
  1258. Map<String, dynamic> toJson() {
  1259. final map = super.toJson();
  1260. map['RoomNo'] = roomNo;
  1261. if(liveProtocol != null)
  1262. map['LiveProtocol'] = liveProtocol;
  1263. if(deviceCode != null)
  1264. map['DeviceCode'] = deviceCode;
  1265. map['MergedChannel'] = mergedChannel;
  1266. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  1267. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  1268. if(videoDeviceInfos != null)
  1269. map['VideoDeviceInfos'] = videoDeviceInfos;
  1270. map['ReportStateIntervalSeconds'] = reportStateIntervalSeconds;
  1271. return map;
  1272. }
  1273. }
  1274. class JoinDeviceLiveRoomRequest extends TokenRequest{
  1275. String? deviceCode;
  1276. JoinDeviceLiveRoomRequest({
  1277. this.deviceCode,
  1278. String? token,
  1279. }) : super(
  1280. token: token,
  1281. );
  1282. factory JoinDeviceLiveRoomRequest.fromJson(Map<String, dynamic> map) {
  1283. return JoinDeviceLiveRoomRequest(
  1284. deviceCode: map['DeviceCode'],
  1285. token: map['Token'],
  1286. );
  1287. }
  1288. Map<String, dynamic> toJson() {
  1289. final map = super.toJson();
  1290. if(deviceCode != null)
  1291. map['DeviceCode'] = deviceCode;
  1292. return map;
  1293. }
  1294. }
  1295. class LeaveDeviceLiveRoomRequest extends TokenRequest{
  1296. String? deviceCode;
  1297. LeaveDeviceLiveRoomRequest({
  1298. this.deviceCode,
  1299. String? token,
  1300. }) : super(
  1301. token: token,
  1302. );
  1303. factory LeaveDeviceLiveRoomRequest.fromJson(Map<String, dynamic> map) {
  1304. return LeaveDeviceLiveRoomRequest(
  1305. deviceCode: map['DeviceCode'],
  1306. token: map['Token'],
  1307. );
  1308. }
  1309. Map<String, dynamic> toJson() {
  1310. final map = super.toJson();
  1311. if(deviceCode != null)
  1312. map['DeviceCode'] = deviceCode;
  1313. return map;
  1314. }
  1315. }
  1316. class ReportLiveViewStateRequest extends TokenRequest{
  1317. String? deviceCode;
  1318. ReportLiveViewStateRequest({
  1319. this.deviceCode,
  1320. String? token,
  1321. }) : super(
  1322. token: token,
  1323. );
  1324. factory ReportLiveViewStateRequest.fromJson(Map<String, dynamic> map) {
  1325. return ReportLiveViewStateRequest(
  1326. deviceCode: map['DeviceCode'],
  1327. token: map['Token'],
  1328. );
  1329. }
  1330. Map<String, dynamic> toJson() {
  1331. final map = super.toJson();
  1332. if(deviceCode != null)
  1333. map['DeviceCode'] = deviceCode;
  1334. return map;
  1335. }
  1336. }
  1337. class CreateLiveShareInfoResult extends TokenRequest{
  1338. String? shareUrl;
  1339. CreateLiveShareInfoResult({
  1340. this.shareUrl,
  1341. String? token,
  1342. }) : super(
  1343. token: token,
  1344. );
  1345. factory CreateLiveShareInfoResult.fromJson(Map<String, dynamic> map) {
  1346. return CreateLiveShareInfoResult(
  1347. shareUrl: map['ShareUrl'],
  1348. token: map['Token'],
  1349. );
  1350. }
  1351. Map<String, dynamic> toJson() {
  1352. final map = super.toJson();
  1353. if(shareUrl != null)
  1354. map['ShareUrl'] = shareUrl;
  1355. return map;
  1356. }
  1357. }
  1358. class CreateLiveShareInfoRequest extends TokenRequest{
  1359. String? deviceCode;
  1360. CreateLiveShareInfoRequest({
  1361. this.deviceCode,
  1362. String? token,
  1363. }) : super(
  1364. token: token,
  1365. );
  1366. factory CreateLiveShareInfoRequest.fromJson(Map<String, dynamic> map) {
  1367. return CreateLiveShareInfoRequest(
  1368. deviceCode: map['DeviceCode'],
  1369. token: map['Token'],
  1370. );
  1371. }
  1372. Map<String, dynamic> toJson() {
  1373. final map = super.toJson();
  1374. if(deviceCode != null)
  1375. map['DeviceCode'] = deviceCode;
  1376. return map;
  1377. }
  1378. }
  1379. class JoinDeviceLiveRoomByShareResult {
  1380. int roomNo;
  1381. String? liveProtocol;
  1382. String? deviceCode;
  1383. bool mergedChannel;
  1384. int mergedVideoOutputWidth;
  1385. int mergedVideoOutputHeight;
  1386. List<VideoDeviceInfoDTO >? videoDeviceInfos;
  1387. int reportStateIntervalSeconds;
  1388. JoinDeviceLiveRoomByShareResult({
  1389. this.roomNo = 0,
  1390. this.liveProtocol,
  1391. this.deviceCode,
  1392. this.mergedChannel = false,
  1393. this.mergedVideoOutputWidth = 0,
  1394. this.mergedVideoOutputHeight = 0,
  1395. this.videoDeviceInfos,
  1396. this.reportStateIntervalSeconds = 0,
  1397. });
  1398. factory JoinDeviceLiveRoomByShareResult.fromJson(Map<String, dynamic> map) {
  1399. return JoinDeviceLiveRoomByShareResult(
  1400. roomNo: map['RoomNo'],
  1401. liveProtocol: map['LiveProtocol'],
  1402. deviceCode: map['DeviceCode'],
  1403. mergedChannel: map['MergedChannel'],
  1404. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  1405. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  1406. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1407. reportStateIntervalSeconds: map['ReportStateIntervalSeconds'],
  1408. );
  1409. }
  1410. Map<String, dynamic> toJson() {
  1411. final map = Map<String, dynamic>();
  1412. map['RoomNo'] = roomNo;
  1413. if(liveProtocol != null)
  1414. map['LiveProtocol'] = liveProtocol;
  1415. if(deviceCode != null)
  1416. map['DeviceCode'] = deviceCode;
  1417. map['MergedChannel'] = mergedChannel;
  1418. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  1419. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  1420. if(videoDeviceInfos != null)
  1421. map['VideoDeviceInfos'] = videoDeviceInfos;
  1422. map['ReportStateIntervalSeconds'] = reportStateIntervalSeconds;
  1423. return map;
  1424. }
  1425. }
  1426. class JoinDeviceLiveRoomByShareRequest {
  1427. String? shareCode;
  1428. JoinDeviceLiveRoomByShareRequest({
  1429. this.shareCode,
  1430. });
  1431. factory JoinDeviceLiveRoomByShareRequest.fromJson(Map<String, dynamic> map) {
  1432. return JoinDeviceLiveRoomByShareRequest(
  1433. shareCode: map['ShareCode'],
  1434. );
  1435. }
  1436. Map<String, dynamic> toJson() {
  1437. final map = Map<String, dynamic>();
  1438. if(shareCode != null)
  1439. map['ShareCode'] = shareCode;
  1440. return map;
  1441. }
  1442. }
  1443. class LeaveDeviceLiveRoomByShareRequest {
  1444. String? deviceCode;
  1445. String? viewerUniqueId;
  1446. LeaveDeviceLiveRoomByShareRequest({
  1447. this.deviceCode,
  1448. this.viewerUniqueId,
  1449. });
  1450. factory LeaveDeviceLiveRoomByShareRequest.fromJson(Map<String, dynamic> map) {
  1451. return LeaveDeviceLiveRoomByShareRequest(
  1452. deviceCode: map['DeviceCode'],
  1453. viewerUniqueId: map['ViewerUniqueId'],
  1454. );
  1455. }
  1456. Map<String, dynamic> toJson() {
  1457. final map = Map<String, dynamic>();
  1458. if(deviceCode != null)
  1459. map['DeviceCode'] = deviceCode;
  1460. if(viewerUniqueId != null)
  1461. map['ViewerUniqueId'] = viewerUniqueId;
  1462. return map;
  1463. }
  1464. }
  1465. class ReportLiveViewStateByShareRequest {
  1466. String? deviceCode;
  1467. String? viewerUniqueId;
  1468. ReportLiveViewStateByShareRequest({
  1469. this.deviceCode,
  1470. this.viewerUniqueId,
  1471. });
  1472. factory ReportLiveViewStateByShareRequest.fromJson(Map<String, dynamic> map) {
  1473. return ReportLiveViewStateByShareRequest(
  1474. deviceCode: map['DeviceCode'],
  1475. viewerUniqueId: map['ViewerUniqueId'],
  1476. );
  1477. }
  1478. Map<String, dynamic> toJson() {
  1479. final map = Map<String, dynamic>();
  1480. if(deviceCode != null)
  1481. map['DeviceCode'] = deviceCode;
  1482. if(viewerUniqueId != null)
  1483. map['ViewerUniqueId'] = viewerUniqueId;
  1484. return map;
  1485. }
  1486. }
  1487. enum DeviceLiveStateEnum {
  1488. Default,
  1489. Pushing,
  1490. Closed,
  1491. Error,
  1492. Warning,
  1493. }
  1494. class ReportLiveStateRequest extends TokenRequest{
  1495. int roomNo;
  1496. DeviceLiveStateEnum liveState;
  1497. String? message;
  1498. ReportLiveStateRequest({
  1499. this.roomNo = 0,
  1500. this.liveState = DeviceLiveStateEnum.Default,
  1501. this.message,
  1502. String? token,
  1503. }) : super(
  1504. token: token,
  1505. );
  1506. factory ReportLiveStateRequest.fromJson(Map<String, dynamic> map) {
  1507. return ReportLiveStateRequest(
  1508. roomNo: map['RoomNo'],
  1509. liveState: DeviceLiveStateEnum.values.firstWhere((e) => e.index == map['LiveState']),
  1510. message: map['Message'],
  1511. token: map['Token'],
  1512. );
  1513. }
  1514. Map<String, dynamic> toJson() {
  1515. final map = super.toJson();
  1516. map['RoomNo'] = roomNo;
  1517. map['LiveState'] = liveState.index;
  1518. if(message != null)
  1519. map['Message'] = message;
  1520. return map;
  1521. }
  1522. }
  1523. class CreateLiveRoomInfoResult {
  1524. String? userCode;
  1525. String? userSign;
  1526. int roomNo;
  1527. int appId;
  1528. bool isTrtc;
  1529. CreateLiveRoomInfoResult({
  1530. this.userCode,
  1531. this.userSign,
  1532. this.roomNo = 0,
  1533. this.appId = 0,
  1534. this.isTrtc = false,
  1535. });
  1536. factory CreateLiveRoomInfoResult.fromJson(Map<String, dynamic> map) {
  1537. return CreateLiveRoomInfoResult(
  1538. userCode: map['UserCode'],
  1539. userSign: map['UserSign'],
  1540. roomNo: map['RoomNo'],
  1541. appId: map['AppId'],
  1542. isTrtc: map['IsTrtc'],
  1543. );
  1544. }
  1545. Map<String, dynamic> toJson() {
  1546. final map = Map<String, dynamic>();
  1547. if(userCode != null)
  1548. map['UserCode'] = userCode;
  1549. if(userSign != null)
  1550. map['UserSign'] = userSign;
  1551. map['RoomNo'] = roomNo;
  1552. map['AppId'] = appId;
  1553. map['IsTrtc'] = isTrtc;
  1554. return map;
  1555. }
  1556. }
  1557. class CreateLiveRoomInfoRequest {
  1558. String? deviceUniqueCode;
  1559. String? deviceModel;
  1560. String? deviceType;
  1561. String? softwareVersion;
  1562. CreateLiveRoomInfoRequest({
  1563. this.deviceUniqueCode,
  1564. this.deviceModel,
  1565. this.deviceType,
  1566. this.softwareVersion,
  1567. });
  1568. factory CreateLiveRoomInfoRequest.fromJson(Map<String, dynamic> map) {
  1569. return CreateLiveRoomInfoRequest(
  1570. deviceUniqueCode: map['DeviceUniqueCode'],
  1571. deviceModel: map['DeviceModel'],
  1572. deviceType: map['DeviceType'],
  1573. softwareVersion: map['SoftwareVersion'],
  1574. );
  1575. }
  1576. Map<String, dynamic> toJson() {
  1577. final map = Map<String, dynamic>();
  1578. if(deviceUniqueCode != null)
  1579. map['DeviceUniqueCode'] = deviceUniqueCode;
  1580. if(deviceModel != null)
  1581. map['DeviceModel'] = deviceModel;
  1582. if(deviceType != null)
  1583. map['DeviceType'] = deviceType;
  1584. if(softwareVersion != null)
  1585. map['SoftwareVersion'] = softwareVersion;
  1586. return map;
  1587. }
  1588. }
  1589. class UploadConsultationDataRequest extends TokenRequest{
  1590. String? consultationCode;
  1591. String? previewFileToken;
  1592. String? fileToken;
  1593. int fileSize;
  1594. String? coverImageToken;
  1595. String? applicationCategory;
  1596. String? application;
  1597. RemedicalFileDataTypeEnum fileDataType;
  1598. MeasuredResultsDTO? measuredResult;
  1599. ScanImageDTO? commentResult;
  1600. UploadConsultationDataRequest({
  1601. this.consultationCode,
  1602. this.previewFileToken,
  1603. this.fileToken,
  1604. this.fileSize = 0,
  1605. this.coverImageToken,
  1606. this.applicationCategory,
  1607. this.application,
  1608. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  1609. this.measuredResult,
  1610. this.commentResult,
  1611. String? token,
  1612. }) : super(
  1613. token: token,
  1614. );
  1615. factory UploadConsultationDataRequest.fromJson(Map<String, dynamic> map) {
  1616. return UploadConsultationDataRequest(
  1617. consultationCode: map['ConsultationCode'],
  1618. previewFileToken: map['PreviewFileToken'],
  1619. fileToken: map['FileToken'],
  1620. fileSize: map['FileSize'],
  1621. coverImageToken: map['CoverImageToken'],
  1622. applicationCategory: map['ApplicationCategory'],
  1623. application: map['Application'],
  1624. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  1625. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  1626. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  1627. token: map['Token'],
  1628. );
  1629. }
  1630. Map<String, dynamic> toJson() {
  1631. final map = super.toJson();
  1632. if(consultationCode != null)
  1633. map['ConsultationCode'] = consultationCode;
  1634. if(previewFileToken != null)
  1635. map['PreviewFileToken'] = previewFileToken;
  1636. if(fileToken != null)
  1637. map['FileToken'] = fileToken;
  1638. map['FileSize'] = fileSize;
  1639. if(coverImageToken != null)
  1640. map['CoverImageToken'] = coverImageToken;
  1641. if(applicationCategory != null)
  1642. map['ApplicationCategory'] = applicationCategory;
  1643. if(application != null)
  1644. map['Application'] = application;
  1645. map['FileDataType'] = fileDataType.index;
  1646. if(measuredResult != null)
  1647. map['MeasuredResult'] = measuredResult;
  1648. if(commentResult != null)
  1649. map['CommentResult'] = commentResult;
  1650. return map;
  1651. }
  1652. }
  1653. class DeviceControlParameterDataDTO {
  1654. String? deviceCode;
  1655. String? probeApplication;
  1656. String? parameter;
  1657. DeviceControlParameterDataDTO({
  1658. this.deviceCode,
  1659. this.probeApplication,
  1660. this.parameter,
  1661. });
  1662. factory DeviceControlParameterDataDTO.fromJson(Map<String, dynamic> map) {
  1663. return DeviceControlParameterDataDTO(
  1664. deviceCode: map['DeviceCode'],
  1665. probeApplication: map['ProbeApplication'],
  1666. parameter: map['Parameter'],
  1667. );
  1668. }
  1669. Map<String, dynamic> toJson() {
  1670. final map = Map<String, dynamic>();
  1671. if(deviceCode != null)
  1672. map['DeviceCode'] = deviceCode;
  1673. if(probeApplication != null)
  1674. map['ProbeApplication'] = probeApplication;
  1675. if(parameter != null)
  1676. map['Parameter'] = parameter;
  1677. return map;
  1678. }
  1679. }
  1680. class GetControlParametersRequest extends TokenRequest{
  1681. String? deviceCode;
  1682. GetControlParametersRequest({
  1683. this.deviceCode,
  1684. String? token,
  1685. }) : super(
  1686. token: token,
  1687. );
  1688. factory GetControlParametersRequest.fromJson(Map<String, dynamic> map) {
  1689. return GetControlParametersRequest(
  1690. deviceCode: map['DeviceCode'],
  1691. token: map['Token'],
  1692. );
  1693. }
  1694. Map<String, dynamic> toJson() {
  1695. final map = super.toJson();
  1696. if(deviceCode != null)
  1697. map['DeviceCode'] = deviceCode;
  1698. return map;
  1699. }
  1700. }
  1701. class ControlDeviceConnectRequest extends BaseControlDeviceRequest{
  1702. String? deviceCode;
  1703. ControlDeviceConnectRequest({
  1704. this.deviceCode,
  1705. ControlDeviceParameterEnum controlType = ControlDeviceParameterEnum.Start,
  1706. bool isNeedSyn = false,
  1707. String? token,
  1708. }) : super(
  1709. controlType: controlType,
  1710. isNeedSyn: isNeedSyn,
  1711. token: token,
  1712. );
  1713. factory ControlDeviceConnectRequest.fromJson(Map<String, dynamic> map) {
  1714. return ControlDeviceConnectRequest(
  1715. deviceCode: map['DeviceCode'],
  1716. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1717. isNeedSyn: map['IsNeedSyn'],
  1718. token: map['Token'],
  1719. );
  1720. }
  1721. Map<String, dynamic> toJson() {
  1722. final map = super.toJson();
  1723. if(deviceCode != null)
  1724. map['DeviceCode'] = deviceCode;
  1725. return map;
  1726. }
  1727. }
  1728. class ControlDeviceParameterRequest extends BaseControlDeviceParameterRequest{
  1729. String? deviceCode;
  1730. ControlDeviceParameterRequest({
  1731. this.deviceCode,
  1732. List<AdditionParameterDTO >? parameters,
  1733. ControlDeviceParameterEnum controlType = ControlDeviceParameterEnum.Start,
  1734. bool isNeedSyn = false,
  1735. String? token,
  1736. }) : super(
  1737. parameters: parameters,
  1738. controlType: controlType,
  1739. isNeedSyn: isNeedSyn,
  1740. token: token,
  1741. );
  1742. factory ControlDeviceParameterRequest.fromJson(Map<String, dynamic> map) {
  1743. return ControlDeviceParameterRequest(
  1744. deviceCode: map['DeviceCode'],
  1745. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1746. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  1747. isNeedSyn: map['IsNeedSyn'],
  1748. token: map['Token'],
  1749. );
  1750. }
  1751. Map<String, dynamic> toJson() {
  1752. final map = super.toJson();
  1753. if(deviceCode != null)
  1754. map['DeviceCode'] = deviceCode;
  1755. return map;
  1756. }
  1757. }
  1758. class GetRemoteLogRequest extends TokenRequest{
  1759. String? deviceCode;
  1760. DateTime? startTime;
  1761. DateTime? endTime;
  1762. GetRemoteLogRequest({
  1763. this.deviceCode,
  1764. this.startTime,
  1765. this.endTime,
  1766. String? token,
  1767. }) : super(
  1768. token: token,
  1769. );
  1770. factory GetRemoteLogRequest.fromJson(Map<String, dynamic> map) {
  1771. return GetRemoteLogRequest(
  1772. deviceCode: map['DeviceCode'],
  1773. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1774. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  1775. token: map['Token'],
  1776. );
  1777. }
  1778. Map<String, dynamic> toJson() {
  1779. final map = super.toJson();
  1780. if(deviceCode != null)
  1781. map['DeviceCode'] = deviceCode;
  1782. if(startTime != null)
  1783. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1784. if(endTime != null)
  1785. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  1786. return map;
  1787. }
  1788. }
  1789. class RemoteLogResponseRequest extends TokenRequest{
  1790. String? userCode;
  1791. String? logFileToken;
  1792. int rate;
  1793. RemoteDeviceStateEnum remoteDeviceState;
  1794. RemoteLogResponseRequest({
  1795. this.userCode,
  1796. this.logFileToken,
  1797. this.rate = 0,
  1798. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  1799. String? token,
  1800. }) : super(
  1801. token: token,
  1802. );
  1803. factory RemoteLogResponseRequest.fromJson(Map<String, dynamic> map) {
  1804. return RemoteLogResponseRequest(
  1805. userCode: map['UserCode'],
  1806. logFileToken: map['LogFileToken'],
  1807. rate: map['Rate'],
  1808. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  1809. token: map['Token'],
  1810. );
  1811. }
  1812. Map<String, dynamic> toJson() {
  1813. final map = super.toJson();
  1814. if(userCode != null)
  1815. map['UserCode'] = userCode;
  1816. if(logFileToken != null)
  1817. map['LogFileToken'] = logFileToken;
  1818. map['Rate'] = rate;
  1819. map['RemoteDeviceState'] = remoteDeviceState.index;
  1820. return map;
  1821. }
  1822. }
  1823. class ScanBindDeviceRequest extends TokenRequest{
  1824. String? shortCode;
  1825. ScanBindDeviceRequest({
  1826. this.shortCode,
  1827. String? token,
  1828. }) : super(
  1829. token: token,
  1830. );
  1831. factory ScanBindDeviceRequest.fromJson(Map<String, dynamic> map) {
  1832. return ScanBindDeviceRequest(
  1833. shortCode: map['ShortCode'],
  1834. token: map['Token'],
  1835. );
  1836. }
  1837. Map<String, dynamic> toJson() {
  1838. final map = super.toJson();
  1839. if(shortCode != null)
  1840. map['ShortCode'] = shortCode;
  1841. return map;
  1842. }
  1843. }
  1844. class ReportBrandModelOutputConfigRequest extends TokenRequest{
  1845. String? brand;
  1846. String? model;
  1847. String? shortCode;
  1848. int videoWidth;
  1849. int videoHeight;
  1850. ReportBrandModelOutputConfigRequest({
  1851. this.brand,
  1852. this.model,
  1853. this.shortCode,
  1854. this.videoWidth = 0,
  1855. this.videoHeight = 0,
  1856. String? token,
  1857. }) : super(
  1858. token: token,
  1859. );
  1860. factory ReportBrandModelOutputConfigRequest.fromJson(Map<String, dynamic> map) {
  1861. return ReportBrandModelOutputConfigRequest(
  1862. brand: map['Brand'],
  1863. model: map['Model'],
  1864. shortCode: map['ShortCode'],
  1865. videoWidth: map['VideoWidth'],
  1866. videoHeight: map['VideoHeight'],
  1867. token: map['Token'],
  1868. );
  1869. }
  1870. Map<String, dynamic> toJson() {
  1871. final map = super.toJson();
  1872. if(brand != null)
  1873. map['Brand'] = brand;
  1874. if(model != null)
  1875. map['Model'] = model;
  1876. if(shortCode != null)
  1877. map['ShortCode'] = shortCode;
  1878. map['VideoWidth'] = videoWidth;
  1879. map['VideoHeight'] = videoHeight;
  1880. return map;
  1881. }
  1882. }
  1883. class BrandModelOutputConfigDTO {
  1884. bool isSelect;
  1885. int videoWidth;
  1886. int videoHeight;
  1887. BrandModelOutputConfigDTO({
  1888. this.isSelect = false,
  1889. this.videoWidth = 0,
  1890. this.videoHeight = 0,
  1891. });
  1892. factory BrandModelOutputConfigDTO.fromJson(Map<String, dynamic> map) {
  1893. return BrandModelOutputConfigDTO(
  1894. isSelect: map['IsSelect'],
  1895. videoWidth: map['VideoWidth'],
  1896. videoHeight: map['VideoHeight'],
  1897. );
  1898. }
  1899. Map<String, dynamic> toJson() {
  1900. final map = Map<String, dynamic>();
  1901. map['IsSelect'] = isSelect;
  1902. map['VideoWidth'] = videoWidth;
  1903. map['VideoHeight'] = videoHeight;
  1904. return map;
  1905. }
  1906. }
  1907. class SyncBrandModelOutputConfigRequest extends TokenRequest{
  1908. String? brand;
  1909. String? model;
  1910. String? shortCode;
  1911. SyncBrandModelOutputConfigRequest({
  1912. this.brand,
  1913. this.model,
  1914. this.shortCode,
  1915. String? token,
  1916. }) : super(
  1917. token: token,
  1918. );
  1919. factory SyncBrandModelOutputConfigRequest.fromJson(Map<String, dynamic> map) {
  1920. return SyncBrandModelOutputConfigRequest(
  1921. brand: map['Brand'],
  1922. model: map['Model'],
  1923. shortCode: map['ShortCode'],
  1924. token: map['Token'],
  1925. );
  1926. }
  1927. Map<String, dynamic> toJson() {
  1928. final map = super.toJson();
  1929. if(brand != null)
  1930. map['Brand'] = brand;
  1931. if(model != null)
  1932. map['Model'] = model;
  1933. if(shortCode != null)
  1934. map['ShortCode'] = shortCode;
  1935. return map;
  1936. }
  1937. }
  1938. class GetBrandsRequest extends TokenRequest{
  1939. GetBrandsRequest({
  1940. String? token,
  1941. }) : super(
  1942. token: token,
  1943. );
  1944. factory GetBrandsRequest.fromJson(Map<String, dynamic> map) {
  1945. return GetBrandsRequest(
  1946. token: map['Token'],
  1947. );
  1948. }
  1949. Map<String, dynamic> toJson() {
  1950. final map = super.toJson();
  1951. return map;
  1952. }
  1953. }
  1954. class GetModelsRequest extends TokenRequest{
  1955. String? brand;
  1956. GetModelsRequest({
  1957. this.brand,
  1958. String? token,
  1959. }) : super(
  1960. token: token,
  1961. );
  1962. factory GetModelsRequest.fromJson(Map<String, dynamic> map) {
  1963. return GetModelsRequest(
  1964. brand: map['Brand'],
  1965. token: map['Token'],
  1966. );
  1967. }
  1968. Map<String, dynamic> toJson() {
  1969. final map = super.toJson();
  1970. if(brand != null)
  1971. map['Brand'] = brand;
  1972. return map;
  1973. }
  1974. }
  1975. class AddDevicePatchRequest extends TokenRequest{
  1976. String? name;
  1977. String? description;
  1978. String? deviceType;
  1979. String? softwareVersion;
  1980. String? osVersion;
  1981. List<UploadDeviceFileInfoDTO >? fileUploadInfoList;
  1982. int fileSize;
  1983. String? fileName;
  1984. AddDevicePatchRequest({
  1985. this.name,
  1986. this.description,
  1987. this.deviceType,
  1988. this.softwareVersion,
  1989. this.osVersion,
  1990. this.fileUploadInfoList,
  1991. this.fileSize = 0,
  1992. this.fileName,
  1993. String? token,
  1994. }) : super(
  1995. token: token,
  1996. );
  1997. factory AddDevicePatchRequest.fromJson(Map<String, dynamic> map) {
  1998. return AddDevicePatchRequest(
  1999. name: map['Name'],
  2000. description: map['Description'],
  2001. deviceType: map['DeviceType'],
  2002. softwareVersion: map['SoftwareVersion'],
  2003. osVersion: map['OsVersion'],
  2004. fileUploadInfoList: map['FileUploadInfoList'] != null ? (map['FileUploadInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2005. fileSize: map['FileSize'],
  2006. fileName: map['FileName'],
  2007. token: map['Token'],
  2008. );
  2009. }
  2010. Map<String, dynamic> toJson() {
  2011. final map = super.toJson();
  2012. if(name != null)
  2013. map['Name'] = name;
  2014. if(description != null)
  2015. map['Description'] = description;
  2016. if(deviceType != null)
  2017. map['DeviceType'] = deviceType;
  2018. if(softwareVersion != null)
  2019. map['SoftwareVersion'] = softwareVersion;
  2020. if(osVersion != null)
  2021. map['OsVersion'] = osVersion;
  2022. if(fileUploadInfoList != null)
  2023. map['FileUploadInfoList'] = fileUploadInfoList;
  2024. map['FileSize'] = fileSize;
  2025. if(fileName != null)
  2026. map['FileName'] = fileName;
  2027. return map;
  2028. }
  2029. }
  2030. class DevicePatchDTO extends BaseDTO{
  2031. String? code;
  2032. String? name;
  2033. String? description;
  2034. String? deviceType;
  2035. String? softwareVersion;
  2036. String? osVersion;
  2037. List<UploadDeviceFileInfoDTO >? deviceFileInfoList;
  2038. int fileSize;
  2039. String? fileName;
  2040. DevicePatchDTO({
  2041. this.code,
  2042. this.name,
  2043. this.description,
  2044. this.deviceType,
  2045. this.softwareVersion,
  2046. this.osVersion,
  2047. this.deviceFileInfoList,
  2048. this.fileSize = 0,
  2049. this.fileName,
  2050. DateTime? createTime,
  2051. DateTime? updateTime,
  2052. }) : super(
  2053. createTime: createTime,
  2054. updateTime: updateTime,
  2055. );
  2056. factory DevicePatchDTO.fromJson(Map<String, dynamic> map) {
  2057. return DevicePatchDTO(
  2058. code: map['Code'],
  2059. name: map['Name'],
  2060. description: map['Description'],
  2061. deviceType: map['DeviceType'],
  2062. softwareVersion: map['SoftwareVersion'],
  2063. osVersion: map['OsVersion'],
  2064. deviceFileInfoList: map['DeviceFileInfoList'] != null ? (map['DeviceFileInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2065. fileSize: map['FileSize'],
  2066. fileName: map['FileName'],
  2067. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2068. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2069. );
  2070. }
  2071. Map<String, dynamic> toJson() {
  2072. final map = super.toJson();
  2073. if(code != null)
  2074. map['Code'] = code;
  2075. if(name != null)
  2076. map['Name'] = name;
  2077. if(description != null)
  2078. map['Description'] = description;
  2079. if(deviceType != null)
  2080. map['DeviceType'] = deviceType;
  2081. if(softwareVersion != null)
  2082. map['SoftwareVersion'] = softwareVersion;
  2083. if(osVersion != null)
  2084. map['OsVersion'] = osVersion;
  2085. if(deviceFileInfoList != null)
  2086. map['DeviceFileInfoList'] = deviceFileInfoList;
  2087. map['FileSize'] = fileSize;
  2088. if(fileName != null)
  2089. map['FileName'] = fileName;
  2090. return map;
  2091. }
  2092. }
  2093. class FindDevicePatchPageRequest extends PageRequest{
  2094. String? keyword;
  2095. FindDevicePatchPageRequest({
  2096. this.keyword,
  2097. int pageIndex = 0,
  2098. int pageSize = 0,
  2099. String? token,
  2100. }) : super(
  2101. pageIndex: pageIndex,
  2102. pageSize: pageSize,
  2103. token: token,
  2104. );
  2105. factory FindDevicePatchPageRequest.fromJson(Map<String, dynamic> map) {
  2106. return FindDevicePatchPageRequest(
  2107. keyword: map['Keyword'],
  2108. pageIndex: map['PageIndex'],
  2109. pageSize: map['PageSize'],
  2110. token: map['Token'],
  2111. );
  2112. }
  2113. Map<String, dynamic> toJson() {
  2114. final map = super.toJson();
  2115. if(keyword != null)
  2116. map['Keyword'] = keyword;
  2117. return map;
  2118. }
  2119. }
  2120. class DeleteDevicePatchByCodeRequest extends TokenRequest{
  2121. String? code;
  2122. DeleteDevicePatchByCodeRequest({
  2123. this.code,
  2124. String? token,
  2125. }) : super(
  2126. token: token,
  2127. );
  2128. factory DeleteDevicePatchByCodeRequest.fromJson(Map<String, dynamic> map) {
  2129. return DeleteDevicePatchByCodeRequest(
  2130. code: map['Code'],
  2131. token: map['Token'],
  2132. );
  2133. }
  2134. Map<String, dynamic> toJson() {
  2135. final map = super.toJson();
  2136. if(code != null)
  2137. map['Code'] = code;
  2138. return map;
  2139. }
  2140. }
  2141. class UpdateDevicePatchRequest extends TokenRequest{
  2142. String? code;
  2143. String? name;
  2144. String? description;
  2145. String? softwareVersion;
  2146. String? osVersion;
  2147. UpdateDevicePatchRequest({
  2148. this.code,
  2149. this.name,
  2150. this.description,
  2151. this.softwareVersion,
  2152. this.osVersion,
  2153. String? token,
  2154. }) : super(
  2155. token: token,
  2156. );
  2157. factory UpdateDevicePatchRequest.fromJson(Map<String, dynamic> map) {
  2158. return UpdateDevicePatchRequest(
  2159. code: map['Code'],
  2160. name: map['Name'],
  2161. description: map['Description'],
  2162. softwareVersion: map['SoftwareVersion'],
  2163. osVersion: map['OsVersion'],
  2164. token: map['Token'],
  2165. );
  2166. }
  2167. Map<String, dynamic> toJson() {
  2168. final map = super.toJson();
  2169. if(code != null)
  2170. map['Code'] = code;
  2171. if(name != null)
  2172. map['Name'] = name;
  2173. if(description != null)
  2174. map['Description'] = description;
  2175. if(softwareVersion != null)
  2176. map['SoftwareVersion'] = softwareVersion;
  2177. if(osVersion != null)
  2178. map['OsVersion'] = osVersion;
  2179. return map;
  2180. }
  2181. }
  2182. class PushDevicePatchRequest extends TokenRequest{
  2183. String? deviceCode;
  2184. String? patchCode;
  2185. PushDevicePatchEnum pushEnum;
  2186. PushDevicePatchRequest({
  2187. this.deviceCode,
  2188. this.patchCode,
  2189. this.pushEnum = PushDevicePatchEnum.Start,
  2190. String? token,
  2191. }) : super(
  2192. token: token,
  2193. );
  2194. factory PushDevicePatchRequest.fromJson(Map<String, dynamic> map) {
  2195. return PushDevicePatchRequest(
  2196. deviceCode: map['DeviceCode'],
  2197. patchCode: map['PatchCode'],
  2198. pushEnum: PushDevicePatchEnum.values.firstWhere((e) => e.index == map['PushEnum']),
  2199. token: map['Token'],
  2200. );
  2201. }
  2202. Map<String, dynamic> toJson() {
  2203. final map = super.toJson();
  2204. if(deviceCode != null)
  2205. map['DeviceCode'] = deviceCode;
  2206. if(patchCode != null)
  2207. map['PatchCode'] = patchCode;
  2208. map['PushEnum'] = pushEnum.index;
  2209. return map;
  2210. }
  2211. }
  2212. class FindPushDevicePatchPageRequest extends PageRequest{
  2213. String? keyword;
  2214. String? deviceCode;
  2215. FindPushDevicePatchPageRequest({
  2216. this.keyword,
  2217. this.deviceCode,
  2218. int pageIndex = 0,
  2219. int pageSize = 0,
  2220. String? token,
  2221. }) : super(
  2222. pageIndex: pageIndex,
  2223. pageSize: pageSize,
  2224. token: token,
  2225. );
  2226. factory FindPushDevicePatchPageRequest.fromJson(Map<String, dynamic> map) {
  2227. return FindPushDevicePatchPageRequest(
  2228. keyword: map['Keyword'],
  2229. deviceCode: map['DeviceCode'],
  2230. pageIndex: map['PageIndex'],
  2231. pageSize: map['PageSize'],
  2232. token: map['Token'],
  2233. );
  2234. }
  2235. Map<String, dynamic> toJson() {
  2236. final map = super.toJson();
  2237. if(keyword != null)
  2238. map['Keyword'] = keyword;
  2239. if(deviceCode != null)
  2240. map['DeviceCode'] = deviceCode;
  2241. return map;
  2242. }
  2243. }
  2244. class UploadDeviceDownloadPatchProgressToUserRequest extends TokenRequest{
  2245. int progress;
  2246. String? userCode;
  2247. String? patchCode;
  2248. RemoteDeviceStateEnum remoteDeviceState;
  2249. UploadDeviceDownloadPatchProgressToUserRequest({
  2250. this.progress = 0,
  2251. this.userCode,
  2252. this.patchCode,
  2253. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  2254. String? token,
  2255. }) : super(
  2256. token: token,
  2257. );
  2258. factory UploadDeviceDownloadPatchProgressToUserRequest.fromJson(Map<String, dynamic> map) {
  2259. return UploadDeviceDownloadPatchProgressToUserRequest(
  2260. progress: map['Progress'],
  2261. userCode: map['UserCode'],
  2262. patchCode: map['PatchCode'],
  2263. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  2264. token: map['Token'],
  2265. );
  2266. }
  2267. Map<String, dynamic> toJson() {
  2268. final map = super.toJson();
  2269. map['Progress'] = progress;
  2270. if(userCode != null)
  2271. map['UserCode'] = userCode;
  2272. if(patchCode != null)
  2273. map['PatchCode'] = patchCode;
  2274. map['RemoteDeviceState'] = remoteDeviceState.index;
  2275. return map;
  2276. }
  2277. }
  2278. enum DeviceVersionEnum {
  2279. All,
  2280. SoftwareVersion,
  2281. OsVersion,
  2282. }
  2283. class AddDevicePatchVersionRequest extends TokenRequest{
  2284. String? version;
  2285. DeviceVersionEnum versionTypeEnum;
  2286. String? deviceType;
  2287. AddDevicePatchVersionRequest({
  2288. this.version,
  2289. this.versionTypeEnum = DeviceVersionEnum.All,
  2290. this.deviceType,
  2291. String? token,
  2292. }) : super(
  2293. token: token,
  2294. );
  2295. factory AddDevicePatchVersionRequest.fromJson(Map<String, dynamic> map) {
  2296. return AddDevicePatchVersionRequest(
  2297. version: map['Version'],
  2298. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2299. deviceType: map['DeviceType'],
  2300. token: map['Token'],
  2301. );
  2302. }
  2303. Map<String, dynamic> toJson() {
  2304. final map = super.toJson();
  2305. if(version != null)
  2306. map['Version'] = version;
  2307. map['VersionTypeEnum'] = versionTypeEnum.index;
  2308. if(deviceType != null)
  2309. map['DeviceType'] = deviceType;
  2310. return map;
  2311. }
  2312. }
  2313. class DevicePatchVersionDTO extends BaseDTO{
  2314. String? version;
  2315. DeviceVersionEnum versionTypeEnum;
  2316. String? deviceType;
  2317. String? code;
  2318. DevicePatchVersionDTO({
  2319. this.version,
  2320. this.versionTypeEnum = DeviceVersionEnum.All,
  2321. this.deviceType,
  2322. this.code,
  2323. DateTime? createTime,
  2324. DateTime? updateTime,
  2325. }) : super(
  2326. createTime: createTime,
  2327. updateTime: updateTime,
  2328. );
  2329. factory DevicePatchVersionDTO.fromJson(Map<String, dynamic> map) {
  2330. return DevicePatchVersionDTO(
  2331. version: map['Version'],
  2332. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2333. deviceType: map['DeviceType'],
  2334. code: map['Code'],
  2335. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2336. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2337. );
  2338. }
  2339. Map<String, dynamic> toJson() {
  2340. final map = super.toJson();
  2341. if(version != null)
  2342. map['Version'] = version;
  2343. map['VersionTypeEnum'] = versionTypeEnum.index;
  2344. if(deviceType != null)
  2345. map['DeviceType'] = deviceType;
  2346. if(code != null)
  2347. map['Code'] = code;
  2348. return map;
  2349. }
  2350. }
  2351. class FindDevicePatchListRequest extends TokenRequest{
  2352. String? deviceType;
  2353. DeviceVersionEnum versionTypeEnum;
  2354. FindDevicePatchListRequest({
  2355. this.deviceType,
  2356. this.versionTypeEnum = DeviceVersionEnum.All,
  2357. String? token,
  2358. }) : super(
  2359. token: token,
  2360. );
  2361. factory FindDevicePatchListRequest.fromJson(Map<String, dynamic> map) {
  2362. return FindDevicePatchListRequest(
  2363. deviceType: map['DeviceType'],
  2364. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2365. token: map['Token'],
  2366. );
  2367. }
  2368. Map<String, dynamic> toJson() {
  2369. final map = super.toJson();
  2370. if(deviceType != null)
  2371. map['DeviceType'] = deviceType;
  2372. map['VersionTypeEnum'] = versionTypeEnum.index;
  2373. return map;
  2374. }
  2375. }
  2376. class DeleteDevicePatchVersionRequest extends TokenRequest{
  2377. String? code;
  2378. DeleteDevicePatchVersionRequest({
  2379. this.code,
  2380. String? token,
  2381. }) : super(
  2382. token: token,
  2383. );
  2384. factory DeleteDevicePatchVersionRequest.fromJson(Map<String, dynamic> map) {
  2385. return DeleteDevicePatchVersionRequest(
  2386. code: map['Code'],
  2387. token: map['Token'],
  2388. );
  2389. }
  2390. Map<String, dynamic> toJson() {
  2391. final map = super.toJson();
  2392. if(code != null)
  2393. map['Code'] = code;
  2394. return map;
  2395. }
  2396. }
  2397. class AddDevicePrinterVersionRequest extends TokenRequest{
  2398. String? version;
  2399. DeviceVersionEnum versionTypeEnum;
  2400. AddDevicePrinterVersionRequest({
  2401. this.version,
  2402. this.versionTypeEnum = DeviceVersionEnum.All,
  2403. String? token,
  2404. }) : super(
  2405. token: token,
  2406. );
  2407. factory AddDevicePrinterVersionRequest.fromJson(Map<String, dynamic> map) {
  2408. return AddDevicePrinterVersionRequest(
  2409. version: map['Version'],
  2410. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2411. token: map['Token'],
  2412. );
  2413. }
  2414. Map<String, dynamic> toJson() {
  2415. final map = super.toJson();
  2416. if(version != null)
  2417. map['Version'] = version;
  2418. map['VersionTypeEnum'] = versionTypeEnum.index;
  2419. return map;
  2420. }
  2421. }
  2422. class DevicePrinterVersionDTO extends BaseDTO{
  2423. String? version;
  2424. DeviceVersionEnum versionTypeEnum;
  2425. String? code;
  2426. DevicePrinterVersionDTO({
  2427. this.version,
  2428. this.versionTypeEnum = DeviceVersionEnum.All,
  2429. this.code,
  2430. DateTime? createTime,
  2431. DateTime? updateTime,
  2432. }) : super(
  2433. createTime: createTime,
  2434. updateTime: updateTime,
  2435. );
  2436. factory DevicePrinterVersionDTO.fromJson(Map<String, dynamic> map) {
  2437. return DevicePrinterVersionDTO(
  2438. version: map['Version'],
  2439. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2440. code: map['Code'],
  2441. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2442. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2443. );
  2444. }
  2445. Map<String, dynamic> toJson() {
  2446. final map = super.toJson();
  2447. if(version != null)
  2448. map['Version'] = version;
  2449. map['VersionTypeEnum'] = versionTypeEnum.index;
  2450. if(code != null)
  2451. map['Code'] = code;
  2452. return map;
  2453. }
  2454. }
  2455. class FindDevicePrinterVersionListRequest extends TokenRequest{
  2456. DeviceVersionEnum versionTypeEnum;
  2457. FindDevicePrinterVersionListRequest({
  2458. this.versionTypeEnum = DeviceVersionEnum.All,
  2459. String? token,
  2460. }) : super(
  2461. token: token,
  2462. );
  2463. factory FindDevicePrinterVersionListRequest.fromJson(Map<String, dynamic> map) {
  2464. return FindDevicePrinterVersionListRequest(
  2465. versionTypeEnum: DeviceVersionEnum.values.firstWhere((e) => e.index == map['VersionTypeEnum']),
  2466. token: map['Token'],
  2467. );
  2468. }
  2469. Map<String, dynamic> toJson() {
  2470. final map = super.toJson();
  2471. map['VersionTypeEnum'] = versionTypeEnum.index;
  2472. return map;
  2473. }
  2474. }
  2475. class DeleteDevicePrinterVersionRequest extends TokenRequest{
  2476. String? code;
  2477. DeleteDevicePrinterVersionRequest({
  2478. this.code,
  2479. String? token,
  2480. }) : super(
  2481. token: token,
  2482. );
  2483. factory DeleteDevicePrinterVersionRequest.fromJson(Map<String, dynamic> map) {
  2484. return DeleteDevicePrinterVersionRequest(
  2485. code: map['Code'],
  2486. token: map['Token'],
  2487. );
  2488. }
  2489. Map<String, dynamic> toJson() {
  2490. final map = super.toJson();
  2491. if(code != null)
  2492. map['Code'] = code;
  2493. return map;
  2494. }
  2495. }
  2496. class AddDevicePrinterRequest extends TokenRequest{
  2497. String? name;
  2498. String? description;
  2499. String? osVersion;
  2500. List<UploadDeviceFileInfoDTO >? fileUploadInfoList;
  2501. int fileSize;
  2502. String? printerBrands;
  2503. List<String >? printerModels;
  2504. String? fileName;
  2505. AddDevicePrinterRequest({
  2506. this.name,
  2507. this.description,
  2508. this.osVersion,
  2509. this.fileUploadInfoList,
  2510. this.fileSize = 0,
  2511. this.printerBrands,
  2512. this.printerModels,
  2513. this.fileName,
  2514. String? token,
  2515. }) : super(
  2516. token: token,
  2517. );
  2518. factory AddDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  2519. return AddDevicePrinterRequest(
  2520. name: map['Name'],
  2521. description: map['Description'],
  2522. osVersion: map['OsVersion'],
  2523. fileUploadInfoList: map['FileUploadInfoList'] != null ? (map['FileUploadInfoList'] as List).map((e)=>UploadDeviceFileInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2524. fileSize: map['FileSize'],
  2525. printerBrands: map['PrinterBrands'],
  2526. printerModels: map['PrinterModels'] != null ? map['PrinterModels'].cast<String>().toList() : null,
  2527. fileName: map['FileName'],
  2528. token: map['Token'],
  2529. );
  2530. }
  2531. Map<String, dynamic> toJson() {
  2532. final map = super.toJson();
  2533. if(name != null)
  2534. map['Name'] = name;
  2535. if(description != null)
  2536. map['Description'] = description;
  2537. if(osVersion != null)
  2538. map['OsVersion'] = osVersion;
  2539. if(fileUploadInfoList != null)
  2540. map['FileUploadInfoList'] = fileUploadInfoList;
  2541. map['FileSize'] = fileSize;
  2542. if(printerBrands != null)
  2543. map['PrinterBrands'] = printerBrands;
  2544. if(printerModels != null)
  2545. map['PrinterModels'] = printerModels;
  2546. if(fileName != null)
  2547. map['FileName'] = fileName;
  2548. return map;
  2549. }
  2550. }
  2551. class FindDevicePrinterPageRequest extends PageRequest{
  2552. String? keyword;
  2553. FindDevicePrinterPageRequest({
  2554. this.keyword,
  2555. int pageIndex = 0,
  2556. int pageSize = 0,
  2557. String? token,
  2558. }) : super(
  2559. pageIndex: pageIndex,
  2560. pageSize: pageSize,
  2561. token: token,
  2562. );
  2563. factory FindDevicePrinterPageRequest.fromJson(Map<String, dynamic> map) {
  2564. return FindDevicePrinterPageRequest(
  2565. keyword: map['Keyword'],
  2566. pageIndex: map['PageIndex'],
  2567. pageSize: map['PageSize'],
  2568. token: map['Token'],
  2569. );
  2570. }
  2571. Map<String, dynamic> toJson() {
  2572. final map = super.toJson();
  2573. if(keyword != null)
  2574. map['Keyword'] = keyword;
  2575. return map;
  2576. }
  2577. }
  2578. class DeleteDevicePrinterByCodeRequest extends TokenRequest{
  2579. String? code;
  2580. DeleteDevicePrinterByCodeRequest({
  2581. this.code,
  2582. String? token,
  2583. }) : super(
  2584. token: token,
  2585. );
  2586. factory DeleteDevicePrinterByCodeRequest.fromJson(Map<String, dynamic> map) {
  2587. return DeleteDevicePrinterByCodeRequest(
  2588. code: map['Code'],
  2589. token: map['Token'],
  2590. );
  2591. }
  2592. Map<String, dynamic> toJson() {
  2593. final map = super.toJson();
  2594. if(code != null)
  2595. map['Code'] = code;
  2596. return map;
  2597. }
  2598. }
  2599. class UpdateDevicePrinterRequest extends TokenRequest{
  2600. String? name;
  2601. String? description;
  2602. String? osVersion;
  2603. String? code;
  2604. UpdateDevicePrinterRequest({
  2605. this.name,
  2606. this.description,
  2607. this.osVersion,
  2608. this.code,
  2609. String? token,
  2610. }) : super(
  2611. token: token,
  2612. );
  2613. factory UpdateDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  2614. return UpdateDevicePrinterRequest(
  2615. name: map['Name'],
  2616. description: map['Description'],
  2617. osVersion: map['OsVersion'],
  2618. code: map['Code'],
  2619. token: map['Token'],
  2620. );
  2621. }
  2622. Map<String, dynamic> toJson() {
  2623. final map = super.toJson();
  2624. if(name != null)
  2625. map['Name'] = name;
  2626. if(description != null)
  2627. map['Description'] = description;
  2628. if(osVersion != null)
  2629. map['OsVersion'] = osVersion;
  2630. if(code != null)
  2631. map['Code'] = code;
  2632. return map;
  2633. }
  2634. }
  2635. class SetDevicePrinterRequest extends TokenRequest{
  2636. String? deviceCode;
  2637. DevicePrinterEnum setPrinterEnum;
  2638. List<DevicePrinterParameter >? parameters;
  2639. SetDevicePrinterRequest({
  2640. this.deviceCode,
  2641. this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters,
  2642. this.parameters,
  2643. String? token,
  2644. }) : super(
  2645. token: token,
  2646. );
  2647. factory SetDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  2648. return SetDevicePrinterRequest(
  2649. deviceCode: map['DeviceCode'],
  2650. setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  2651. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>DevicePrinterParameter.fromJson(e as Map<String,dynamic>)).toList() : null,
  2652. token: map['Token'],
  2653. );
  2654. }
  2655. Map<String, dynamic> toJson() {
  2656. final map = super.toJson();
  2657. if(deviceCode != null)
  2658. map['DeviceCode'] = deviceCode;
  2659. map['SetPrinterEnum'] = setPrinterEnum.index;
  2660. if(parameters != null)
  2661. map['Parameters'] = parameters;
  2662. return map;
  2663. }
  2664. }
  2665. class UploadDevicePrinterRequest extends TokenRequest{
  2666. String? userCode;
  2667. DevicePrinterEnum setPrinterEnum;
  2668. List<DevicePrinterParameterDTO >? devicePrinterList;
  2669. RemoteDeviceStateEnum remoteDeviceState;
  2670. UploadDevicePrinterRequest({
  2671. this.userCode,
  2672. this.setPrinterEnum = DevicePrinterEnum.GetInstalledPrinters,
  2673. this.devicePrinterList,
  2674. this.remoteDeviceState = RemoteDeviceStateEnum.Unknown,
  2675. String? token,
  2676. }) : super(
  2677. token: token,
  2678. );
  2679. factory UploadDevicePrinterRequest.fromJson(Map<String, dynamic> map) {
  2680. return UploadDevicePrinterRequest(
  2681. userCode: map['UserCode'],
  2682. setPrinterEnum: DevicePrinterEnum.values.firstWhere((e) => e.index == map['SetPrinterEnum']),
  2683. devicePrinterList: map['DevicePrinterList'] != null ? (map['DevicePrinterList'] as List).map((e)=>DevicePrinterParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2684. remoteDeviceState: RemoteDeviceStateEnum.values.firstWhere((e) => e.index == map['RemoteDeviceState']),
  2685. token: map['Token'],
  2686. );
  2687. }
  2688. Map<String, dynamic> toJson() {
  2689. final map = super.toJson();
  2690. if(userCode != null)
  2691. map['UserCode'] = userCode;
  2692. map['SetPrinterEnum'] = setPrinterEnum.index;
  2693. if(devicePrinterList != null)
  2694. map['DevicePrinterList'] = devicePrinterList;
  2695. map['RemoteDeviceState'] = remoteDeviceState.index;
  2696. return map;
  2697. }
  2698. }
  2699. class RestartDeviceRequest extends TokenRequest{
  2700. String? deviceCode;
  2701. bool isNeedSyn;
  2702. RestartDeviceRequest({
  2703. this.deviceCode,
  2704. this.isNeedSyn = false,
  2705. String? token,
  2706. }) : super(
  2707. token: token,
  2708. );
  2709. factory RestartDeviceRequest.fromJson(Map<String, dynamic> map) {
  2710. return RestartDeviceRequest(
  2711. deviceCode: map['DeviceCode'],
  2712. isNeedSyn: map['IsNeedSyn'],
  2713. token: map['Token'],
  2714. );
  2715. }
  2716. Map<String, dynamic> toJson() {
  2717. final map = super.toJson();
  2718. if(deviceCode != null)
  2719. map['DeviceCode'] = deviceCode;
  2720. map['IsNeedSyn'] = isNeedSyn;
  2721. return map;
  2722. }
  2723. }
  2724. class ModifyEmergencyDeviceCodeRequest extends TokenRequest{
  2725. String? emergencyDeviceCode;
  2726. ModifyEmergencyDeviceCodeRequest({
  2727. this.emergencyDeviceCode,
  2728. String? token,
  2729. }) : super(
  2730. token: token,
  2731. );
  2732. factory ModifyEmergencyDeviceCodeRequest.fromJson(Map<String, dynamic> map) {
  2733. return ModifyEmergencyDeviceCodeRequest(
  2734. emergencyDeviceCode: map['EmergencyDeviceCode'],
  2735. token: map['Token'],
  2736. );
  2737. }
  2738. Map<String, dynamic> toJson() {
  2739. final map = super.toJson();
  2740. if(emergencyDeviceCode != null)
  2741. map['EmergencyDeviceCode'] = emergencyDeviceCode;
  2742. return map;
  2743. }
  2744. }
  2745. class SendCommandToDeviceRequest extends TokenRequest{
  2746. String? deviceCode;
  2747. String? actionType;
  2748. String? settings;
  2749. SendCommandToDeviceRequest({
  2750. this.deviceCode,
  2751. this.actionType,
  2752. this.settings,
  2753. String? token,
  2754. }) : super(
  2755. token: token,
  2756. );
  2757. factory SendCommandToDeviceRequest.fromJson(Map<String, dynamic> map) {
  2758. return SendCommandToDeviceRequest(
  2759. deviceCode: map['DeviceCode'],
  2760. actionType: map['ActionType'],
  2761. settings: map['Settings'],
  2762. token: map['Token'],
  2763. );
  2764. }
  2765. Map<String, dynamic> toJson() {
  2766. final map = super.toJson();
  2767. if(deviceCode != null)
  2768. map['DeviceCode'] = deviceCode;
  2769. if(actionType != null)
  2770. map['ActionType'] = actionType;
  2771. if(settings != null)
  2772. map['Settings'] = settings;
  2773. return map;
  2774. }
  2775. }
  2776. class SendResultToClientRequest extends TokenRequest{
  2777. String? userCode;
  2778. String? settings;
  2779. SendResultToClientRequest({
  2780. this.userCode,
  2781. this.settings,
  2782. String? token,
  2783. }) : super(
  2784. token: token,
  2785. );
  2786. factory SendResultToClientRequest.fromJson(Map<String, dynamic> map) {
  2787. return SendResultToClientRequest(
  2788. userCode: map['UserCode'],
  2789. settings: map['Settings'],
  2790. token: map['Token'],
  2791. );
  2792. }
  2793. Map<String, dynamic> toJson() {
  2794. final map = super.toJson();
  2795. if(userCode != null)
  2796. map['UserCode'] = userCode;
  2797. if(settings != null)
  2798. map['Settings'] = settings;
  2799. return map;
  2800. }
  2801. }
  2802. class GetResultFromServerRequest extends TokenRequest{
  2803. String? resultCode;
  2804. GetResultFromServerRequest({
  2805. this.resultCode,
  2806. String? token,
  2807. }) : super(
  2808. token: token,
  2809. );
  2810. factory GetResultFromServerRequest.fromJson(Map<String, dynamic> map) {
  2811. return GetResultFromServerRequest(
  2812. resultCode: map['ResultCode'],
  2813. token: map['Token'],
  2814. );
  2815. }
  2816. Map<String, dynamic> toJson() {
  2817. final map = super.toJson();
  2818. if(resultCode != null)
  2819. map['ResultCode'] = resultCode;
  2820. return map;
  2821. }
  2822. }
  2823. class RemoteConnectStautsRequest extends TokenRequest{
  2824. String? userCode;
  2825. LoginSource loginSource;
  2826. bool isNeedSyn;
  2827. RemoteConnectStautsRequest({
  2828. this.userCode,
  2829. this.loginSource = LoginSource.PC,
  2830. this.isNeedSyn = false,
  2831. String? token,
  2832. }) : super(
  2833. token: token,
  2834. );
  2835. factory RemoteConnectStautsRequest.fromJson(Map<String, dynamic> map) {
  2836. return RemoteConnectStautsRequest(
  2837. userCode: map['UserCode'],
  2838. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  2839. isNeedSyn: map['IsNeedSyn'],
  2840. token: map['Token'],
  2841. );
  2842. }
  2843. Map<String, dynamic> toJson() {
  2844. final map = super.toJson();
  2845. if(userCode != null)
  2846. map['UserCode'] = userCode;
  2847. map['LoginSource'] = loginSource.index;
  2848. map['IsNeedSyn'] = isNeedSyn;
  2849. return map;
  2850. }
  2851. }
  2852. class RemoteConnectHeartRateRequest extends TokenRequest{
  2853. TransactionTypeEnum transactionType;
  2854. bool isNeedSyn;
  2855. RemoteConnectHeartRateRequest({
  2856. this.transactionType = TransactionTypeEnum.Consultion,
  2857. this.isNeedSyn = false,
  2858. String? token,
  2859. }) : super(
  2860. token: token,
  2861. );
  2862. factory RemoteConnectHeartRateRequest.fromJson(Map<String, dynamic> map) {
  2863. return RemoteConnectHeartRateRequest(
  2864. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  2865. isNeedSyn: map['IsNeedSyn'],
  2866. token: map['Token'],
  2867. );
  2868. }
  2869. Map<String, dynamic> toJson() {
  2870. final map = super.toJson();
  2871. map['TransactionType'] = transactionType.index;
  2872. map['IsNeedSyn'] = isNeedSyn;
  2873. return map;
  2874. }
  2875. }
  2876. enum ConnectStatusEnum {
  2877. UnConnect,
  2878. WaitConnect,
  2879. CompleteConnect,
  2880. WaitDisconnect,
  2881. CompleteDisconnect,
  2882. }
  2883. class AddUserRemoteConnectRequest extends GetDeviceRequest{
  2884. String? roomId;
  2885. ConnectStatusEnum statusEnum;
  2886. AddUserRemoteConnectRequest({
  2887. this.roomId,
  2888. this.statusEnum = ConnectStatusEnum.UnConnect,
  2889. String? deviceCode,
  2890. bool isNeedSyn = false,
  2891. String? token,
  2892. }) : super(
  2893. deviceCode: deviceCode,
  2894. isNeedSyn: isNeedSyn,
  2895. token: token,
  2896. );
  2897. factory AddUserRemoteConnectRequest.fromJson(Map<String, dynamic> map) {
  2898. return AddUserRemoteConnectRequest(
  2899. roomId: map['RoomId'],
  2900. statusEnum: ConnectStatusEnum.values.firstWhere((e) => e.index == map['StatusEnum']),
  2901. deviceCode: map['DeviceCode'],
  2902. isNeedSyn: map['IsNeedSyn'],
  2903. token: map['Token'],
  2904. );
  2905. }
  2906. Map<String, dynamic> toJson() {
  2907. final map = super.toJson();
  2908. if(roomId != null)
  2909. map['RoomId'] = roomId;
  2910. map['StatusEnum'] = statusEnum.index;
  2911. return map;
  2912. }
  2913. }
  2914. class DeviceConnectStateResult {
  2915. String? deviceCode;
  2916. ConnectStatusEnum connectStatus;
  2917. DeviceConnectStateResult({
  2918. this.deviceCode,
  2919. this.connectStatus = ConnectStatusEnum.UnConnect,
  2920. });
  2921. factory DeviceConnectStateResult.fromJson(Map<String, dynamic> map) {
  2922. return DeviceConnectStateResult(
  2923. deviceCode: map['DeviceCode'],
  2924. connectStatus: ConnectStatusEnum.values.firstWhere((e) => e.index == map['ConnectStatus']),
  2925. );
  2926. }
  2927. Map<String, dynamic> toJson() {
  2928. final map = Map<String, dynamic>();
  2929. if(deviceCode != null)
  2930. map['DeviceCode'] = deviceCode;
  2931. map['ConnectStatus'] = connectStatus.index;
  2932. return map;
  2933. }
  2934. }
  2935. class GetDeviceStateListRequest extends TokenRequest{
  2936. List<String >? deviceCodes;
  2937. GetDeviceStateListRequest({
  2938. this.deviceCodes,
  2939. String? token,
  2940. }) : super(
  2941. token: token,
  2942. );
  2943. factory GetDeviceStateListRequest.fromJson(Map<String, dynamic> map) {
  2944. return GetDeviceStateListRequest(
  2945. deviceCodes: map['DeviceCodes'] != null ? map['DeviceCodes'].cast<String>().toList() : null,
  2946. token: map['Token'],
  2947. );
  2948. }
  2949. Map<String, dynamic> toJson() {
  2950. final map = super.toJson();
  2951. if(deviceCodes != null)
  2952. map['DeviceCodes'] = deviceCodes;
  2953. return map;
  2954. }
  2955. }
  2956. class DeivceCancelLogDownloadRequest extends TokenRequest{
  2957. String? userCode;
  2958. DeivceCancelLogDownloadRequest({
  2959. this.userCode,
  2960. String? token,
  2961. }) : super(
  2962. token: token,
  2963. );
  2964. factory DeivceCancelLogDownloadRequest.fromJson(Map<String, dynamic> map) {
  2965. return DeivceCancelLogDownloadRequest(
  2966. userCode: map['UserCode'],
  2967. token: map['Token'],
  2968. );
  2969. }
  2970. Map<String, dynamic> toJson() {
  2971. final map = super.toJson();
  2972. if(userCode != null)
  2973. map['UserCode'] = userCode;
  2974. return map;
  2975. }
  2976. }
  2977. class ProbeSettingInfoDTO {
  2978. String? name;
  2979. List<ApplicationSettingInfoDTO >? applications;
  2980. ProbeSettingInfoDTO({
  2981. this.name,
  2982. this.applications,
  2983. });
  2984. factory ProbeSettingInfoDTO.fromJson(Map<String, dynamic> map) {
  2985. return ProbeSettingInfoDTO(
  2986. name: map['Name'],
  2987. applications: map['Applications'] != null ? (map['Applications'] as List).map((e)=>ApplicationSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2988. );
  2989. }
  2990. Map<String, dynamic> toJson() {
  2991. final map = Map<String, dynamic>();
  2992. if(name != null)
  2993. map['Name'] = name;
  2994. if(applications != null)
  2995. map['Applications'] = applications;
  2996. return map;
  2997. }
  2998. }
  2999. class ProbeApplicationSettingInfoDTO {
  3000. List<ProbeSettingInfoDTO >? probes;
  3001. String? activeProbe;
  3002. String? activeApplication;
  3003. int maxNumberForApplication;
  3004. int maxNumberForApplicationOfUserDefine;
  3005. ProbeApplicationSettingInfoDTO({
  3006. this.probes,
  3007. this.activeProbe,
  3008. this.activeApplication,
  3009. this.maxNumberForApplication = 0,
  3010. this.maxNumberForApplicationOfUserDefine = 0,
  3011. });
  3012. factory ProbeApplicationSettingInfoDTO.fromJson(Map<String, dynamic> map) {
  3013. return ProbeApplicationSettingInfoDTO(
  3014. probes: map['Probes'] != null ? (map['Probes'] as List).map((e)=>ProbeSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  3015. activeProbe: map['ActiveProbe'],
  3016. activeApplication: map['ActiveApplication'],
  3017. maxNumberForApplication: map['MaxNumberForApplication'],
  3018. maxNumberForApplicationOfUserDefine: map['MaxNumberForApplicationOfUserDefine'],
  3019. );
  3020. }
  3021. Map<String, dynamic> toJson() {
  3022. final map = Map<String, dynamic>();
  3023. if(probes != null)
  3024. map['Probes'] = probes;
  3025. if(activeProbe != null)
  3026. map['ActiveProbe'] = activeProbe;
  3027. if(activeApplication != null)
  3028. map['ActiveApplication'] = activeApplication;
  3029. map['MaxNumberForApplication'] = maxNumberForApplication;
  3030. map['MaxNumberForApplicationOfUserDefine'] = maxNumberForApplicationOfUserDefine;
  3031. return map;
  3032. }
  3033. }
  3034. class ProbeApplicationSettingRequest extends TokenRequest{
  3035. String? deviceCode;
  3036. ProbeApplicationSettingInfoDTO? probeApplicationSetting;
  3037. ControlDeviceParameterEnum controlType;
  3038. ProbeApplicationSettingRequest({
  3039. this.deviceCode,
  3040. this.probeApplicationSetting,
  3041. this.controlType = ControlDeviceParameterEnum.Start,
  3042. String? token,
  3043. }) : super(
  3044. token: token,
  3045. );
  3046. factory ProbeApplicationSettingRequest.fromJson(Map<String, dynamic> map) {
  3047. return ProbeApplicationSettingRequest(
  3048. deviceCode: map['DeviceCode'],
  3049. probeApplicationSetting: map['ProbeApplicationSetting'] != null ? ProbeApplicationSettingInfoDTO.fromJson(map['ProbeApplicationSetting']) : null,
  3050. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  3051. token: map['Token'],
  3052. );
  3053. }
  3054. Map<String, dynamic> toJson() {
  3055. final map = super.toJson();
  3056. if(deviceCode != null)
  3057. map['DeviceCode'] = deviceCode;
  3058. if(probeApplicationSetting != null)
  3059. map['ProbeApplicationSetting'] = probeApplicationSetting;
  3060. map['ControlType'] = controlType.index;
  3061. return map;
  3062. }
  3063. }
  3064. class ProbeApplicationSettingResultRequest extends TokenRequest{
  3065. String? userCode;
  3066. ProbeApplicationSettingInfoDTO? probeApplicationSetting;
  3067. ControlDeviceParameterEnum controlType;
  3068. ProbeApplicationSettingResultRequest({
  3069. this.userCode,
  3070. this.probeApplicationSetting,
  3071. this.controlType = ControlDeviceParameterEnum.Start,
  3072. String? token,
  3073. }) : super(
  3074. token: token,
  3075. );
  3076. factory ProbeApplicationSettingResultRequest.fromJson(Map<String, dynamic> map) {
  3077. return ProbeApplicationSettingResultRequest(
  3078. userCode: map['UserCode'],
  3079. probeApplicationSetting: map['ProbeApplicationSetting'] != null ? ProbeApplicationSettingInfoDTO.fromJson(map['ProbeApplicationSetting']) : null,
  3080. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  3081. token: map['Token'],
  3082. );
  3083. }
  3084. Map<String, dynamic> toJson() {
  3085. final map = super.toJson();
  3086. if(userCode != null)
  3087. map['UserCode'] = userCode;
  3088. if(probeApplicationSetting != null)
  3089. map['ProbeApplicationSetting'] = probeApplicationSetting;
  3090. map['ControlType'] = controlType.index;
  3091. return map;
  3092. }
  3093. }