device.m.dart 106 KB

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