123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366 |
- import 'package:fis_jsonrpc/utils.dart';
- enum NotificationTypeEnum {
- Unknown,
- ChatMsgNotification,
- TokenReplacedNotification,
- DisconnectNotification,
- ConnectionNotification,
- ExamRecordsFinishedNotification,
- RejectApplyConsultationNotification,
- CancelInvitingInLiveConsultationNotification,
- InviteInLiveConsultationNotification,
- ConsultationRemindNotification,
- PasswordExpiredWarningNotification,
- InviteLiveConsultationNotification,
- AcceptLiveConsultationNotification,
- RejectLiveConsultationNotification,
- InviteLiveConsultationToDeviceNotification,
- CancelLiveConsultationNotification,
- CloseLiveConsultationNotification,
- JoinLiveConsultationNotification,
- NetworkErrConsultationNotification,
- LeaveConsultationNotification,
- JoinInLiveConsultationNotification,
- RejectInviteLiveConsultationNotification,
- ApplyConsultationNotification,
- ApprovalApplyConsultationNotification,
- InviteeConsultationNotification,
- InviteeApproveApplyConsultationNotification,
- InviteeRejectApplyConsultationNotification,
- MuteLiveConsultationNotification,
- SwitchLiveConsultationVideoNotification,
- HeartRateJoinConsultationNotification,
- HeartRateLeaveConsultationNotification,
- CloseLiveConsultationToDeviceNotification,
- CancelLiveConsultationToDeviceNotification,
- AnnouncementPublishNotification,
- SendInteractiveBoardDataNotification,
- DeviceParametersNotification,
- DeviceControlledParametersNotification,
- EmergencyCallNotification,
- EmergencyCallFailedNotification,
- InviteLiveCourseNotification,
- JoinLiveCourseNotification,
- InviteLiveCourseToDeviceNotification,
- HeartRateJoinCoNotification,
- NetworkErrCourseNotification,
- CancelLiveCourseNotification,
- MuteLiveCourseNotification,
- CancelLiveCourseToDeviceNotification,
- CloseLiveCourseNotification,
- CloseLiveCourseToDeviceNotification,
- HeartRateLeaveCourseNotification,
- LeaveCoursenNotification,
- SwitchLiveCourseVideoNotification,
- ChangeConsultationNotification,
- ChangeConsultationToDeviceNotification,
- CourcePaySuccessNotification,
- CloseConsultationDueToChangeNotification,
- CloseConsultationDueToChangeToDeviceNotification,
- CourseStatusNotification,
- UpgradeNotification,
- EducationReStartNotification,
- ConsultationReStartNotification,
- VersionUpgradeNotification,
- StartLiveToDeviceNotification,
- CloseLiveToDeviceNotification,
- DeviceLiveFinishedNotification,
- ModifyDeviceMergedVideoSizeNotification,
- DeviceRejectRemoteControlNotification,
- DeviceDisconnectRemoteControlNotification,
- CancelInvitingInLiveCourseNotification,
- StartConsolutionHeartRateToDeviceNotification,
- CloseConsolutionHeartRateToDeviceNotification,
- ConnectStatusToDeviceNotification,
- ConnectStatusToClientNotification,
- GetRemoteLogToDeviceNotification,
- GetRemoteLogToClientNotification,
- StartCourseHeartRateToDeviceNotification,
- }
- class NotificationDTO {
- NotificationTypeEnum notificationType;
- String? code;
- bool isResponse;
- NotificationDTO({
- this.notificationType = NotificationTypeEnum.Unknown,
- this.code,
- this.isResponse = false,
- });
- factory NotificationDTO.fromJson(Map<String, dynamic> map) {
- return NotificationDTO(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(code != null)
- map['Code'] = code;
- map['IsResponse'] = isResponse;
- return map;
- }
- }
- enum AnnouncementTypeEnum {
- placeHolder_0,
- Broadcast,
- Maintenance,
- }
- class AnnouncementLanguageConfigDTO {
- String? language;
- String? title;
- String? content;
- AnnouncementLanguageConfigDTO({
- this.language,
- this.title,
- this.content,
- });
- factory AnnouncementLanguageConfigDTO.fromJson(Map<String, dynamic> map) {
- return AnnouncementLanguageConfigDTO(
- language: map['Language'],
- title: map['Title'],
- content: map['Content'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(language != null)
- map['Language'] = language;
- if(title != null)
- map['Title'] = title;
- if(content != null)
- map['Content'] = content;
- return map;
- }
- }
- class AnnouncementNotification extends NotificationDTO{
- AnnouncementTypeEnum announcementType;
- List<AnnouncementLanguageConfigDTO >? announcementLanguageConfigs;
- AnnouncementNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.announcementType = AnnouncementTypeEnum.Broadcast,
- this.announcementLanguageConfigs,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory AnnouncementNotification.fromJson(Map<String, dynamic> map) {
- return AnnouncementNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
- announcementLanguageConfigs: map['AnnouncementLanguageConfigs'] != null ? (map['AnnouncementLanguageConfigs'] as List).map((e)=>AnnouncementLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['AnnouncementType'] = announcementType.index;
- if(announcementLanguageConfigs != null)
- map['AnnouncementLanguageConfigs'] = announcementLanguageConfigs;
- return map;
- }
- }
- enum ChatCmdEnum {
- Txt,
- Image,
- MP4,
- Voice,
- Cases,
- ShareLive,
- VideoCall,
- VoiceCall,
- }
- class ChatMsgNotification extends NotificationDTO{
- String? userCode;
- ChatCmdEnum chatCmd;
- DateTime? sendTime;
- String? message;
- ChatMsgNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.userCode,
- this.chatCmd = ChatCmdEnum.Txt,
- this.sendTime,
- this.message,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ChatMsgNotification.fromJson(Map<String, dynamic> map) {
- return ChatMsgNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- userCode: map['UserCode'],
- chatCmd: ChatCmdEnum.values.firstWhere((e) => e.index == map['ChatCmd']),
- sendTime: map['SendTime'] != null ? DateTime.parse(map['SendTime']) : null,
- message: map['Message'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(userCode != null)
- map['UserCode'] = userCode;
- map['ChatCmd'] = chatCmd.index;
- if(sendTime != null)
- map['SendTime'] = JsonRpcUtils.dateFormat(sendTime!);
- if(message != null)
- map['Message'] = message;
- return map;
- }
- }
- class ConnectionNotification extends NotificationDTO{
- ConnectionNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ConnectionNotification.fromJson(Map<String, dynamic> map) {
- return ConnectionNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- enum ControlDeviceParameterEnum {
- Start,
- End,
- RunExecuteApi,
- ExecuteProbeApplicationSetting,
- }
- class AdditionParameterDTO {
- String? parameterName;
- String? parameterType;
- String? parameterValue;
- AdditionParameterDTO({
- this.parameterName,
- this.parameterType,
- this.parameterValue,
- });
- factory AdditionParameterDTO.fromJson(Map<String, dynamic> map) {
- return AdditionParameterDTO(
- parameterName: map['ParameterName'],
- parameterType: map['ParameterType'],
- parameterValue: map['ParameterValue'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(parameterName != null)
- map['ParameterName'] = parameterName;
- if(parameterType != null)
- map['ParameterType'] = parameterType;
- if(parameterValue != null)
- map['ParameterValue'] = parameterValue;
- return map;
- }
- }
- class DeviceControlledParametersNotification extends NotificationDTO{
- String? controlUserCode;
- String? controlUserName;
- ControlDeviceParameterEnum controlType;
- List<AdditionParameterDTO >? parameters;
- DeviceControlledParametersNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.controlUserCode,
- this.controlUserName,
- this.controlType = ControlDeviceParameterEnum.Start,
- this.parameters,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory DeviceControlledParametersNotification.fromJson(Map<String, dynamic> map) {
- return DeviceControlledParametersNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- controlUserCode: map['ControlUserCode'],
- controlUserName: map['ControlUserName'],
- controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
- parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(controlUserCode != null)
- map['ControlUserCode'] = controlUserCode;
- if(controlUserName != null)
- map['ControlUserName'] = controlUserName;
- map['ControlType'] = controlType.index;
- if(parameters != null)
- map['Parameters'] = parameters;
- return map;
- }
- }
- class DeviceDisconnectRemoteControlNotification extends NotificationDTO{
- String? deviceCode;
- DeviceDisconnectRemoteControlNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.deviceCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory DeviceDisconnectRemoteControlNotification.fromJson(Map<String, dynamic> map) {
- return DeviceDisconnectRemoteControlNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- deviceCode: map['DeviceCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- return map;
- }
- }
- class DeviceParametersNotification extends NotificationDTO{
- String? deviceCode;
- DeviceParametersNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.deviceCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory DeviceParametersNotification.fromJson(Map<String, dynamic> map) {
- return DeviceParametersNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- deviceCode: map['DeviceCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- return map;
- }
- }
- class DeviceRejectRemoteControlNotification extends NotificationDTO{
- String? deviceCode;
- DeviceRejectRemoteControlNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.deviceCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory DeviceRejectRemoteControlNotification.fromJson(Map<String, dynamic> map) {
- return DeviceRejectRemoteControlNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- deviceCode: map['DeviceCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- return map;
- }
- }
- class DisconnectNotification extends NotificationDTO{
- DisconnectNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory DisconnectNotification.fromJson(Map<String, dynamic> map) {
- return DisconnectNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class ExamRecordsFinishedNotification extends NotificationDTO{
- List<String >? codes;
- ExamRecordsFinishedNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.codes,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ExamRecordsFinishedNotification.fromJson(Map<String, dynamic> map) {
- return ExamRecordsFinishedNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- codes: map['Codes'] != null ? map['Codes'].cast<String>().toList() : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(codes != null)
- map['Codes'] = codes;
- return map;
- }
- }
- enum VideoDeviceSourceTypeEnum {
- Desktop,
- Camera,
- }
- class VideoDeviceDTO {
- String? videoDeviceId;
- VideoDeviceSourceTypeEnum videoDeviceSourceType;
- int width;
- int height;
- int outputWidth;
- int outputHeight;
- int videoFps;
- int videoBitrate;
- int minVideoBitrate;
- VideoDeviceDTO({
- this.videoDeviceId,
- this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
- this.width = 0,
- this.height = 0,
- this.outputWidth = 0,
- this.outputHeight = 0,
- this.videoFps = 0,
- this.videoBitrate = 0,
- this.minVideoBitrate = 0,
- });
- factory VideoDeviceDTO.fromJson(Map<String, dynamic> map) {
- return VideoDeviceDTO(
- videoDeviceId: map['VideoDeviceId'],
- videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
- width: map['Width'],
- height: map['Height'],
- outputWidth: map['OutputWidth'],
- outputHeight: map['OutputHeight'],
- videoFps: map['VideoFps'],
- videoBitrate: map['VideoBitrate'],
- minVideoBitrate: map['MinVideoBitrate'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(videoDeviceId != null)
- map['VideoDeviceId'] = videoDeviceId;
- map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
- map['Width'] = width;
- map['Height'] = height;
- map['OutputWidth'] = outputWidth;
- map['OutputHeight'] = outputHeight;
- map['VideoFps'] = videoFps;
- map['VideoBitrate'] = videoBitrate;
- map['MinVideoBitrate'] = minVideoBitrate;
- return map;
- }
- }
- class ModifyDeviceMergedVideoSizeNotification extends NotificationDTO{
- bool mergedChannel;
- String? deviceCode;
- int mergedVideoOutputWidth;
- int mergedVideoOutputHeight;
- List<VideoDeviceDTO >? videoDeviceInfos;
- ModifyDeviceMergedVideoSizeNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.mergedChannel = false,
- this.deviceCode,
- this.mergedVideoOutputWidth = 0,
- this.mergedVideoOutputHeight = 0,
- this.videoDeviceInfos,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ModifyDeviceMergedVideoSizeNotification.fromJson(Map<String, dynamic> map) {
- return ModifyDeviceMergedVideoSizeNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- mergedChannel: map['MergedChannel'],
- deviceCode: map['DeviceCode'],
- mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
- mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
- videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['MergedChannel'] = mergedChannel;
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
- map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
- if(videoDeviceInfos != null)
- map['VideoDeviceInfos'] = videoDeviceInfos;
- return map;
- }
- }
- class PasswordExpiredWarningNotification extends NotificationDTO{
- double surplusTime;
- PasswordExpiredWarningNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.surplusTime = 0,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory PasswordExpiredWarningNotification.fromJson(Map<String, dynamic> map) {
- return PasswordExpiredWarningNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- surplusTime: double.parse(map['SurplusTime'].toString()),
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['SurplusTime'] = surplusTime;
- return map;
- }
- }
- class TokenReplacedNotification extends NotificationDTO{
- String? userCode;
- TokenReplacedNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.userCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory TokenReplacedNotification.fromJson(Map<String, dynamic> map) {
- return TokenReplacedNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- userCode: map['UserCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(userCode != null)
- map['UserCode'] = userCode;
- return map;
- }
- }
- enum UpgradeTypeEnum {
- NoUpgrade,
- Normal,
- Force,
- AutoAfterRestart,
- }
- enum UpgradeUpdateTypeEnum {
- Part,
- All,
- }
- class DescriptionInfoDTO {
- String? description;
- String? languageCode;
- DescriptionInfoDTO({
- this.description,
- this.languageCode,
- });
- factory DescriptionInfoDTO.fromJson(Map<String, dynamic> map) {
- return DescriptionInfoDTO(
- description: map['Description'],
- languageCode: map['LanguageCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(description != null)
- map['Description'] = description;
- if(languageCode != null)
- map['LanguageCode'] = languageCode;
- return map;
- }
- }
- class UpgradeVersionNotification extends NotificationDTO{
- UpgradeTypeEnum upgradeType;
- String? upgradeCDNUrl;
- String? upgradeSourceUrl;
- UpgradeUpdateTypeEnum upgradeUpdateType;
- String? newVersion;
- List<DescriptionInfoDTO >? descriptions;
- UpgradeVersionNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.upgradeType = UpgradeTypeEnum.NoUpgrade,
- this.upgradeCDNUrl,
- this.upgradeSourceUrl,
- this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part,
- this.newVersion,
- this.descriptions,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory UpgradeVersionNotification.fromJson(Map<String, dynamic> map) {
- return UpgradeVersionNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- upgradeType: UpgradeTypeEnum.values.firstWhere((e) => e.index == map['UpgradeType']),
- upgradeCDNUrl: map['UpgradeCDNUrl'],
- upgradeSourceUrl: map['UpgradeSourceUrl'],
- upgradeUpdateType: UpgradeUpdateTypeEnum.values.firstWhere((e) => e.index == map['UpgradeUpdateType']),
- newVersion: map['NewVersion'],
- descriptions: map['Descriptions'] != null ? (map['Descriptions'] as List).map((e)=>DescriptionInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['UpgradeType'] = upgradeType.index;
- if(upgradeCDNUrl != null)
- map['UpgradeCDNUrl'] = upgradeCDNUrl;
- if(upgradeSourceUrl != null)
- map['UpgradeSourceUrl'] = upgradeSourceUrl;
- map['UpgradeUpdateType'] = upgradeUpdateType.index;
- if(newVersion != null)
- map['NewVersion'] = newVersion;
- if(descriptions != null)
- map['Descriptions'] = descriptions;
- return map;
- }
- }
- class GetRemoteLogToClientNotification extends NotificationDTO{
- String? deviceCode;
- String? logFileToken;
- GetRemoteLogToClientNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.deviceCode,
- this.logFileToken,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory GetRemoteLogToClientNotification.fromJson(Map<String, dynamic> map) {
- return GetRemoteLogToClientNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- deviceCode: map['DeviceCode'],
- logFileToken: map['LogFileToken'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- if(logFileToken != null)
- map['LogFileToken'] = logFileToken;
- return map;
- }
- }
- class GetRemoteLogToDeviceNotification extends NotificationDTO{
- String? controlUserCode;
- DateTime? startTime;
- DateTime? endTime;
- GetRemoteLogToDeviceNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.controlUserCode,
- this.startTime,
- this.endTime,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory GetRemoteLogToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return GetRemoteLogToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- controlUserCode: map['ControlUserCode'],
- startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
- endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(controlUserCode != null)
- map['ControlUserCode'] = controlUserCode;
- if(startTime != null)
- map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
- if(endTime != null)
- map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
- return map;
- }
- }
- class CloseLiveToDeviceNotification extends NotificationDTO{
- String? liveRoomCode;
- CloseLiveToDeviceNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.liveRoomCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CloseLiveToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return CloseLiveToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- liveRoomCode: map['LiveRoomCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(liveRoomCode != null)
- map['LiveRoomCode'] = liveRoomCode;
- return map;
- }
- }
- class ConnectStatusToClientNotification extends NotificationDTO{
- String? deviceCode;
- String? deviceName;
- ControlDeviceParameterEnum controlType;
- ConnectStatusToClientNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.deviceCode,
- this.deviceName,
- this.controlType = ControlDeviceParameterEnum.Start,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ConnectStatusToClientNotification.fromJson(Map<String, dynamic> map) {
- return ConnectStatusToClientNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- deviceCode: map['DeviceCode'],
- deviceName: map['DeviceName'],
- controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- if(deviceName != null)
- map['DeviceName'] = deviceName;
- map['ControlType'] = controlType.index;
- return map;
- }
- }
- class ConnectStatusToDeviceNotification extends NotificationDTO{
- String? controlUserCode;
- String? controlUserName;
- ControlDeviceParameterEnum controlType;
- ConnectStatusToDeviceNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.controlUserCode,
- this.controlUserName,
- this.controlType = ControlDeviceParameterEnum.Start,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ConnectStatusToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return ConnectStatusToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- controlUserCode: map['ControlUserCode'],
- controlUserName: map['ControlUserName'],
- controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(controlUserCode != null)
- map['ControlUserCode'] = controlUserCode;
- if(controlUserName != null)
- map['ControlUserName'] = controlUserName;
- map['ControlType'] = controlType.index;
- return map;
- }
- }
- class DeviceLiveFinishedNotification extends NotificationDTO{
- String? liveRoomCode;
- DeviceLiveFinishedNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.liveRoomCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory DeviceLiveFinishedNotification.fromJson(Map<String, dynamic> map) {
- return DeviceLiveFinishedNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- liveRoomCode: map['LiveRoomCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(liveRoomCode != null)
- map['LiveRoomCode'] = liveRoomCode;
- return map;
- }
- }
- class VideoDeviceOutputInfo {
- String? videoDeviceId;
- VideoDeviceSourceTypeEnum videoDeviceSourceType;
- int outputWidth;
- int outputHeight;
- int videoFps;
- int videoBitrate;
- int minVideoBitrate;
- String? videoDeviceSign;
- VideoDeviceOutputInfo({
- this.videoDeviceId,
- this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
- this.outputWidth = 0,
- this.outputHeight = 0,
- this.videoFps = 0,
- this.videoBitrate = 0,
- this.minVideoBitrate = 0,
- this.videoDeviceSign,
- });
- factory VideoDeviceOutputInfo.fromJson(Map<String, dynamic> map) {
- return VideoDeviceOutputInfo(
- videoDeviceId: map['VideoDeviceId'],
- videoDeviceSourceType: VideoDeviceSourceTypeEnum.values.firstWhere((e) => e.index == map['VideoDeviceSourceType']),
- outputWidth: map['OutputWidth'],
- outputHeight: map['OutputHeight'],
- videoFps: map['VideoFps'],
- videoBitrate: map['VideoBitrate'],
- minVideoBitrate: map['MinVideoBitrate'],
- videoDeviceSign: map['VideoDeviceSign'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(videoDeviceId != null)
- map['VideoDeviceId'] = videoDeviceId;
- map['VideoDeviceSourceType'] = videoDeviceSourceType.index;
- map['OutputWidth'] = outputWidth;
- map['OutputHeight'] = outputHeight;
- map['VideoFps'] = videoFps;
- map['VideoBitrate'] = videoBitrate;
- map['MinVideoBitrate'] = minVideoBitrate;
- if(videoDeviceSign != null)
- map['VideoDeviceSign'] = videoDeviceSign;
- return map;
- }
- }
- class StartLiveToDeviceNotification extends NotificationDTO{
- String? liveRoomCode;
- int roomNo;
- int appId;
- bool mergedChannel;
- int mergedVideoOutputWidth;
- int mergedVideoOutputHeight;
- List<VideoDeviceOutputInfo >? videoDeviceOutputList;
- StartLiveToDeviceNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.liveRoomCode,
- this.roomNo = 0,
- this.appId = 0,
- this.mergedChannel = false,
- this.mergedVideoOutputWidth = 0,
- this.mergedVideoOutputHeight = 0,
- this.videoDeviceOutputList,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory StartLiveToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return StartLiveToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- liveRoomCode: map['LiveRoomCode'],
- roomNo: map['RoomNo'],
- appId: map['AppId'],
- mergedChannel: map['MergedChannel'],
- mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
- mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
- videoDeviceOutputList: map['VideoDeviceOutputList'] != null ? (map['VideoDeviceOutputList'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(liveRoomCode != null)
- map['LiveRoomCode'] = liveRoomCode;
- map['RoomNo'] = roomNo;
- map['AppId'] = appId;
- map['MergedChannel'] = mergedChannel;
- map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
- map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
- if(videoDeviceOutputList != null)
- map['VideoDeviceOutputList'] = videoDeviceOutputList;
- return map;
- }
- }
- class CancelInvitingInLiveCourseNotification extends NotificationDTO{
- String? courseCode;
- CancelInvitingInLiveCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CancelInvitingInLiveCourseNotification.fromJson(Map<String, dynamic> map) {
- return CancelInvitingInLiveCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- return map;
- }
- }
- class CancelLiveCourseNotification extends NotificationDTO{
- String? courseCode;
- String? teacherCode;
- CancelLiveCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.teacherCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CancelLiveCourseNotification.fromJson(Map<String, dynamic> map) {
- return CancelLiveCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- teacherCode: map['TeacherCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- if(teacherCode != null)
- map['TeacherCode'] = teacherCode;
- return map;
- }
- }
- class CloseLiveCourseNotification extends NotificationDTO{
- String? courseCode;
- String? teacherCode;
- CloseLiveCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.teacherCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CloseLiveCourseNotification.fromJson(Map<String, dynamic> map) {
- return CloseLiveCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- teacherCode: map['TeacherCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- if(teacherCode != null)
- map['TeacherCode'] = teacherCode;
- return map;
- }
- }
- class CourcePaySuccessNotification extends NotificationDTO{
- String? paymentOrderCode;
- String? orderTitle;
- double orderAmount;
- DateTime? payTime;
- CourcePaySuccessNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.paymentOrderCode,
- this.orderTitle,
- this.orderAmount = 0,
- this.payTime,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CourcePaySuccessNotification.fromJson(Map<String, dynamic> map) {
- return CourcePaySuccessNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- paymentOrderCode: map['PaymentOrderCode'],
- orderTitle: map['OrderTitle'],
- orderAmount: double.parse(map['OrderAmount'].toString()),
- payTime: map['PayTime'] != null ? DateTime.parse(map['PayTime']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(paymentOrderCode != null)
- map['PaymentOrderCode'] = paymentOrderCode;
- if(orderTitle != null)
- map['OrderTitle'] = orderTitle;
- map['OrderAmount'] = orderAmount;
- if(payTime != null)
- map['PayTime'] = JsonRpcUtils.dateFormat(payTime!);
- return map;
- }
- }
- enum CourseStatusEnum {
- Unknown,
- NoApproval,
- Approved,
- RejectApproval,
- Started,
- HasEnded,
- HasCancelled,
- Overdue,
- Offline,
- }
- class CourseStatusNotification extends NotificationDTO{
- CourseStatusEnum status;
- String? courseCode;
- String? courseName;
- CourseStatusNotification({
- this.status = CourseStatusEnum.Unknown,
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.courseName,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CourseStatusNotification.fromJson(Map<String, dynamic> map) {
- return CourseStatusNotification(
- status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- courseName: map['CourseName'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['Status'] = status.index;
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- if(courseName != null)
- map['CourseName'] = courseName;
- return map;
- }
- }
- enum LiveMemberEnum {
- placeHolder_0,
- User,
- Device,
- }
- enum LiveConsultationMemberStatus {
- Default,
- Accepted,
- Rejected,
- Joined,
- Left,
- }
- enum LoginSource {
- PC,
- Mobile,
- Pad,
- Web,
- US,
- }
- class LiveData {
- int height;
- int width;
- String? rtmpPushUrl;
- String? rtmpPullUrl;
- String? httpPullUrl;
- String? hlsPullUrl;
- LiveData({
- this.height = 0,
- this.width = 0,
- this.rtmpPushUrl,
- this.rtmpPullUrl,
- this.httpPullUrl,
- this.hlsPullUrl,
- });
- factory LiveData.fromJson(Map<String, dynamic> map) {
- return LiveData(
- height: map['Height'],
- width: map['Width'],
- rtmpPushUrl: map['RtmpPushUrl'],
- rtmpPullUrl: map['RtmpPullUrl'],
- httpPullUrl: map['HttpPullUrl'],
- hlsPullUrl: map['HlsPullUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['Height'] = height;
- map['Width'] = width;
- if(rtmpPushUrl != null)
- map['RtmpPushUrl'] = rtmpPushUrl;
- if(rtmpPullUrl != null)
- map['RtmpPullUrl'] = rtmpPullUrl;
- if(httpPullUrl != null)
- map['HttpPullUrl'] = httpPullUrl;
- if(hlsPullUrl != null)
- map['HlsPullUrl'] = hlsPullUrl;
- return map;
- }
- }
- class LiveConsultationMember {
- String? id;
- String? name;
- LiveMemberEnum memberType;
- String? headImageToken;
- bool isOnline;
- bool mute;
- bool videoOpend;
- bool isInitiator;
- bool isBusy;
- LiveConsultationMemberStatus status;
- String? loginServerUrl;
- LoginSource loginSource;
- bool mergedChannel;
- int mergedVideoOutputWidth;
- int mergedVideoOutputHeight;
- LiveData? liveData;
- List<VideoDeviceOutputInfo >? videoDeviceInfos;
- bool isControllingParameter;
- int sortNumber;
- int sortLevel;
- LiveConsultationMember({
- this.id,
- this.name,
- this.memberType = LiveMemberEnum.User,
- this.headImageToken,
- this.isOnline = false,
- this.mute = false,
- this.videoOpend = false,
- this.isInitiator = false,
- this.isBusy = false,
- this.status = LiveConsultationMemberStatus.Default,
- this.loginServerUrl,
- this.loginSource = LoginSource.PC,
- this.mergedChannel = false,
- this.mergedVideoOutputWidth = 0,
- this.mergedVideoOutputHeight = 0,
- this.liveData,
- this.videoDeviceInfos,
- this.isControllingParameter = false,
- this.sortNumber = 0,
- this.sortLevel = 0,
- });
- factory LiveConsultationMember.fromJson(Map<String, dynamic> map) {
- return LiveConsultationMember(
- id: map['Id'],
- name: map['Name'],
- memberType: LiveMemberEnum.values.firstWhere((e) => e.index == map['MemberType']),
- headImageToken: map['HeadImageToken'],
- isOnline: map['IsOnline'],
- mute: map['Mute'],
- videoOpend: map['VideoOpend'],
- isInitiator: map['IsInitiator'],
- isBusy: map['IsBusy'],
- status: LiveConsultationMemberStatus.values.firstWhere((e) => e.index == map['Status']),
- loginServerUrl: map['LoginServerUrl'],
- loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
- mergedChannel: map['MergedChannel'],
- mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
- mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
- liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
- videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
- isControllingParameter: map['IsControllingParameter'],
- sortNumber: map['SortNumber'],
- sortLevel: map['SortLevel'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(id != null)
- map['Id'] = id;
- if(name != null)
- map['Name'] = name;
- map['MemberType'] = memberType.index;
- if(headImageToken != null)
- map['HeadImageToken'] = headImageToken;
- map['IsOnline'] = isOnline;
- map['Mute'] = mute;
- map['VideoOpend'] = videoOpend;
- map['IsInitiator'] = isInitiator;
- map['IsBusy'] = isBusy;
- map['Status'] = status.index;
- if(loginServerUrl != null)
- map['LoginServerUrl'] = loginServerUrl;
- map['LoginSource'] = loginSource.index;
- map['MergedChannel'] = mergedChannel;
- map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
- map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
- if(liveData != null)
- map['LiveData'] = liveData;
- if(videoDeviceInfos != null)
- map['VideoDeviceInfos'] = videoDeviceInfos;
- map['IsControllingParameter'] = isControllingParameter;
- map['SortNumber'] = sortNumber;
- map['SortLevel'] = sortLevel;
- return map;
- }
- }
- class HeartRateJoinCourseNotification extends NotificationDTO{
- String? courseCode;
- LiveConsultationMember? joiner;
- HeartRateJoinCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.joiner,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory HeartRateJoinCourseNotification.fromJson(Map<String, dynamic> map) {
- return HeartRateJoinCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- joiner: map['Joiner'] != null ? LiveConsultationMember.fromJson(map['Joiner']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- if(joiner != null)
- map['Joiner'] = joiner;
- return map;
- }
- }
- class HeartRateLeaveCourseNotification extends NotificationDTO{
- String? courseCode;
- LiveConsultationMember? leaverInfo;
- HeartRateLeaveCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.leaverInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory HeartRateLeaveCourseNotification.fromJson(Map<String, dynamic> map) {
- return HeartRateLeaveCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- leaverInfo: map['LeaverInfo'] != null ? LiveConsultationMember.fromJson(map['LeaverInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- if(leaverInfo != null)
- map['LeaverInfo'] = leaverInfo;
- return map;
- }
- }
- class InviteLiveCourseNotification extends NotificationDTO{
- String? courseCode;
- int roomNo;
- LiveConsultationMember? initiator;
- InviteLiveCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.roomNo = 0,
- this.initiator,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory InviteLiveCourseNotification.fromJson(Map<String, dynamic> map) {
- return InviteLiveCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- roomNo: map['RoomNo'],
- initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- map['RoomNo'] = roomNo;
- if(initiator != null)
- map['Initiator'] = initiator;
- return map;
- }
- }
- class JoinLiveCourseNotification extends NotificationDTO{
- String? courseCode;
- LiveConsultationMember? joiner;
- JoinLiveCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.joiner,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory JoinLiveCourseNotification.fromJson(Map<String, dynamic> map) {
- return JoinLiveCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- joiner: map['Joiner'] != null ? LiveConsultationMember.fromJson(map['Joiner']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- if(joiner != null)
- map['Joiner'] = joiner;
- return map;
- }
- }
- class LeaveLiveCourseNotification extends NotificationDTO{
- String? courseCode;
- LiveConsultationMember? leaverInfo;
- LeaveLiveCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.leaverInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory LeaveLiveCourseNotification.fromJson(Map<String, dynamic> map) {
- return LeaveLiveCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- leaverInfo: map['LeaverInfo'] != null ? LiveConsultationMember.fromJson(map['LeaverInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- if(leaverInfo != null)
- map['LeaverInfo'] = leaverInfo;
- return map;
- }
- }
- class MuteLiveCourseNotification extends NotificationDTO{
- String? courseCode;
- bool mute;
- LiveConsultationMember? muterInfo;
- MuteLiveCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.mute = false,
- this.muterInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory MuteLiveCourseNotification.fromJson(Map<String, dynamic> map) {
- return MuteLiveCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- mute: map['Mute'],
- muterInfo: map['MuterInfo'] != null ? LiveConsultationMember.fromJson(map['MuterInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- map['Mute'] = mute;
- if(muterInfo != null)
- map['MuterInfo'] = muterInfo;
- return map;
- }
- }
- class NetworkErrCourseNotification extends NotificationDTO{
- String? courseCode;
- LiveConsultationMember? networkErrMemberInfo;
- NetworkErrCourseNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.networkErrMemberInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory NetworkErrCourseNotification.fromJson(Map<String, dynamic> map) {
- return NetworkErrCourseNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- networkErrMemberInfo: map['NetworkErrMemberInfo'] != null ? LiveConsultationMember.fromJson(map['NetworkErrMemberInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- if(networkErrMemberInfo != null)
- map['NetworkErrMemberInfo'] = networkErrMemberInfo;
- return map;
- }
- }
- class SwitchLiveCourseVideoNotification extends NotificationDTO{
- String? courseCode;
- bool opened;
- LiveConsultationMember? switcherInfo;
- SwitchLiveCourseVideoNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.courseCode,
- this.opened = false,
- this.switcherInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory SwitchLiveCourseVideoNotification.fromJson(Map<String, dynamic> map) {
- return SwitchLiveCourseVideoNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- courseCode: map['CourseCode'],
- opened: map['Opened'],
- switcherInfo: map['SwitcherInfo'] != null ? LiveConsultationMember.fromJson(map['SwitcherInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(courseCode != null)
- map['CourseCode'] = courseCode;
- map['Opened'] = opened;
- if(switcherInfo != null)
- map['SwitcherInfo'] = switcherInfo;
- return map;
- }
- }
- class UpgradeNotification extends NotificationDTO{
- UpgradeTypeEnum upgadeType;
- String? upgradeCDNUrl;
- String? upgradeUrl;
- UpgradeUpdateTypeEnum upgradeUpdateType;
- String? newVersion;
- String? description;
- UpgradeNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.upgadeType = UpgradeTypeEnum.NoUpgrade,
- this.upgradeCDNUrl,
- this.upgradeUrl,
- this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part,
- this.newVersion,
- this.description,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory UpgradeNotification.fromJson(Map<String, dynamic> map) {
- return UpgradeNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- upgadeType: UpgradeTypeEnum.values.firstWhere((e) => e.index == map['UpgadeType']),
- upgradeCDNUrl: map['UpgradeCDNUrl'],
- upgradeUrl: map['UpgradeUrl'],
- upgradeUpdateType: UpgradeUpdateTypeEnum.values.firstWhere((e) => e.index == map['UpgradeUpdateType']),
- newVersion: map['NewVersion'],
- description: map['Description'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['UpgadeType'] = upgadeType.index;
- if(upgradeCDNUrl != null)
- map['UpgradeCDNUrl'] = upgradeCDNUrl;
- if(upgradeUrl != null)
- map['UpgradeUrl'] = upgradeUrl;
- map['UpgradeUpdateType'] = upgradeUpdateType.index;
- if(newVersion != null)
- map['NewVersion'] = newVersion;
- if(description != null)
- map['Description'] = description;
- return map;
- }
- }
- class ApplyConsultationNotification extends NotificationDTO{
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? applicationTime;
- String? applyOrganizationName;
- DateTime? consultationTime;
- ApplyConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.applicationTime,
- this.applyOrganizationName,
- this.consultationTime,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
- return ApplyConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- operatorName: map['OperatorName'],
- patientName: map['PatientName'],
- applicationTime: map['ApplicationTime'] != null ? DateTime.parse(map['ApplicationTime']) : null,
- applyOrganizationName: map['ApplyOrganizationName'],
- consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(operatorName != null)
- map['OperatorName'] = operatorName;
- if(patientName != null)
- map['PatientName'] = patientName;
- if(applicationTime != null)
- map['ApplicationTime'] = JsonRpcUtils.dateFormat(applicationTime!);
- if(applyOrganizationName != null)
- map['ApplyOrganizationName'] = applyOrganizationName;
- if(consultationTime != null)
- map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
- return map;
- }
- }
- class ApprovalApplyConsultationNotification extends NotificationDTO{
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- String? expertName;
- ApprovalApplyConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- this.expertName,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ApprovalApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
- return ApprovalApplyConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- operatorName: map['OperatorName'],
- patientName: map['PatientName'],
- consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
- consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
- expertName: map['ExpertName'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(operatorName != null)
- map['OperatorName'] = operatorName;
- if(patientName != null)
- map['PatientName'] = patientName;
- if(consultationTime != null)
- map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
- if(consultationTimeEnd != null)
- map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
- if(expertName != null)
- map['ExpertName'] = expertName;
- return map;
- }
- }
- class CloseConsolutionHeartRateToDeviceNotification extends NotificationDTO{
- String? liveRoomCode;
- CloseConsolutionHeartRateToDeviceNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.liveRoomCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CloseConsolutionHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return CloseConsolutionHeartRateToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- liveRoomCode: map['LiveRoomCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(liveRoomCode != null)
- map['LiveRoomCode'] = liveRoomCode;
- return map;
- }
- }
- class ConsultationRemindNotification extends NotificationDTO{
- String? consultationCode;
- int countdownTime;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- String? expertName;
- ConsultationRemindNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.countdownTime = 0,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- this.expertName,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ConsultationRemindNotification.fromJson(Map<String, dynamic> map) {
- return ConsultationRemindNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- countdownTime: map['CountdownTime'],
- patientName: map['PatientName'],
- consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
- consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
- expertName: map['ExpertName'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['CountdownTime'] = countdownTime;
- if(patientName != null)
- map['PatientName'] = patientName;
- if(consultationTime != null)
- map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
- if(consultationTimeEnd != null)
- map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
- if(expertName != null)
- map['ExpertName'] = expertName;
- return map;
- }
- }
- class InviteeApproveApplyConsultationNotification extends NotificationDTO{
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- InviteeApproveApplyConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory InviteeApproveApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
- return InviteeApproveApplyConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- operatorName: map['OperatorName'],
- patientName: map['PatientName'],
- consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
- consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(operatorName != null)
- map['OperatorName'] = operatorName;
- if(patientName != null)
- map['PatientName'] = patientName;
- if(consultationTime != null)
- map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
- if(consultationTimeEnd != null)
- map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
- return map;
- }
- }
- class InviteeConsultationNotification extends NotificationDTO{
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- InviteeConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory InviteeConsultationNotification.fromJson(Map<String, dynamic> map) {
- return InviteeConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- operatorName: map['OperatorName'],
- patientName: map['PatientName'],
- consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
- consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(operatorName != null)
- map['OperatorName'] = operatorName;
- if(patientName != null)
- map['PatientName'] = patientName;
- if(consultationTime != null)
- map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
- if(consultationTimeEnd != null)
- map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
- return map;
- }
- }
- class InviteeRejectApplyConsultationNotification extends NotificationDTO{
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- String? rejectReason;
- InviteeRejectApplyConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- this.rejectReason,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory InviteeRejectApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
- return InviteeRejectApplyConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- operatorName: map['OperatorName'],
- patientName: map['PatientName'],
- consultationTime: map['ConsultationTime'] != null ? DateTime.parse(map['ConsultationTime']) : null,
- consultationTimeEnd: map['ConsultationTimeEnd'] != null ? DateTime.parse(map['ConsultationTimeEnd']) : null,
- rejectReason: map['RejectReason'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(operatorName != null)
- map['OperatorName'] = operatorName;
- if(patientName != null)
- map['PatientName'] = patientName;
- if(consultationTime != null)
- map['ConsultationTime'] = JsonRpcUtils.dateFormat(consultationTime!);
- if(consultationTimeEnd != null)
- map['ConsultationTimeEnd'] = JsonRpcUtils.dateFormat(consultationTimeEnd!);
- if(rejectReason != null)
- map['RejectReason'] = rejectReason;
- return map;
- }
- }
- class RejectApplyConsultationNotification extends NotificationDTO{
- String? consultationCode;
- String? patientName;
- String? operatorName;
- String? rejectReason;
- RejectApplyConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.patientName,
- this.operatorName,
- this.rejectReason,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory RejectApplyConsultationNotification.fromJson(Map<String, dynamic> map) {
- return RejectApplyConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- patientName: map['PatientName'],
- operatorName: map['OperatorName'],
- rejectReason: map['RejectReason'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(patientName != null)
- map['PatientName'] = patientName;
- if(operatorName != null)
- map['OperatorName'] = operatorName;
- if(rejectReason != null)
- map['RejectReason'] = rejectReason;
- return map;
- }
- }
- class StartConsolutionHeartRateToDeviceNotification extends NotificationDTO{
- String? liveRoomCode;
- int intervalSeconds;
- StartConsolutionHeartRateToDeviceNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.liveRoomCode,
- this.intervalSeconds = 0,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory StartConsolutionHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return StartConsolutionHeartRateToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- liveRoomCode: map['LiveRoomCode'],
- intervalSeconds: map['IntervalSeconds'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(liveRoomCode != null)
- map['LiveRoomCode'] = liveRoomCode;
- map['IntervalSeconds'] = intervalSeconds;
- return map;
- }
- }
- class StartCourseHeartRateToDeviceNotification extends NotificationDTO{
- String? liveRoomCode;
- int intervalSeconds;
- StartCourseHeartRateToDeviceNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.liveRoomCode,
- this.intervalSeconds = 0,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory StartCourseHeartRateToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return StartCourseHeartRateToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- liveRoomCode: map['LiveRoomCode'],
- intervalSeconds: map['IntervalSeconds'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(liveRoomCode != null)
- map['LiveRoomCode'] = liveRoomCode;
- map['IntervalSeconds'] = intervalSeconds;
- return map;
- }
- }
- class LiveConsultationMemberInfo {
- String? id;
- String? name;
- String? headImageUrl;
- LiveConsultationMemberInfo({
- this.id,
- this.name,
- this.headImageUrl,
- });
- factory LiveConsultationMemberInfo.fromJson(Map<String, dynamic> map) {
- return LiveConsultationMemberInfo(
- id: map['Id'],
- name: map['Name'],
- headImageUrl: map['HeadImageUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(id != null)
- map['Id'] = id;
- if(name != null)
- map['Name'] = name;
- if(headImageUrl != null)
- map['HeadImageUrl'] = headImageUrl;
- return map;
- }
- }
- class LiveConsultatioAccepterInfo extends LiveConsultationMemberInfo{
- bool isOnline;
- bool mute;
- bool videoOpend;
- LoginSource loginSource;
- LiveData? liveData;
- LiveConsultatioAccepterInfo({
- this.isOnline = false,
- this.mute = false,
- this.videoOpend = false,
- this.loginSource = LoginSource.PC,
- this.liveData,
- String? id,
- String? name,
- String? headImageUrl,
- }) : super(
- id: id,
- name: name,
- headImageUrl: headImageUrl,
- );
- factory LiveConsultatioAccepterInfo.fromJson(Map<String, dynamic> map) {
- return LiveConsultatioAccepterInfo(
- isOnline: map['IsOnline'],
- mute: map['Mute'],
- videoOpend: map['VideoOpend'],
- loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
- liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
- id: map['Id'],
- name: map['Name'],
- headImageUrl: map['HeadImageUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['IsOnline'] = isOnline;
- map['Mute'] = mute;
- map['VideoOpend'] = videoOpend;
- map['LoginSource'] = loginSource.index;
- if(liveData != null)
- map['LiveData'] = liveData;
- return map;
- }
- }
- class AcceptLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- LiveConsultatioAccepterInfo? accepter;
- AcceptLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.accepter,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory AcceptLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return AcceptLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- accepter: map['Accepter'] != null ? LiveConsultatioAccepterInfo.fromJson(map['Accepter']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(accepter != null)
- map['Accepter'] = accepter;
- return map;
- }
- }
- class CancelInvitingInLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- CancelInvitingInLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CancelInvitingInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return CancelInvitingInLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- return map;
- }
- }
- class CancelLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- String? initiatorCode;
- CancelLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.initiatorCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CancelLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return CancelLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- initiatorCode: map['InitiatorCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(initiatorCode != null)
- map['InitiatorCode'] = initiatorCode;
- return map;
- }
- }
- class CloseLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- String? initiatorCode;
- CloseLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.initiatorCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CloseLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return CloseLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- initiatorCode: map['InitiatorCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(initiatorCode != null)
- map['InitiatorCode'] = initiatorCode;
- return map;
- }
- }
- class ChangeConsultationNotification extends NotificationDTO{
- String? consultationCode;
- int roomNo;
- List<LiveConsultationMember >? memberLiveDatas;
- ChangeConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.roomNo = 0,
- this.memberLiveDatas,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ChangeConsultationNotification.fromJson(Map<String, dynamic> map) {
- return ChangeConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- roomNo: map['RoomNo'],
- memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['RoomNo'] = roomNo;
- if(memberLiveDatas != null)
- map['MemberLiveDatas'] = memberLiveDatas;
- return map;
- }
- }
- class ChangeConsultationToDeviceNotification extends NotificationDTO{
- String? consultationCode;
- int roomNo;
- List<LiveConsultationMember >? memberLiveDatas;
- ChangeConsultationToDeviceNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.roomNo = 0,
- this.memberLiveDatas,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory ChangeConsultationToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return ChangeConsultationToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- roomNo: map['RoomNo'],
- memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['RoomNo'] = roomNo;
- if(memberLiveDatas != null)
- map['MemberLiveDatas'] = memberLiveDatas;
- return map;
- }
- }
- class CloseConsultationDueToChangeNotification extends NotificationDTO{
- String? consultationCode;
- CloseConsultationDueToChangeNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory CloseConsultationDueToChangeNotification.fromJson(Map<String, dynamic> map) {
- return CloseConsultationDueToChangeNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- return map;
- }
- }
- class EmergencyCallFailedNotification extends NotificationDTO{
- String? consultationCode;
- EmergencyCallFailedNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory EmergencyCallFailedNotification.fromJson(Map<String, dynamic> map) {
- return EmergencyCallFailedNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- return map;
- }
- }
- class EmergencyCallNotification extends NotificationDTO{
- String? consultationCode;
- int roomNo;
- int timeout;
- LiveConsultationMember? initiator;
- EmergencyCallNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.roomNo = 0,
- this.timeout = 0,
- this.initiator,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory EmergencyCallNotification.fromJson(Map<String, dynamic> map) {
- return EmergencyCallNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- roomNo: map['RoomNo'],
- timeout: map['Timeout'],
- initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['RoomNo'] = roomNo;
- map['Timeout'] = timeout;
- if(initiator != null)
- map['Initiator'] = initiator;
- return map;
- }
- }
- class LiveConsultationJoinerInfo extends LiveConsultationMemberInfo{
- bool isOnline;
- bool mute;
- bool videoOpend;
- bool isInitiator;
- LoginSource loginSource;
- LiveData? liveData;
- int sortNumber;
- int sortLevel;
- LiveConsultationJoinerInfo({
- this.isOnline = false,
- this.mute = false,
- this.videoOpend = false,
- this.isInitiator = false,
- this.loginSource = LoginSource.PC,
- this.liveData,
- this.sortNumber = 0,
- this.sortLevel = 0,
- String? id,
- String? name,
- String? headImageUrl,
- }) : super(
- id: id,
- name: name,
- headImageUrl: headImageUrl,
- );
- factory LiveConsultationJoinerInfo.fromJson(Map<String, dynamic> map) {
- return LiveConsultationJoinerInfo(
- isOnline: map['IsOnline'],
- mute: map['Mute'],
- videoOpend: map['VideoOpend'],
- isInitiator: map['IsInitiator'],
- loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
- liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
- sortNumber: map['SortNumber'],
- sortLevel: map['SortLevel'],
- id: map['Id'],
- name: map['Name'],
- headImageUrl: map['HeadImageUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- map['IsOnline'] = isOnline;
- map['Mute'] = mute;
- map['VideoOpend'] = videoOpend;
- map['IsInitiator'] = isInitiator;
- map['LoginSource'] = loginSource.index;
- if(liveData != null)
- map['LiveData'] = liveData;
- map['SortNumber'] = sortNumber;
- map['SortLevel'] = sortLevel;
- return map;
- }
- }
- class HeartRateJoinConsultationNotification extends NotificationDTO{
- String? consultationCode;
- LiveConsultationJoinerInfo? joiner;
- HeartRateJoinConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.joiner,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory HeartRateJoinConsultationNotification.fromJson(Map<String, dynamic> map) {
- return HeartRateJoinConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(joiner != null)
- map['Joiner'] = joiner;
- return map;
- }
- }
- class LiveConsultationLeaverInfo extends LiveConsultationMemberInfo{
- LiveConsultationLeaverInfo({
- String? id,
- String? name,
- String? headImageUrl,
- }) : super(
- id: id,
- name: name,
- headImageUrl: headImageUrl,
- );
- factory LiveConsultationLeaverInfo.fromJson(Map<String, dynamic> map) {
- return LiveConsultationLeaverInfo(
- id: map['Id'],
- name: map['Name'],
- headImageUrl: map['HeadImageUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class HeartRateLeaveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- LiveConsultationLeaverInfo? leaverInfo;
- HeartRateLeaveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.leaverInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory HeartRateLeaveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return HeartRateLeaveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- leaverInfo: map['LeaverInfo'] != null ? LiveConsultationLeaverInfo.fromJson(map['LeaverInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(leaverInfo != null)
- map['LeaverInfo'] = leaverInfo;
- return map;
- }
- }
- class InviteLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- int roomNo;
- LiveConsultationMember? initiator;
- InviteLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.roomNo = 0,
- this.initiator,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory InviteLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return InviteLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- roomNo: map['RoomNo'],
- initiator: map['Initiator'] != null ? LiveConsultationMember.fromJson(map['Initiator']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['RoomNo'] = roomNo;
- if(initiator != null)
- map['Initiator'] = initiator;
- return map;
- }
- }
- class InviteInLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- int roomNo;
- LiveConsultationMember? operator;
- List<LiveConsultationMember >? memberLiveDatas;
- InviteInLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.roomNo = 0,
- this.operator,
- this.memberLiveDatas,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory InviteInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return InviteInLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- roomNo: map['RoomNo'],
- operator: map['Operator'] != null ? LiveConsultationMember.fromJson(map['Operator']) : null,
- memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['RoomNo'] = roomNo;
- if(operator != null)
- map['Operator'] = operator;
- if(memberLiveDatas != null)
- map['MemberLiveDatas'] = memberLiveDatas;
- return map;
- }
- }
- class JoinInLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- LiveConsultationJoinerInfo? joiner;
- JoinInLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.joiner,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory JoinInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return JoinInLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(joiner != null)
- map['Joiner'] = joiner;
- return map;
- }
- }
- class LiveConsultationRejecterInfo extends LiveConsultationMemberInfo{
- LiveConsultationRejecterInfo({
- String? id,
- String? name,
- String? headImageUrl,
- }) : super(
- id: id,
- name: name,
- headImageUrl: headImageUrl,
- );
- factory LiveConsultationRejecterInfo.fromJson(Map<String, dynamic> map) {
- return LiveConsultationRejecterInfo(
- id: map['Id'],
- name: map['Name'],
- headImageUrl: map['HeadImageUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class RejectInviteLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- LiveConsultationRejecterInfo? rejecter;
- RejectInviteLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.rejecter,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory RejectInviteLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return RejectInviteLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- rejecter: map['Rejecter'] != null ? LiveConsultationRejecterInfo.fromJson(map['Rejecter']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(rejecter != null)
- map['Rejecter'] = rejecter;
- return map;
- }
- }
- class JoinLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- LiveConsultationJoinerInfo? joiner;
- JoinLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.joiner,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory JoinLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return JoinLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- joiner: map['Joiner'] != null ? LiveConsultationJoinerInfo.fromJson(map['Joiner']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(joiner != null)
- map['Joiner'] = joiner;
- return map;
- }
- }
- class LeaveLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- LiveConsultationLeaverInfo? leaverInfo;
- LeaveLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.leaverInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory LeaveLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return LeaveLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- leaverInfo: map['LeaverInfo'] != null ? LiveConsultationLeaverInfo.fromJson(map['LeaverInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(leaverInfo != null)
- map['LeaverInfo'] = leaverInfo;
- return map;
- }
- }
- class LiveConsultationMuterInfo extends LiveConsultationMemberInfo{
- LiveConsultationMuterInfo({
- String? id,
- String? name,
- String? headImageUrl,
- }) : super(
- id: id,
- name: name,
- headImageUrl: headImageUrl,
- );
- factory LiveConsultationMuterInfo.fromJson(Map<String, dynamic> map) {
- return LiveConsultationMuterInfo(
- id: map['Id'],
- name: map['Name'],
- headImageUrl: map['HeadImageUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class MuteLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- bool mute;
- LiveConsultationMuterInfo? muterInfo;
- MuteLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.mute = false,
- this.muterInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory MuteLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return MuteLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- mute: map['Mute'],
- muterInfo: map['MuterInfo'] != null ? LiveConsultationMuterInfo.fromJson(map['MuterInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['Mute'] = mute;
- if(muterInfo != null)
- map['MuterInfo'] = muterInfo;
- return map;
- }
- }
- class LiveConsultationNetworkErrMemberInfo extends LiveConsultationMemberInfo{
- LiveConsultationNetworkErrMemberInfo({
- String? id,
- String? name,
- String? headImageUrl,
- }) : super(
- id: id,
- name: name,
- headImageUrl: headImageUrl,
- );
- factory LiveConsultationNetworkErrMemberInfo.fromJson(Map<String, dynamic> map) {
- return LiveConsultationNetworkErrMemberInfo(
- id: map['Id'],
- name: map['Name'],
- headImageUrl: map['HeadImageUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class NetworkErrConsultationNotification extends NotificationDTO{
- String? consultationCode;
- LiveConsultationNetworkErrMemberInfo? networkErrMemberInfo;
- NetworkErrConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.networkErrMemberInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory NetworkErrConsultationNotification.fromJson(Map<String, dynamic> map) {
- return NetworkErrConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- networkErrMemberInfo: map['NetworkErrMemberInfo'] != null ? LiveConsultationNetworkErrMemberInfo.fromJson(map['NetworkErrMemberInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(networkErrMemberInfo != null)
- map['NetworkErrMemberInfo'] = networkErrMemberInfo;
- return map;
- }
- }
- class RejectLiveConsultationNotification extends NotificationDTO{
- String? consultationCode;
- LiveConsultationRejecterInfo? rejecter;
- RejectLiveConsultationNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.rejecter,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory RejectLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return RejectLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- rejecter: map['Rejecter'] != null ? LiveConsultationRejecterInfo.fromJson(map['Rejecter']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(rejecter != null)
- map['Rejecter'] = rejecter;
- return map;
- }
- }
- class LiveConsultationSwitcherInfo extends LiveConsultationMemberInfo{
- LiveConsultationSwitcherInfo({
- String? id,
- String? name,
- String? headImageUrl,
- }) : super(
- id: id,
- name: name,
- headImageUrl: headImageUrl,
- );
- factory LiveConsultationSwitcherInfo.fromJson(Map<String, dynamic> map) {
- return LiveConsultationSwitcherInfo(
- id: map['Id'],
- name: map['Name'],
- headImageUrl: map['HeadImageUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class SwitchLiveConsultationVideoNotification extends NotificationDTO{
- String? consultationCode;
- bool opened;
- LiveConsultationSwitcherInfo? switcherInfo;
- SwitchLiveConsultationVideoNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.opened = false,
- this.switcherInfo,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory SwitchLiveConsultationVideoNotification.fromJson(Map<String, dynamic> map) {
- return SwitchLiveConsultationVideoNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- opened: map['Opened'],
- switcherInfo: map['SwitcherInfo'] != null ? LiveConsultationSwitcherInfo.fromJson(map['SwitcherInfo']) : null,
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['Opened'] = opened;
- if(switcherInfo != null)
- map['SwitcherInfo'] = switcherInfo;
- return map;
- }
- }
- class SendInteractiveBoardDataNotification extends NotificationDTO{
- String? consultationCode;
- bool isClear;
- String? userCode;
- String? boardData;
- SendInteractiveBoardDataNotification({
- NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
- this.consultationCode,
- this.isClear = false,
- this.userCode,
- this.boardData,
- String? code,
- bool isResponse = false,
- }) : super(
- notificationType: notificationType,
- code: code,
- isResponse: isResponse,
- );
- factory SendInteractiveBoardDataNotification.fromJson(Map<String, dynamic> map) {
- return SendInteractiveBoardDataNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- isClear: map['IsClear'],
- userCode: map['UserCode'],
- boardData: map['BoardData'],
- code: map['Code'],
- isResponse: map['IsResponse'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['IsClear'] = isClear;
- if(userCode != null)
- map['UserCode'] = userCode;
- if(boardData != null)
- map['BoardData'] = boardData;
- return map;
- }
- }
|