123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593 |
- import 'package:fis_jsonrpc/utils.dart';
- enum NotificationTypeEnum {
- placeHolder_0,
- 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,
- }
- enum ChatCmdEnum {
- Txt,
- Image,
- MP4,
- Voice,
- Cases,
- ShareLive,
- VideoCall,
- VoiceCall,
- }
- class ChatMsgNotification {
- NotificationTypeEnum notificationType;
- String? userCode;
- ChatCmdEnum chatCmd;
- DateTime? sendTime;
- String? message;
- ChatMsgNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.userCode,
- this.chatCmd = ChatCmdEnum.Txt,
- this.sendTime,
- this.message,
- });
- 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'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- ConnectionNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- });
- factory ConnectionNotification.fromJson(Map<String, dynamic> map) {
- return ConnectionNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- return map;
- }
- }
- class DisconnectNotification {
- NotificationTypeEnum notificationType;
- DisconnectNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- });
- factory DisconnectNotification.fromJson(Map<String, dynamic> map) {
- return DisconnectNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- return map;
- }
- }
- class ExamRecordsFinishedNotification {
- NotificationTypeEnum notificationType;
- List<String >? codes;
- ExamRecordsFinishedNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.codes,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(codes != null)
- map['Codes'] = codes;
- return map;
- }
- }
- class PasswordExpiredWarningNotification {
- NotificationTypeEnum notificationType;
- double surplusTime;
- PasswordExpiredWarningNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.surplusTime = 0,
- });
- factory PasswordExpiredWarningNotification.fromJson(Map<String, dynamic> map) {
- return PasswordExpiredWarningNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- surplusTime: double.parse(map['SurplusTime'].toString()),
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- map['SurplusTime'] = surplusTime;
- return map;
- }
- }
- class TokenReplacedNotification {
- NotificationTypeEnum notificationType;
- String? userCode;
- TokenReplacedNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.userCode,
- });
- factory TokenReplacedNotification.fromJson(Map<String, dynamic> map) {
- return TokenReplacedNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- userCode: map['UserCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(userCode != null)
- map['UserCode'] = userCode;
- return map;
- }
- }
- class ApplyConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? applicationTime;
- String? applyOrganizationName;
- DateTime? consultationTime;
- ApplyConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.applicationTime,
- this.applyOrganizationName,
- this.consultationTime,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- ApprovalApplyConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 ConsultationRemindNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- int countdownTime;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- String? expertName;
- ConsultationRemindNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.countdownTime = 0,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- this.expertName,
- });
- 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'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- InviteeApproveApplyConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- InviteeConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? operatorName;
- String? patientName;
- DateTime? consultationTime;
- DateTime? consultationTimeEnd;
- String? rejectReason;
- InviteeRejectApplyConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.operatorName,
- this.patientName,
- this.consultationTime,
- this.consultationTimeEnd,
- this.rejectReason,
- });
- 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'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? patientName;
- String? operatorName;
- String? rejectReason;
- RejectApplyConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.patientName,
- this.operatorName,
- this.rejectReason,
- });
- 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'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 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;
- }
- }
- 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 LiveConsultatioAccepterInfo extends LiveConsultationMemberInfo{
- bool isOnline;
- bool mute;
- LoginSource loginSource;
- LiveData? liveData;
- LiveConsultatioAccepterInfo({
- this.isOnline = false,
- this.mute = 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'],
- 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['LoginSource'] = loginSource.index;
- if(liveData != null)
- map['LiveData'] = liveData;
- return map;
- }
- }
- class AcceptLiveConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- LiveConsultatioAccepterInfo? accepter;
- AcceptLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.accepter,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(accepter != null)
- map['Accepter'] = accepter;
- return map;
- }
- }
- class CancelInvitingInLiveConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- CancelInvitingInLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- });
- factory CancelInvitingInLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return CancelInvitingInLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- return map;
- }
- }
- class CancelLiveConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? initiatorCode;
- CancelLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.initiatorCode,
- });
- factory CancelLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return CancelLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- initiatorCode: map['InitiatorCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(initiatorCode != null)
- map['InitiatorCode'] = initiatorCode;
- return map;
- }
- }
- class CloseLiveConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? initiatorCode;
- CloseLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.initiatorCode,
- });
- factory CloseLiveConsultationNotification.fromJson(Map<String, dynamic> map) {
- return CloseLiveConsultationNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- initiatorCode: map['InitiatorCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(initiatorCode != null)
- map['InitiatorCode'] = initiatorCode;
- return map;
- }
- }
- class CancelLiveConsultationToDeviceNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? initiatorCode;
- CancelLiveConsultationToDeviceNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.initiatorCode,
- });
- factory CancelLiveConsultationToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return CancelLiveConsultationToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- initiatorCode: map['InitiatorCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(initiatorCode != null)
- map['InitiatorCode'] = initiatorCode;
- return map;
- }
- }
- class CloseLiveConsultationToDeviceNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- String? initiatorCode;
- CloseLiveConsultationToDeviceNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.initiatorCode,
- });
- factory CloseLiveConsultationToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return CloseLiveConsultationToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- initiatorCode: map['InitiatorCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(initiatorCode != null)
- map['InitiatorCode'] = initiatorCode;
- return map;
- }
- }
- class LiveConsultationJoinerInfo extends LiveConsultationMemberInfo{
- bool isOnline;
- bool mute;
- bool isInitiator;
- LoginSource loginSource;
- LiveData? liveData;
- LiveConsultationJoinerInfo({
- this.isOnline = false,
- this.mute = false,
- this.isInitiator = false,
- this.loginSource = LoginSource.PC,
- this.liveData,
- 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'],
- isInitiator: map['IsInitiator'],
- 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['IsInitiator'] = isInitiator;
- map['LoginSource'] = loginSource.index;
- if(liveData != null)
- map['LiveData'] = liveData;
- return map;
- }
- }
- class HeartRateJoinConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- LiveConsultationJoinerInfo? joiner;
- HeartRateJoinConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.joiner,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- LiveConsultationLeaverInfo? leaverInfo;
- HeartRateLeaveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.leaverInfo,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(leaverInfo != null)
- map['LeaverInfo'] = leaverInfo;
- return map;
- }
- }
- enum LiveMemberEnum {
- placeHolder_0,
- User,
- Device,
- }
- enum LiveConsultationMemberStatus {
- Default,
- Accepted,
- Rejected,
- Joined,
- Left,
- }
- enum VideoDeviceSourceTypeEnum {
- Desktop,
- Camera,
- }
- class VideoDeviceOutputInfo {
- String? videoDeviceId;
- VideoDeviceSourceTypeEnum videoDeviceSourceType;
- int outputWidth;
- int outputHeight;
- String? videoDeviceSign;
- VideoDeviceOutputInfo({
- this.videoDeviceId,
- this.videoDeviceSourceType = VideoDeviceSourceTypeEnum.Desktop,
- this.outputWidth = 0,
- this.outputHeight = 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'],
- 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;
- if(videoDeviceSign != null)
- map['VideoDeviceSign'] = videoDeviceSign;
- 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;
- LiveData? liveData;
- bool mergedChannel;
- int mergedVideoOutputWidth;
- int mergedVideoOutputHeight;
- List<VideoDeviceOutputInfo >? videoDeviceInfos;
- 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.liveData,
- this.mergedChannel = false,
- this.mergedVideoOutputWidth = 0,
- this.mergedVideoOutputHeight = 0,
- this.videoDeviceInfos,
- });
- 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']),
- liveData: map['LiveData'] != null ? LiveData.fromJson(map['LiveData']) : null,
- mergedChannel: map['MergedChannel'],
- mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
- mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
- videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
- );
- }
- 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;
- if(liveData != null)
- map['LiveData'] = liveData;
- map['MergedChannel'] = mergedChannel;
- map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
- map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
- if(videoDeviceInfos != null)
- map['VideoDeviceInfos'] = videoDeviceInfos;
- return map;
- }
- }
- class InviteLiveConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- int roomNo;
- LiveConsultationMember? initiator;
- InviteLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.roomNo = 0,
- this.initiator,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['RoomNo'] = roomNo;
- if(initiator != null)
- map['Initiator'] = initiator;
- return map;
- }
- }
- class InviteInLiveConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- int roomNo;
- LiveConsultationMember? operator;
- List<LiveConsultationMember >? memberLiveDatas;
- InviteInLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.roomNo = 0,
- this.operator,
- this.memberLiveDatas,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- LiveConsultationJoinerInfo? joiner;
- JoinInLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.joiner,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- LiveConsultationRejecterInfo? rejecter;
- RejectInviteLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.rejecter,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(rejecter != null)
- map['Rejecter'] = rejecter;
- return map;
- }
- }
- class InviteLiveConsultationToDeviceNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- int roomNo;
- String? deviceCode;
- int appId;
- String? userSign;
- bool mergedChannel;
- int mergedVideoOutputWidth;
- int mergedVideoOutputHeight;
- List<VideoDeviceOutputInfo >? videoDeviceOutputInfo;
- InviteLiveConsultationToDeviceNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.roomNo = 0,
- this.deviceCode,
- this.appId = 0,
- this.userSign,
- this.mergedChannel = false,
- this.mergedVideoOutputWidth = 0,
- this.mergedVideoOutputHeight = 0,
- this.videoDeviceOutputInfo,
- });
- factory InviteLiveConsultationToDeviceNotification.fromJson(Map<String, dynamic> map) {
- return InviteLiveConsultationToDeviceNotification(
- notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
- consultationCode: map['ConsultationCode'],
- roomNo: map['RoomNo'],
- deviceCode: map['DeviceCode'],
- appId: map['AppId'],
- userSign: map['UserSign'],
- mergedChannel: map['MergedChannel'],
- mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
- mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
- videoDeviceOutputInfo: map['VideoDeviceOutputInfo'] != null ? (map['VideoDeviceOutputInfo'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['RoomNo'] = roomNo;
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- map['AppId'] = appId;
- if(userSign != null)
- map['UserSign'] = userSign;
- map['MergedChannel'] = mergedChannel;
- map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
- map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
- if(videoDeviceOutputInfo != null)
- map['VideoDeviceOutputInfo'] = videoDeviceOutputInfo;
- return map;
- }
- }
- class JoinLiveConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- LiveConsultationJoinerInfo? joiner;
- JoinLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.joiner,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(joiner != null)
- map['Joiner'] = joiner;
- return map;
- }
- }
- class LeaveLiveConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- LiveConsultationLeaverInfo? leaverInfo;
- LeaveLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.leaverInfo,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- bool mute;
- LiveConsultationMuterInfo? muterInfo;
- MuteLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.mute = false,
- this.muterInfo,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- LiveConsultationNetworkErrMemberInfo? networkErrMemberInfo;
- NetworkErrConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.networkErrMemberInfo,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- if(networkErrMemberInfo != null)
- map['NetworkErrMemberInfo'] = networkErrMemberInfo;
- return map;
- }
- }
- class RejectLiveConsultationNotification {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- LiveConsultationRejecterInfo? rejecter;
- RejectLiveConsultationNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.rejecter,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- 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 {
- NotificationTypeEnum notificationType;
- String? consultationCode;
- bool opened;
- LiveConsultationSwitcherInfo? switcherInfo;
- SwitchLiveConsultationVideoNotification({
- this.notificationType = NotificationTypeEnum.ChatMsgNotification,
- this.consultationCode,
- this.opened = false,
- this.switcherInfo,
- });
- 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,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['NotificationType'] = notificationType.index;
- if(consultationCode != null)
- map['ConsultationCode'] = consultationCode;
- map['Opened'] = opened;
- if(switcherInfo != null)
- map['SwitcherInfo'] = switcherInfo;
- return map;
- }
- }
|