notification.m.dart 118 KB

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