device.m.dart 100 KB

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