device.m.dart 107 KB

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