device.m.dart 107 KB

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