device.m.dart 107 KB

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