import 'notification.m.dart'; import 'liveConsultation.m.dart'; import 'package:fis_jsonrpc/utils.dart'; class BaseLabelInfoDTO extends BaseDTO{ String? code; String? name; String? parentCode; BaseLabelInfoDTO({ this.code, this.name, this.parentCode, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory BaseLabelInfoDTO.fromJson(Map map) { return BaseLabelInfoDTO( code: map['Code'], name: map['Name'], parentCode: map['ParentCode'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; if(parentCode != null) map['ParentCode'] = parentCode; return map; } } enum LabelTypeEnum { Unknown, CaseLabel, CourseLabel, } class LabelLanguageConfigDTO { String? name; String? languageCode; LabelLanguageConfigDTO({ this.name, this.languageCode, }); factory LabelLanguageConfigDTO.fromJson(Map map) { return LabelLanguageConfigDTO( name: map['Name'], languageCode: map['LanguageCode'], ); } Map toJson() { final map = Map(); if(name != null) map['Name'] = name; if(languageCode != null) map['LanguageCode'] = languageCode; return map; } } class CourseLabelDTO extends BaseLabelInfoDTO{ String? languageCode; LabelTypeEnum type; OrganizationPatientTypeEnum useObjectType; bool isLastLevel; List? childLabels; List? labelLanguageConfigs; CourseLabelDTO({ this.languageCode, this.type = LabelTypeEnum.Unknown, this.useObjectType = OrganizationPatientTypeEnum.Person, this.isLastLevel = false, this.childLabels, this.labelLanguageConfigs, String? code, String? name, String? parentCode, DateTime? createTime, DateTime? updateTime, }) : super( code: code, name: name, parentCode: parentCode, createTime: createTime, updateTime: updateTime, ); factory CourseLabelDTO.fromJson(Map map) { return CourseLabelDTO( languageCode: map['LanguageCode'], type: LabelTypeEnum.values.firstWhere((e) => e.index == map['Type']), useObjectType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['UseObjectType']), isLastLevel: map['IsLastLevel'], childLabels: map['ChildLabels'] != null ? (map['ChildLabels'] as List).map((e)=>CourseLabelDTO.fromJson(e as Map)).toList() : null, labelLanguageConfigs: map['LabelLanguageConfigs'] != null ? (map['LabelLanguageConfigs'] as List).map((e)=>LabelLanguageConfigDTO.fromJson(e as Map)).toList() : null, code: map['Code'], name: map['Name'], parentCode: map['ParentCode'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if(languageCode != null) map['LanguageCode'] = languageCode; map['Type'] = type.index; map['UseObjectType'] = useObjectType.index; map['IsLastLevel'] = isLastLevel; if(childLabels != null) map['ChildLabels'] = childLabels; if(labelLanguageConfigs != null) map['LabelLanguageConfigs'] = labelLanguageConfigs; return map; } } class QueryCourseLabelListRequest extends TokenRequest{ String? name; String? languageCode; LabelTypeEnum type; String? parentCode; QueryCourseLabelListRequest({ this.name, this.languageCode, this.type = LabelTypeEnum.Unknown, this.parentCode, String? token, }) : super( token: token, ); factory QueryCourseLabelListRequest.fromJson(Map map) { return QueryCourseLabelListRequest( name: map['Name'], languageCode: map['LanguageCode'], type: LabelTypeEnum.values.firstWhere((e) => e.index == map['Type']), parentCode: map['ParentCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(name != null) map['Name'] = name; if(languageCode != null) map['LanguageCode'] = languageCode; map['Type'] = type.index; if(parentCode != null) map['ParentCode'] = parentCode; return map; } } enum CourseTypeEnum { Unknown, LiveCourse, VideoCourse, Multimedia, } enum CourseAudienceTypeEnum { Unknown, PublicClass, PrivateClass, } enum CourseAppearTypeEnum { Unknown, Independent, Album, } class ApplyCourseRequest extends TokenRequest{ String? name; String? courseIntro; String? teacherCode; String? cover; DateTime? startTime; int duration; CourseTypeEnum courseType; CourseAudienceTypeEnum audienceType; String? coursewareToken; List? caseLabelCodes; List? courseLabelCodes; List? userGroupCodes; double price; List? courseVideoCodes; List? courseMaterialCodes; List? bindExams; bool isSmallClass; List? assistants; List? experts; bool isAgentCourse; List? courseAlbumCodes; CourseAppearTypeEnum courseAppearType; ApplyCourseRequest({ this.name, this.courseIntro, this.teacherCode, this.cover, this.startTime, this.duration = 0, this.courseType = CourseTypeEnum.Unknown, this.audienceType = CourseAudienceTypeEnum.Unknown, this.coursewareToken, this.caseLabelCodes, this.courseLabelCodes, this.userGroupCodes, this.price = 0, this.courseVideoCodes, this.courseMaterialCodes, this.bindExams, this.isSmallClass = false, this.assistants, this.experts, this.isAgentCourse = false, this.courseAlbumCodes, this.courseAppearType = CourseAppearTypeEnum.Unknown, String? token, }) : super( token: token, ); factory ApplyCourseRequest.fromJson(Map map) { return ApplyCourseRequest( name: map['Name'], courseIntro: map['CourseIntro'], teacherCode: map['TeacherCode'], cover: map['Cover'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, duration: map['Duration'], courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']), audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']), coursewareToken: map['CoursewareToken'], caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast().toList() : null, courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast().toList() : null, userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast().toList() : null, price: double.parse(map['Price'].toString()), courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast().toList() : null, courseMaterialCodes: map['CourseMaterialCodes'] != null ? map['CourseMaterialCodes'].cast().toList() : null, bindExams: map['BindExams'] != null ? map['BindExams'].cast().toList() : null, isSmallClass: map['IsSmallClass'], assistants: map['Assistants'] != null ? map['Assistants'].cast().toList() : null, experts: map['Experts'] != null ? map['Experts'].cast().toList() : null, isAgentCourse: map['IsAgentCourse'], courseAlbumCodes: map['CourseAlbumCodes'] != null ? map['CourseAlbumCodes'].cast().toList() : null, courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(name != null) map['Name'] = name; if(courseIntro != null) map['CourseIntro'] = courseIntro; if(teacherCode != null) map['TeacherCode'] = teacherCode; if(cover != null) map['Cover'] = cover; if(startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); map['Duration'] = duration; map['CourseType'] = courseType.index; map['AudienceType'] = audienceType.index; if(coursewareToken != null) map['CoursewareToken'] = coursewareToken; if(caseLabelCodes != null) map['CaseLabelCodes'] = caseLabelCodes; if(courseLabelCodes != null) map['CourseLabelCodes'] = courseLabelCodes; if(userGroupCodes != null) map['UserGroupCodes'] = userGroupCodes; map['Price'] = price; if(courseVideoCodes != null) map['CourseVideoCodes'] = courseVideoCodes; if(courseMaterialCodes != null) map['CourseMaterialCodes'] = courseMaterialCodes; if(bindExams != null) map['BindExams'] = bindExams; map['IsSmallClass'] = isSmallClass; if(assistants != null) map['Assistants'] = assistants; if(experts != null) map['Experts'] = experts; map['IsAgentCourse'] = isAgentCourse; if(courseAlbumCodes != null) map['CourseAlbumCodes'] = courseAlbumCodes; map['CourseAppearType'] = courseAppearType.index; return map; } } enum CourseViewRangeEnum { All, Domestic, Overseas, } enum CourseExaminationTypeEnum { Practice, Exam, } class BaseCourseExaminationDTO { String? code; String? name; bool isRelease; CourseExaminationTypeEnum examinationType; DateTime? startTime; int examDuration; double totalScore; BaseCourseExaminationDTO({ this.code, this.name, this.isRelease = false, this.examinationType = CourseExaminationTypeEnum.Practice, this.startTime, this.examDuration = 0, this.totalScore = 0, }); factory BaseCourseExaminationDTO.fromJson(Map map) { return BaseCourseExaminationDTO( code: map['Code'], name: map['Name'], isRelease: map['IsRelease'], examinationType: CourseExaminationTypeEnum.values.firstWhere((e) => e.index == map['ExaminationType']), startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, examDuration: map['ExamDuration'], totalScore: double.parse(map['TotalScore'].toString()), ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; map['IsRelease'] = isRelease; map['ExaminationType'] = examinationType.index; if(startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); map['ExamDuration'] = examDuration; map['TotalScore'] = totalScore; return map; } } enum QuestionTypeEnum { placeHolder_0, Judge, SingleChoice, MultipleChoice, ShortAnswer, } class QuestionOptionDTO { String? code; String? content; bool trueOrFalse; QuestionOptionDTO({ this.code, this.content, this.trueOrFalse = false, }); factory QuestionOptionDTO.fromJson(Map map) { return QuestionOptionDTO( code: map['Code'], content: map['Content'], trueOrFalse: map['TrueOrFalse'], ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(content != null) map['Content'] = content; map['TrueOrFalse'] = trueOrFalse; return map; } } class QuestionFileDTO { String? sourceUrl; String? previewImageUrl; String? coverImageUrl; DateTime? createTime; String? creatorCode; RemedicalFileDataTypeEnum fileDataType; QuestionFileDTO({ this.sourceUrl, this.previewImageUrl, this.coverImageUrl, this.createTime, this.creatorCode, this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle, }); factory QuestionFileDTO.fromJson(Map map) { return QuestionFileDTO( sourceUrl: map['SourceUrl'], previewImageUrl: map['PreviewImageUrl'], coverImageUrl: map['CoverImageUrl'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, creatorCode: map['CreatorCode'], fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']), ); } Map toJson() { final map = Map(); if(sourceUrl != null) map['SourceUrl'] = sourceUrl; if(previewImageUrl != null) map['PreviewImageUrl'] = previewImageUrl; if(coverImageUrl != null) map['CoverImageUrl'] = coverImageUrl; if(createTime != null) map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!); if(creatorCode != null) map['CreatorCode'] = creatorCode; map['FileDataType'] = fileDataType.index; return map; } } class CourseExaminationQuestionDTO { String? code; String? stem; QuestionTypeEnum questionType; List? questionOptionList; List? fileList; bool trueOrFalse; double score; CourseExaminationQuestionDTO({ this.code, this.stem, this.questionType = QuestionTypeEnum.Judge, this.questionOptionList, this.fileList, this.trueOrFalse = false, this.score = 0, }); factory CourseExaminationQuestionDTO.fromJson(Map map) { return CourseExaminationQuestionDTO( code: map['Code'], stem: map['Stem'], questionType: QuestionTypeEnum.values.firstWhere((e) => e.index == map['QuestionType']), questionOptionList: map['QuestionOptionList'] != null ? (map['QuestionOptionList'] as List).map((e)=>QuestionOptionDTO.fromJson(e as Map)).toList() : null, fileList: map['FileList'] != null ? (map['FileList'] as List).map((e)=>QuestionFileDTO.fromJson(e as Map)).toList() : null, trueOrFalse: map['TrueOrFalse'], score: double.parse(map['Score'].toString()), ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(stem != null) map['Stem'] = stem; map['QuestionType'] = questionType.index; if(questionOptionList != null) map['QuestionOptionList'] = questionOptionList; if(fileList != null) map['FileList'] = fileList; map['TrueOrFalse'] = trueOrFalse; map['Score'] = score; return map; } } class CourseExaminationDTO extends BaseCourseExaminationDTO{ List? questionList; int submitLimitCount; int passingScore; CourseExaminationDTO({ this.questionList, this.submitLimitCount = 0, this.passingScore = 0, String? code, String? name, bool isRelease = false, CourseExaminationTypeEnum examinationType = CourseExaminationTypeEnum.Practice, DateTime? startTime, int examDuration = 0, double totalScore = 0, }) : super( code: code, name: name, isRelease: isRelease, examinationType: examinationType, startTime: startTime, examDuration: examDuration, totalScore: totalScore, ); factory CourseExaminationDTO.fromJson(Map map) { return CourseExaminationDTO( questionList: map['QuestionList'] != null ? (map['QuestionList'] as List).map((e)=>CourseExaminationQuestionDTO.fromJson(e as Map)).toList() : null, submitLimitCount: map['SubmitLimitCount'], passingScore: map['PassingScore'], code: map['Code'], name: map['Name'], isRelease: map['IsRelease'], examinationType: CourseExaminationTypeEnum.values.firstWhere((e) => e.index == map['ExaminationType']), startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, examDuration: map['ExamDuration'], totalScore: double.parse(map['TotalScore'].toString()), ); } Map toJson() { final map = super.toJson(); if(questionList != null) map['QuestionList'] = questionList; map['SubmitLimitCount'] = submitLimitCount; map['PassingScore'] = passingScore; return map; } } enum StudentCourseStatusEnum { All, SignUp, NoSignUp, Joined, Ended, MyCreated, } enum LearnerStatusEnum { Unknown, NoApproval, Accept, Reject, } class StudentInfoDTO { String? code; String? name; String? phone; bool isPay; StudentCourseStatusEnum signCourseStatus; LearnerStatusEnum learnerStatus; StudentInfoDTO({ this.code, this.name, this.phone, this.isPay = false, this.signCourseStatus = StudentCourseStatusEnum.All, this.learnerStatus = LearnerStatusEnum.Unknown, }); factory StudentInfoDTO.fromJson(Map map) { return StudentInfoDTO( code: map['Code'], name: map['Name'], phone: map['Phone'], isPay: map['IsPay'], signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']), learnerStatus: LearnerStatusEnum.values.firstWhere((e) => e.index == map['LearnerStatus']), ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; if(phone != null) map['Phone'] = phone; map['IsPay'] = isPay; map['SignCourseStatus'] = signCourseStatus.index; map['LearnerStatus'] = learnerStatus.index; return map; } } class ScreenSharingChannelDTO { int rtcRoomId; int sdkAppId; String? userCode; String? userSign; LiveDataDTO? liveData; ScreenSharingChannelDTO({ this.rtcRoomId = 0, this.sdkAppId = 0, this.userCode, this.userSign, this.liveData, }); factory ScreenSharingChannelDTO.fromJson(Map map) { return ScreenSharingChannelDTO( rtcRoomId: map['RtcRoomId'], sdkAppId: map['SdkAppId'], userCode: map['UserCode'], userSign: map['UserSign'], liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null, ); } Map toJson() { final map = Map(); map['RtcRoomId'] = rtcRoomId; map['SdkAppId'] = sdkAppId; if(userCode != null) map['UserCode'] = userCode; if(userSign != null) map['UserSign'] = userSign; if(liveData != null) map['LiveData'] = liveData; return map; } } class BaseCourseInfoDTO { String? code; String? name; String? courseIntro; String? teacherCode; String? teacherName; String? cover; DateTime? startTime; int duration; DateTime? actualStartTime; DateTime? actualEndTime; CourseTypeEnum courseType; CourseAudienceTypeEnum audienceType; String? coursewareToken; CourseStatusEnum status; CourseViewRangeEnum viewRange; String? creatorCode; String? organizationCode; DateTime? createTime; double price; List? courseLabelCodes; List? caseLabelCodes; List? userGroupCodes; List? courseVideoCodes; List? courseMaterialCodes; List? bindExams; bool isSmallClass; List? assistants; List? experts; bool isAgentCourse; List? courseAlbumCodes; CourseAppearTypeEnum courseAppearType; bool isStick; int sort; int playCount; int signInCount; String? defaultVideoToken; LiveDataDTO? courseChannel; LiveDataDTO? othersScreenSharingChannel; ScreenSharingChannelDTO? rtcScreenSharingChannel; BaseCourseInfoDTO({ this.code, this.name, this.courseIntro, this.teacherCode, this.teacherName, this.cover, this.startTime, this.duration = 0, this.actualStartTime, this.actualEndTime, this.courseType = CourseTypeEnum.Unknown, this.audienceType = CourseAudienceTypeEnum.Unknown, this.coursewareToken, this.status = CourseStatusEnum.Unknown, this.viewRange = CourseViewRangeEnum.All, this.creatorCode, this.organizationCode, this.createTime, this.price = 0, this.courseLabelCodes, this.caseLabelCodes, this.userGroupCodes, this.courseVideoCodes, this.courseMaterialCodes, this.bindExams, this.isSmallClass = false, this.assistants, this.experts, this.isAgentCourse = false, this.courseAlbumCodes, this.courseAppearType = CourseAppearTypeEnum.Unknown, this.isStick = false, this.sort = 0, this.playCount = 0, this.signInCount = 0, this.defaultVideoToken, this.courseChannel, this.othersScreenSharingChannel, this.rtcScreenSharingChannel, }); factory BaseCourseInfoDTO.fromJson(Map map) { return BaseCourseInfoDTO( code: map['Code'], name: map['Name'], courseIntro: map['CourseIntro'], teacherCode: map['TeacherCode'], teacherName: map['TeacherName'], cover: map['Cover'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, duration: map['Duration'], actualStartTime: map['ActualStartTime'] != null ? DateTime.parse(map['ActualStartTime']) : null, actualEndTime: map['ActualEndTime'] != null ? DateTime.parse(map['ActualEndTime']) : null, courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']), audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']), coursewareToken: map['CoursewareToken'], status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']), viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']), creatorCode: map['CreatorCode'], organizationCode: map['OrganizationCode'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, price: double.parse(map['Price'].toString()), courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast().toList() : null, caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast().toList() : null, userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast().toList() : null, courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast().toList() : null, courseMaterialCodes: map['CourseMaterialCodes'] != null ? map['CourseMaterialCodes'].cast().toList() : null, bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map)).toList() : null, isSmallClass: map['IsSmallClass'], assistants: map['Assistants'] != null ? (map['Assistants'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map)).toList() : null, experts: map['Experts'] != null ? (map['Experts'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map)).toList() : null, isAgentCourse: map['IsAgentCourse'], courseAlbumCodes: map['CourseAlbumCodes'] != null ? map['CourseAlbumCodes'].cast().toList() : null, courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']), isStick: map['IsStick'], sort: map['Sort'], playCount: map['PlayCount'], signInCount: map['SignInCount'], defaultVideoToken: map['DefaultVideoToken'], courseChannel: map['CourseChannel'] != null ? LiveDataDTO.fromJson(map['CourseChannel']) : null, othersScreenSharingChannel: map['OthersScreenSharingChannel'] != null ? LiveDataDTO.fromJson(map['OthersScreenSharingChannel']) : null, rtcScreenSharingChannel: map['RtcScreenSharingChannel'] != null ? ScreenSharingChannelDTO.fromJson(map['RtcScreenSharingChannel']) : null, ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; if(courseIntro != null) map['CourseIntro'] = courseIntro; if(teacherCode != null) map['TeacherCode'] = teacherCode; if(teacherName != null) map['TeacherName'] = teacherName; if(cover != null) map['Cover'] = cover; if(startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); map['Duration'] = duration; if(actualStartTime != null) map['ActualStartTime'] = JsonRpcUtils.dateFormat(actualStartTime!); if(actualEndTime != null) map['ActualEndTime'] = JsonRpcUtils.dateFormat(actualEndTime!); map['CourseType'] = courseType.index; map['AudienceType'] = audienceType.index; if(coursewareToken != null) map['CoursewareToken'] = coursewareToken; map['Status'] = status.index; map['ViewRange'] = viewRange.index; if(creatorCode != null) map['CreatorCode'] = creatorCode; if(organizationCode != null) map['OrganizationCode'] = organizationCode; if(createTime != null) map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!); map['Price'] = price; if(courseLabelCodes != null) map['CourseLabelCodes'] = courseLabelCodes; if(caseLabelCodes != null) map['CaseLabelCodes'] = caseLabelCodes; if(userGroupCodes != null) map['UserGroupCodes'] = userGroupCodes; if(courseVideoCodes != null) map['CourseVideoCodes'] = courseVideoCodes; if(courseMaterialCodes != null) map['CourseMaterialCodes'] = courseMaterialCodes; if(bindExams != null) map['BindExams'] = bindExams; map['IsSmallClass'] = isSmallClass; if(assistants != null) map['Assistants'] = assistants; if(experts != null) map['Experts'] = experts; map['IsAgentCourse'] = isAgentCourse; if(courseAlbumCodes != null) map['CourseAlbumCodes'] = courseAlbumCodes; map['CourseAppearType'] = courseAppearType.index; map['IsStick'] = isStick; map['Sort'] = sort; map['PlayCount'] = playCount; map['SignInCount'] = signInCount; if(defaultVideoToken != null) map['DefaultVideoToken'] = defaultVideoToken; if(courseChannel != null) map['CourseChannel'] = courseChannel; if(othersScreenSharingChannel != null) map['OthersScreenSharingChannel'] = othersScreenSharingChannel; if(rtcScreenSharingChannel != null) map['RtcScreenSharingChannel'] = rtcScreenSharingChannel; return map; } } class BaseUserGroupDTO extends BaseDTO{ String? code; String? name; String? shortCode; BaseUserGroupDTO({ this.code, this.name, this.shortCode, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory BaseUserGroupDTO.fromJson(Map map) { return BaseUserGroupDTO( code: map['Code'], name: map['Name'], shortCode: map['ShortCode'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; if(shortCode != null) map['ShortCode'] = shortCode; return map; } } enum UploadFileTypeEnum { Unknown, EXE, APK, IPA, ZIP, DAT, RAR, PNG, ICON, BMP, JPEG, JPG, GIF, WEBP, TIFF, IMG, PDF, DOC, DOCX, XLS, XLSX, MP4, MSI, VID, DICOM, PPT, PPTX, M4V, } class VideoInfoDTO { String? code; String? name; String? videoToken; String? poster; String? vodFileId; int duration; double videoSize; DateTime? createTime; String? creatorCode; String? creatorName; UploadFileTypeEnum fodderType; bool isPublic; CourseViewRangeEnum viewRange; int playCount; VideoInfoDTO({ this.code, this.name, this.videoToken, this.poster, this.vodFileId, this.duration = 0, this.videoSize = 0, this.createTime, this.creatorCode, this.creatorName, this.fodderType = UploadFileTypeEnum.Unknown, this.isPublic = false, this.viewRange = CourseViewRangeEnum.All, this.playCount = 0, }); factory VideoInfoDTO.fromJson(Map map) { return VideoInfoDTO( code: map['Code'], name: map['Name'], videoToken: map['VideoToken'], poster: map['Poster'], vodFileId: map['VodFileId'], duration: map['Duration'], videoSize: double.parse(map['VideoSize'].toString()), createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, creatorCode: map['CreatorCode'], creatorName: map['CreatorName'], fodderType: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FodderType']), isPublic: map['IsPublic'], viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']), playCount: map['PlayCount'], ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; if(videoToken != null) map['VideoToken'] = videoToken; if(poster != null) map['Poster'] = poster; if(vodFileId != null) map['VodFileId'] = vodFileId; map['Duration'] = duration; map['VideoSize'] = videoSize; if(createTime != null) map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!); if(creatorCode != null) map['CreatorCode'] = creatorCode; if(creatorName != null) map['CreatorName'] = creatorName; map['FodderType'] = fodderType.index; map['IsPublic'] = isPublic; map['ViewRange'] = viewRange.index; map['PlayCount'] = playCount; return map; } } class BaseCourseAlbumDTO { String? code; String? name; BaseCourseAlbumDTO({ this.code, this.name, }); factory BaseCourseAlbumDTO.fromJson(Map map) { return BaseCourseAlbumDTO( code: map['Code'], name: map['Name'], ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; return map; } } class CourseInfoDetailDTO extends BaseCourseInfoDTO{ List? caseLabels; List? courseLabels; List? userGroups; List? courseVideos; List? courseMaterials; List? courseAlbums; bool needPay; StudentCourseStatusEnum signCourseStatus; bool isPay; bool isParticipant; bool isAssistant; String? courseLiveUrl; String? courseShareUrl; CourseInfoDetailDTO({ this.caseLabels, this.courseLabels, this.userGroups, this.courseVideos, this.courseMaterials, this.courseAlbums, this.needPay = false, this.signCourseStatus = StudentCourseStatusEnum.All, this.isPay = false, this.isParticipant = false, this.isAssistant = false, this.courseLiveUrl, this.courseShareUrl, String? code, String? name, String? courseIntro, String? teacherCode, String? teacherName, String? cover, DateTime? startTime, int duration = 0, DateTime? actualStartTime, DateTime? actualEndTime, CourseTypeEnum courseType = CourseTypeEnum.Unknown, CourseAudienceTypeEnum audienceType = CourseAudienceTypeEnum.Unknown, String? coursewareToken, CourseStatusEnum status = CourseStatusEnum.Unknown, CourseViewRangeEnum viewRange = CourseViewRangeEnum.All, String? creatorCode, String? organizationCode, DateTime? createTime, double price = 0, List? courseLabelCodes, List? caseLabelCodes, List? userGroupCodes, List? courseVideoCodes, List? courseMaterialCodes, List? bindExams, bool isSmallClass = false, List? assistants, List? experts, bool isAgentCourse = false, List? courseAlbumCodes, CourseAppearTypeEnum courseAppearType = CourseAppearTypeEnum.Unknown, bool isStick = false, int sort = 0, int playCount = 0, int signInCount = 0, String? defaultVideoToken, LiveDataDTO? courseChannel, LiveDataDTO? othersScreenSharingChannel, ScreenSharingChannelDTO? rtcScreenSharingChannel, }) : super( code: code, name: name, courseIntro: courseIntro, teacherCode: teacherCode, teacherName: teacherName, cover: cover, startTime: startTime, duration: duration, actualStartTime: actualStartTime, actualEndTime: actualEndTime, courseType: courseType, audienceType: audienceType, coursewareToken: coursewareToken, status: status, viewRange: viewRange, creatorCode: creatorCode, organizationCode: organizationCode, createTime: createTime, price: price, courseLabelCodes: courseLabelCodes, caseLabelCodes: caseLabelCodes, userGroupCodes: userGroupCodes, courseVideoCodes: courseVideoCodes, courseMaterialCodes: courseMaterialCodes, bindExams: bindExams, isSmallClass: isSmallClass, assistants: assistants, experts: experts, isAgentCourse: isAgentCourse, courseAlbumCodes: courseAlbumCodes, courseAppearType: courseAppearType, isStick: isStick, sort: sort, playCount: playCount, signInCount: signInCount, defaultVideoToken: defaultVideoToken, courseChannel: courseChannel, othersScreenSharingChannel: othersScreenSharingChannel, rtcScreenSharingChannel: rtcScreenSharingChannel, ); factory CourseInfoDetailDTO.fromJson(Map map) { return CourseInfoDetailDTO( caseLabels: map['CaseLabels'] != null ? (map['CaseLabels'] as List).map((e)=>BaseLabelInfoDTO.fromJson(e as Map)).toList() : null, courseLabels: map['CourseLabels'] != null ? (map['CourseLabels'] as List).map((e)=>BaseLabelInfoDTO.fromJson(e as Map)).toList() : null, userGroups: map['UserGroups'] != null ? (map['UserGroups'] as List).map((e)=>BaseUserGroupDTO.fromJson(e as Map)).toList() : null, courseVideos: map['CourseVideos'] != null ? (map['CourseVideos'] as List).map((e)=>VideoInfoDTO.fromJson(e as Map)).toList() : null, courseMaterials: map['CourseMaterials'] != null ? (map['CourseMaterials'] as List).map((e)=>VideoInfoDTO.fromJson(e as Map)).toList() : null, courseAlbums: map['CourseAlbums'] != null ? (map['CourseAlbums'] as List).map((e)=>BaseCourseAlbumDTO.fromJson(e as Map)).toList() : null, needPay: map['NeedPay'], signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']), isPay: map['IsPay'], isParticipant: map['IsParticipant'], isAssistant: map['IsAssistant'], courseLiveUrl: map['CourseLiveUrl'], courseShareUrl: map['CourseShareUrl'], code: map['Code'], name: map['Name'], courseIntro: map['CourseIntro'], teacherCode: map['TeacherCode'], teacherName: map['TeacherName'], cover: map['Cover'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, duration: map['Duration'], actualStartTime: map['ActualStartTime'] != null ? DateTime.parse(map['ActualStartTime']) : null, actualEndTime: map['ActualEndTime'] != null ? DateTime.parse(map['ActualEndTime']) : null, courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']), audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']), coursewareToken: map['CoursewareToken'], status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']), viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']), creatorCode: map['CreatorCode'], organizationCode: map['OrganizationCode'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, price: double.parse(map['Price'].toString()), courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast().toList() : null, caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast().toList() : null, userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast().toList() : null, courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast().toList() : null, courseMaterialCodes: map['CourseMaterialCodes'] != null ? map['CourseMaterialCodes'].cast().toList() : null, bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map)).toList() : null, isSmallClass: map['IsSmallClass'], assistants: map['Assistants'] != null ? (map['Assistants'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map)).toList() : null, experts: map['Experts'] != null ? (map['Experts'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map)).toList() : null, isAgentCourse: map['IsAgentCourse'], courseAlbumCodes: map['CourseAlbumCodes'] != null ? map['CourseAlbumCodes'].cast().toList() : null, courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']), isStick: map['IsStick'], sort: map['Sort'], playCount: map['PlayCount'], signInCount: map['SignInCount'], defaultVideoToken: map['DefaultVideoToken'], courseChannel: map['CourseChannel'] != null ? LiveDataDTO.fromJson(map['CourseChannel']) : null, othersScreenSharingChannel: map['OthersScreenSharingChannel'] != null ? LiveDataDTO.fromJson(map['OthersScreenSharingChannel']) : null, rtcScreenSharingChannel: map['RtcScreenSharingChannel'] != null ? ScreenSharingChannelDTO.fromJson(map['RtcScreenSharingChannel']) : null, ); } Map toJson() { final map = super.toJson(); if(caseLabels != null) map['CaseLabels'] = caseLabels; if(courseLabels != null) map['CourseLabels'] = courseLabels; if(userGroups != null) map['UserGroups'] = userGroups; if(courseVideos != null) map['CourseVideos'] = courseVideos; if(courseMaterials != null) map['CourseMaterials'] = courseMaterials; if(courseAlbums != null) map['CourseAlbums'] = courseAlbums; map['NeedPay'] = needPay; map['SignCourseStatus'] = signCourseStatus.index; map['IsPay'] = isPay; map['IsParticipant'] = isParticipant; map['IsAssistant'] = isAssistant; if(courseLiveUrl != null) map['CourseLiveUrl'] = courseLiveUrl; if(courseShareUrl != null) map['CourseShareUrl'] = courseShareUrl; return map; } } enum QueryCourseApprovalStatusEnum { All, NotApproval, Approved, } class FindCoursePagesRequest extends PageRequest{ String? keyword; List? courseLabels; DateTime? startTime; DateTime? endTime; String? teacherCode; String? participantCode; String? languageCode; QueryCourseApprovalStatusEnum courseApprovalStatus; FindCoursePagesRequest({ this.keyword, this.courseLabels, this.startTime, this.endTime, this.teacherCode, this.participantCode, this.languageCode, this.courseApprovalStatus = QueryCourseApprovalStatusEnum.All, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory FindCoursePagesRequest.fromJson(Map map) { return FindCoursePagesRequest( keyword: map['Keyword'], courseLabels: map['CourseLabels'] != null ? map['CourseLabels'].cast().toList() : null, startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null, teacherCode: map['TeacherCode'], participantCode: map['ParticipantCode'], languageCode: map['LanguageCode'], courseApprovalStatus: QueryCourseApprovalStatusEnum.values.firstWhere((e) => e.index == map['CourseApprovalStatus']), pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyword != null) map['Keyword'] = keyword; if(courseLabels != null) map['CourseLabels'] = courseLabels; if(startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); if(endTime != null) map['EndTime'] = JsonRpcUtils.dateFormat(endTime!); if(teacherCode != null) map['TeacherCode'] = teacherCode; if(participantCode != null) map['ParticipantCode'] = participantCode; if(languageCode != null) map['LanguageCode'] = languageCode; map['CourseApprovalStatus'] = courseApprovalStatus.index; return map; } } class DeleteCourseByCodeRequest extends TokenRequest{ String? code; DeleteCourseByCodeRequest({ this.code, String? token, }) : super( token: token, ); factory DeleteCourseByCodeRequest.fromJson(Map map) { return DeleteCourseByCodeRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; return map; } } class UpdateCourseRequest extends TokenRequest{ String? code; String? name; String? courseIntro; String? teacherCode; String? cover; DateTime? startTime; int duration; CourseTypeEnum courseType; CourseAudienceTypeEnum audienceType; String? coursewareToken; List? caseLabelCodes; List? courseLabelCodes; List? userGroupCodes; double price; List? courseVideoCodes; List? bindExams; bool isSmallClass; List? assistants; List? experts; bool isAgentCourse; List? courseAlbumCodes; CourseAppearTypeEnum courseAppearType; List? courseMaterialCodes; UpdateCourseRequest({ this.code, this.name, this.courseIntro, this.teacherCode, this.cover, this.startTime, this.duration = 0, this.courseType = CourseTypeEnum.Unknown, this.audienceType = CourseAudienceTypeEnum.Unknown, this.coursewareToken, this.caseLabelCodes, this.courseLabelCodes, this.userGroupCodes, this.price = 0, this.courseVideoCodes, this.bindExams, this.isSmallClass = false, this.assistants, this.experts, this.isAgentCourse = false, this.courseAlbumCodes, this.courseAppearType = CourseAppearTypeEnum.Unknown, this.courseMaterialCodes, String? token, }) : super( token: token, ); factory UpdateCourseRequest.fromJson(Map map) { return UpdateCourseRequest( code: map['Code'], name: map['Name'], courseIntro: map['CourseIntro'], teacherCode: map['TeacherCode'], cover: map['Cover'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, duration: map['Duration'], courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']), audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']), coursewareToken: map['CoursewareToken'], caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast().toList() : null, courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast().toList() : null, userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast().toList() : null, price: double.parse(map['Price'].toString()), courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast().toList() : null, bindExams: map['BindExams'] != null ? map['BindExams'].cast().toList() : null, isSmallClass: map['IsSmallClass'], assistants: map['Assistants'] != null ? map['Assistants'].cast().toList() : null, experts: map['Experts'] != null ? map['Experts'].cast().toList() : null, isAgentCourse: map['IsAgentCourse'], courseAlbumCodes: map['CourseAlbumCodes'] != null ? map['CourseAlbumCodes'].cast().toList() : null, courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']), courseMaterialCodes: map['CourseMaterialCodes'] != null ? map['CourseMaterialCodes'].cast().toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; if(courseIntro != null) map['CourseIntro'] = courseIntro; if(teacherCode != null) map['TeacherCode'] = teacherCode; if(cover != null) map['Cover'] = cover; if(startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); map['Duration'] = duration; map['CourseType'] = courseType.index; map['AudienceType'] = audienceType.index; if(coursewareToken != null) map['CoursewareToken'] = coursewareToken; if(caseLabelCodes != null) map['CaseLabelCodes'] = caseLabelCodes; if(courseLabelCodes != null) map['CourseLabelCodes'] = courseLabelCodes; if(userGroupCodes != null) map['UserGroupCodes'] = userGroupCodes; map['Price'] = price; if(courseVideoCodes != null) map['CourseVideoCodes'] = courseVideoCodes; if(bindExams != null) map['BindExams'] = bindExams; map['IsSmallClass'] = isSmallClass; if(assistants != null) map['Assistants'] = assistants; if(experts != null) map['Experts'] = experts; map['IsAgentCourse'] = isAgentCourse; if(courseAlbumCodes != null) map['CourseAlbumCodes'] = courseAlbumCodes; map['CourseAppearType'] = courseAppearType.index; if(courseMaterialCodes != null) map['CourseMaterialCodes'] = courseMaterialCodes; return map; } } class FindCourseByCodeRequest extends TokenRequest{ String? code; String? languageCode; FindCourseByCodeRequest({ this.code, this.languageCode, String? token, }) : super( token: token, ); factory FindCourseByCodeRequest.fromJson(Map map) { return FindCourseByCodeRequest( code: map['Code'], languageCode: map['LanguageCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(languageCode != null) map['LanguageCode'] = languageCode; return map; } } class FindMyCoursePagesRequest extends PageRequest{ String? keyword; StudentCourseStatusEnum queryStatus; FindMyCoursePagesRequest({ this.keyword, this.queryStatus = StudentCourseStatusEnum.All, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory FindMyCoursePagesRequest.fromJson(Map map) { return FindMyCoursePagesRequest( keyword: map['Keyword'], queryStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['QueryStatus']), pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyword != null) map['Keyword'] = keyword; map['QueryStatus'] = queryStatus.index; return map; } } class CourseAlbumDTO extends BaseCourseAlbumDTO{ String? cover; List? courseCodes; String? introduction; List? courseLabelCodes; String? teacherCode; String? teacherName; CourseViewRangeEnum viewRange; double price; DateTime? createTime; int sort; bool isStick; CourseAlbumDTO({ this.cover, this.courseCodes, this.introduction, this.courseLabelCodes, this.teacherCode, this.teacherName, this.viewRange = CourseViewRangeEnum.All, this.price = 0, this.createTime, this.sort = 0, this.isStick = false, String? code, String? name, }) : super( code: code, name: name, ); factory CourseAlbumDTO.fromJson(Map map) { return CourseAlbumDTO( cover: map['Cover'], courseCodes: map['CourseCodes'] != null ? map['CourseCodes'].cast().toList() : null, introduction: map['Introduction'], courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast().toList() : null, teacherCode: map['TeacherCode'], teacherName: map['TeacherName'], viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']), price: double.parse(map['Price'].toString()), createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, sort: map['Sort'], isStick: map['IsStick'], code: map['Code'], name: map['Name'], ); } Map toJson() { final map = super.toJson(); if(cover != null) map['Cover'] = cover; if(courseCodes != null) map['CourseCodes'] = courseCodes; if(introduction != null) map['Introduction'] = introduction; if(courseLabelCodes != null) map['CourseLabelCodes'] = courseLabelCodes; if(teacherCode != null) map['TeacherCode'] = teacherCode; if(teacherName != null) map['TeacherName'] = teacherName; map['ViewRange'] = viewRange.index; map['Price'] = price; if(createTime != null) map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!); map['Sort'] = sort; map['IsStick'] = isStick; return map; } } class UserGroupDTO extends BaseUserGroupDTO{ int maxPeople; String? creatorCode; String? creatorName; List? students; int courseCount; int practiceCount; int examCount; int studentCount; bool isAgent; UserGroupDTO({ this.maxPeople = 0, this.creatorCode, this.creatorName, this.students, this.courseCount = 0, this.practiceCount = 0, this.examCount = 0, this.studentCount = 0, this.isAgent = false, String? code, String? name, String? shortCode, DateTime? createTime, DateTime? updateTime, }) : super( code: code, name: name, shortCode: shortCode, createTime: createTime, updateTime: updateTime, ); factory UserGroupDTO.fromJson(Map map) { return UserGroupDTO( maxPeople: map['MaxPeople'], creatorCode: map['CreatorCode'], creatorName: map['CreatorName'], students: map['Students'] != null ? (map['Students'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map)).toList() : null, courseCount: map['CourseCount'], practiceCount: map['PracticeCount'], examCount: map['ExamCount'], studentCount: map['StudentCount'], isAgent: map['IsAgent'], code: map['Code'], name: map['Name'], shortCode: map['ShortCode'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); map['MaxPeople'] = maxPeople; if(creatorCode != null) map['CreatorCode'] = creatorCode; if(creatorName != null) map['CreatorName'] = creatorName; if(students != null) map['Students'] = students; map['CourseCount'] = courseCount; map['PracticeCount'] = practiceCount; map['ExamCount'] = examCount; map['StudentCount'] = studentCount; map['IsAgent'] = isAgent; return map; } } class QueryUserGroupPageRequest extends PageRequest{ String? keyword; String? teacherCode; QueryUserGroupPageRequest({ this.keyword, this.teacherCode, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory QueryUserGroupPageRequest.fromJson(Map map) { return QueryUserGroupPageRequest( keyword: map['Keyword'], teacherCode: map['TeacherCode'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyword != null) map['Keyword'] = keyword; if(teacherCode != null) map['TeacherCode'] = teacherCode; return map; } } class UserGroupRequest extends TokenRequest{ String? code; String? name; int maxPeople; String? creatorCode; List? students; List? removeStudentCodes; bool isAgent; UserGroupRequest({ this.code, this.name, this.maxPeople = 0, this.creatorCode, this.students, this.removeStudentCodes, this.isAgent = false, String? token, }) : super( token: token, ); factory UserGroupRequest.fromJson(Map map) { return UserGroupRequest( code: map['Code'], name: map['Name'], maxPeople: map['MaxPeople'], creatorCode: map['CreatorCode'], students: map['Students'] != null ? (map['Students'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map)).toList() : null, removeStudentCodes: map['RemoveStudentCodes'] != null ? map['RemoveStudentCodes'].cast().toList() : null, isAgent: map['IsAgent'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; map['MaxPeople'] = maxPeople; if(creatorCode != null) map['CreatorCode'] = creatorCode; if(students != null) map['Students'] = students; if(removeStudentCodes != null) map['RemoveStudentCodes'] = removeStudentCodes; map['IsAgent'] = isAgent; return map; } } class UserGroupFilterRequest extends TokenRequest{ String? userGroupCode; String? creatorCode; String? keyword; List? studentCodes; UserGroupFilterRequest({ this.userGroupCode, this.creatorCode, this.keyword, this.studentCodes, String? token, }) : super( token: token, ); factory UserGroupFilterRequest.fromJson(Map map) { return UserGroupFilterRequest( userGroupCode: map['UserGroupCode'], creatorCode: map['CreatorCode'], keyword: map['Keyword'], studentCodes: map['StudentCodes'] != null ? map['StudentCodes'].cast().toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; if(creatorCode != null) map['CreatorCode'] = creatorCode; if(keyword != null) map['Keyword'] = keyword; if(studentCodes != null) map['StudentCodes'] = studentCodes; return map; } } class SaveVideoRequest extends TokenRequest{ String? courseCode; int category; String? code; String? name; String? videoToken; String? vodFileId; String? poster; int duration; double videoSize; String? creatorCode; String? creatorName; UploadFileTypeEnum fodderType; bool isPublic; CourseViewRangeEnum viewRange; SaveVideoRequest({ this.courseCode, this.category = 0, this.code, this.name, this.videoToken, this.vodFileId, this.poster, this.duration = 0, this.videoSize = 0, this.creatorCode, this.creatorName, this.fodderType = UploadFileTypeEnum.Unknown, this.isPublic = false, this.viewRange = CourseViewRangeEnum.All, String? token, }) : super( token: token, ); factory SaveVideoRequest.fromJson(Map map) { return SaveVideoRequest( courseCode: map['CourseCode'], category: map['Category'], code: map['Code'], name: map['Name'], videoToken: map['VideoToken'], vodFileId: map['VodFileId'], poster: map['Poster'], duration: map['Duration'], videoSize: double.parse(map['VideoSize'].toString()), creatorCode: map['CreatorCode'], creatorName: map['CreatorName'], fodderType: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FodderType']), isPublic: map['IsPublic'], viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; map['Category'] = category; if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; if(videoToken != null) map['VideoToken'] = videoToken; if(vodFileId != null) map['VodFileId'] = vodFileId; if(poster != null) map['Poster'] = poster; map['Duration'] = duration; map['VideoSize'] = videoSize; if(creatorCode != null) map['CreatorCode'] = creatorCode; if(creatorName != null) map['CreatorName'] = creatorName; map['FodderType'] = fodderType.index; map['IsPublic'] = isPublic; map['ViewRange'] = viewRange.index; return map; } } class FindVideoPagesRequest extends PageRequest{ String? keyword; String? courseCode; int category; UploadFileTypeEnum fodderType; bool isJustQueryMyUpload; FindVideoPagesRequest({ this.keyword, this.courseCode, this.category = 0, this.fodderType = UploadFileTypeEnum.Unknown, this.isJustQueryMyUpload = false, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory FindVideoPagesRequest.fromJson(Map map) { return FindVideoPagesRequest( keyword: map['Keyword'], courseCode: map['CourseCode'], category: map['Category'], fodderType: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FodderType']), isJustQueryMyUpload: map['IsJustQueryMyUpload'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyword != null) map['Keyword'] = keyword; if(courseCode != null) map['CourseCode'] = courseCode; map['Category'] = category; map['FodderType'] = fodderType.index; map['IsJustQueryMyUpload'] = isJustQueryMyUpload; return map; } } class DeleteVideoRequest extends TokenRequest{ String? code; String? courseCode; DeleteVideoRequest({ this.code, this.courseCode, String? token, }) : super( token: token, ); factory DeleteVideoRequest.fromJson(Map map) { return DeleteVideoRequest( code: map['Code'], courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(courseCode != null) map['CourseCode'] = courseCode; return map; } } class BuyCourseResult { String? courseCode; String? paymentOrderCode; String? orderTitle; double orderAmount; String? payUrl; BuyCourseResult({ this.courseCode, this.paymentOrderCode, this.orderTitle, this.orderAmount = 0, this.payUrl, }); factory BuyCourseResult.fromJson(Map map) { return BuyCourseResult( courseCode: map['CourseCode'], paymentOrderCode: map['PaymentOrderCode'], orderTitle: map['OrderTitle'], orderAmount: double.parse(map['OrderAmount'].toString()), payUrl: map['PayUrl'], ); } Map toJson() { final map = Map(); if(courseCode != null) map['CourseCode'] = courseCode; if(paymentOrderCode != null) map['PaymentOrderCode'] = paymentOrderCode; if(orderTitle != null) map['OrderTitle'] = orderTitle; map['OrderAmount'] = orderAmount; if(payUrl != null) map['PayUrl'] = payUrl; return map; } } enum PayTypeEnum { Alipay_PAGE, Alipay_WAP, WeChat_PAGE, WeChat_WAP, Paypal, } class BuyCourseRequest extends TokenRequest{ String? courseCode; int quantity; PayTypeEnum payType; BuyCourseRequest({ this.courseCode, this.quantity = 0, this.payType = PayTypeEnum.Alipay_PAGE, String? token, }) : super( token: token, ); factory BuyCourseRequest.fromJson(Map map) { return BuyCourseRequest( courseCode: map['CourseCode'], quantity: map['Quantity'], payType: PayTypeEnum.values.firstWhere((e) => e.index == map['PayType']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; map['Quantity'] = quantity; map['PayType'] = payType.index; return map; } } enum PayStatusEnum { NoPay, InPayment, Paid, } class PaymentCallbackRequest extends TokenRequest{ String? paymentOrderCode; PayStatusEnum payStatus; DateTime? payTime; PaymentCallbackRequest({ this.paymentOrderCode, this.payStatus = PayStatusEnum.NoPay, this.payTime, String? token, }) : super( token: token, ); factory PaymentCallbackRequest.fromJson(Map map) { return PaymentCallbackRequest( paymentOrderCode: map['PaymentOrderCode'], payStatus: PayStatusEnum.values.firstWhere((e) => e.index == map['PayStatus']), payTime: map['PayTime'] != null ? DateTime.parse(map['PayTime']) : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(paymentOrderCode != null) map['PaymentOrderCode'] = paymentOrderCode; map['PayStatus'] = payStatus.index; if(payTime != null) map['PayTime'] = JsonRpcUtils.dateFormat(payTime!); return map; } } class SignUpCourseRequest extends TokenRequest{ String? courseOrAlbumCode; CourseAppearTypeEnum courseAppearType; SignUpCourseRequest({ this.courseOrAlbumCode, this.courseAppearType = CourseAppearTypeEnum.Unknown, String? token, }) : super( token: token, ); factory SignUpCourseRequest.fromJson(Map map) { return SignUpCourseRequest( courseOrAlbumCode: map['CourseOrAlbumCode'], courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseOrAlbumCode != null) map['CourseOrAlbumCode'] = courseOrAlbumCode; map['CourseAppearType'] = courseAppearType.index; return map; } } class CancelSignUpCourseRequest extends TokenRequest{ String? courseOrAlbumCode; CancelSignUpCourseRequest({ this.courseOrAlbumCode, String? token, }) : super( token: token, ); factory CancelSignUpCourseRequest.fromJson(Map map) { return CancelSignUpCourseRequest( courseOrAlbumCode: map['CourseOrAlbumCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseOrAlbumCode != null) map['CourseOrAlbumCode'] = courseOrAlbumCode; return map; } } class PublishCourseExaminationPaperRequest extends TokenRequest{ String? code; String? courseCode; DateTime? startTime; PublishCourseExaminationPaperRequest({ this.code, this.courseCode, this.startTime, String? token, }) : super( token: token, ); factory PublishCourseExaminationPaperRequest.fromJson(Map map) { return PublishCourseExaminationPaperRequest( code: map['Code'], courseCode: map['CourseCode'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(courseCode != null) map['CourseCode'] = courseCode; if(startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); return map; } } class FindCourseExaminationPapersRequest extends TokenRequest{ String? courseCode; FindCourseExaminationPapersRequest({ this.courseCode, String? token, }) : super( token: token, ); factory FindCourseExaminationPapersRequest.fromJson(Map map) { return FindCourseExaminationPapersRequest( courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; return map; } } class FindCourseExaminationPaperByCodeRequest extends TokenRequest{ String? code; String? courseCode; FindCourseExaminationPaperByCodeRequest({ this.code, this.courseCode, String? token, }) : super( token: token, ); factory FindCourseExaminationPaperByCodeRequest.fromJson(Map map) { return FindCourseExaminationPaperByCodeRequest( code: map['Code'], courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(courseCode != null) map['CourseCode'] = courseCode; return map; } } class StudentSetExaminationAnswerDTO { String? questionCode; String? answer; List? files; List? optionCodeList; StudentSetExaminationAnswerDTO({ this.questionCode, this.answer, this.files, this.optionCodeList, }); factory StudentSetExaminationAnswerDTO.fromJson(Map map) { return StudentSetExaminationAnswerDTO( questionCode: map['QuestionCode'], answer: map['Answer'], files: map['Files'] != null ? map['Files'].cast().toList() : null, optionCodeList: map['OptionCodeList'] != null ? map['OptionCodeList'].cast().toList() : null, ); } Map toJson() { final map = Map(); if(questionCode != null) map['QuestionCode'] = questionCode; if(answer != null) map['Answer'] = answer; if(files != null) map['Files'] = files; if(optionCodeList != null) map['OptionCodeList'] = optionCodeList; return map; } } class SubmitCourseExaminationPaperRequest extends TokenRequest{ String? courseCode; String? code; List? answers; SubmitCourseExaminationPaperRequest({ this.courseCode, this.code, this.answers, String? token, }) : super( token: token, ); factory SubmitCourseExaminationPaperRequest.fromJson(Map map) { return SubmitCourseExaminationPaperRequest( courseCode: map['CourseCode'], code: map['Code'], answers: map['Answers'] != null ? (map['Answers'] as List).map((e)=>StudentSetExaminationAnswerDTO.fromJson(e as Map)).toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(code != null) map['Code'] = code; if(answers != null) map['Answers'] = answers; return map; } } class BaseStudentExaminationDTO { String? code; String? examinationCode; String? studentCode; String? studentName; double totalScore; BaseStudentExaminationDTO({ this.code, this.examinationCode, this.studentCode, this.studentName, this.totalScore = 0, }); factory BaseStudentExaminationDTO.fromJson(Map map) { return BaseStudentExaminationDTO( code: map['Code'], examinationCode: map['ExaminationCode'], studentCode: map['StudentCode'], studentName: map['StudentName'], totalScore: double.parse(map['TotalScore'].toString()), ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(examinationCode != null) map['ExaminationCode'] = examinationCode; if(studentCode != null) map['StudentCode'] = studentCode; if(studentName != null) map['StudentName'] = studentName; map['TotalScore'] = totalScore; return map; } } class FindCourseStudentExaminationPagesRequest extends PageRequest{ String? courseCode; String? keyword; FindCourseStudentExaminationPagesRequest({ this.courseCode, this.keyword, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory FindCourseStudentExaminationPagesRequest.fromJson(Map map) { return FindCourseStudentExaminationPagesRequest( courseCode: map['CourseCode'], keyword: map['Keyword'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(keyword != null) map['Keyword'] = keyword; return map; } } class ExaminationAnswerDTO { String? questionCode; QuestionTypeEnum questionType; String? answer; List? files; List? optionCodeList; bool isCorrect; double score; ExaminationAnswerDTO({ this.questionCode, this.questionType = QuestionTypeEnum.Judge, this.answer, this.files, this.optionCodeList, this.isCorrect = false, this.score = 0, }); factory ExaminationAnswerDTO.fromJson(Map map) { return ExaminationAnswerDTO( questionCode: map['QuestionCode'], questionType: QuestionTypeEnum.values.firstWhere((e) => e.index == map['QuestionType']), answer: map['Answer'], files: map['Files'] != null ? map['Files'].cast().toList() : null, optionCodeList: map['OptionCodeList'] != null ? map['OptionCodeList'].cast().toList() : null, isCorrect: map['IsCorrect'], score: double.parse(map['Score'].toString()), ); } Map toJson() { final map = Map(); if(questionCode != null) map['QuestionCode'] = questionCode; map['QuestionType'] = questionType.index; if(answer != null) map['Answer'] = answer; if(files != null) map['Files'] = files; if(optionCodeList != null) map['OptionCodeList'] = optionCodeList; map['IsCorrect'] = isCorrect; map['Score'] = score; return map; } } class StudentExaminationDetailDTO extends BaseStudentExaminationDTO{ CourseExaminationDTO? examination; List? studentAnswers; StudentExaminationDetailDTO({ this.examination, this.studentAnswers, String? code, String? examinationCode, String? studentCode, String? studentName, double totalScore = 0, }) : super( code: code, examinationCode: examinationCode, studentCode: studentCode, studentName: studentName, totalScore: totalScore, ); factory StudentExaminationDetailDTO.fromJson(Map map) { return StudentExaminationDetailDTO( examination: map['Examination'] != null ? CourseExaminationDTO.fromJson(map['Examination']) : null, studentAnswers: map['StudentAnswers'] != null ? (map['StudentAnswers'] as List).map((e)=>ExaminationAnswerDTO.fromJson(e as Map)).toList() : null, code: map['Code'], examinationCode: map['ExaminationCode'], studentCode: map['StudentCode'], studentName: map['StudentName'], totalScore: double.parse(map['TotalScore'].toString()), ); } Map toJson() { final map = super.toJson(); if(examination != null) map['Examination'] = examination; if(studentAnswers != null) map['StudentAnswers'] = studentAnswers; return map; } } class FindStudentExaminationByCodeRequest extends TokenRequest{ String? code; FindStudentExaminationByCodeRequest({ this.code, String? token, }) : super( token: token, ); factory FindStudentExaminationByCodeRequest.fromJson(Map map) { return FindStudentExaminationByCodeRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; return map; } } class TeacherSetExaminationAnswerDTO { String? questionCode; bool isCorrect; double score; TeacherSetExaminationAnswerDTO({ this.questionCode, this.isCorrect = false, this.score = 0, }); factory TeacherSetExaminationAnswerDTO.fromJson(Map map) { return TeacherSetExaminationAnswerDTO( questionCode: map['QuestionCode'], isCorrect: map['IsCorrect'], score: double.parse(map['Score'].toString()), ); } Map toJson() { final map = Map(); if(questionCode != null) map['QuestionCode'] = questionCode; map['IsCorrect'] = isCorrect; map['Score'] = score; return map; } } class SubmitReviewStudentExaminationRequest extends TokenRequest{ String? code; List? answers; SubmitReviewStudentExaminationRequest({ this.code, this.answers, String? token, }) : super( token: token, ); factory SubmitReviewStudentExaminationRequest.fromJson(Map map) { return SubmitReviewStudentExaminationRequest( code: map['Code'], answers: map['Answers'] != null ? (map['Answers'] as List).map((e)=>TeacherSetExaminationAnswerDTO.fromJson(e as Map)).toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(answers != null) map['Answers'] = answers; return map; } } class FindMyCourseStudentExaminationResultPagesRequest extends PageRequest{ String? courseCode; String? keyword; FindMyCourseStudentExaminationResultPagesRequest({ this.courseCode, this.keyword, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory FindMyCourseStudentExaminationResultPagesRequest.fromJson(Map map) { return FindMyCourseStudentExaminationResultPagesRequest( courseCode: map['CourseCode'], keyword: map['Keyword'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; if(keyword != null) map['Keyword'] = keyword; return map; } } class FindMyCourseStudentExaminationResultRequest extends TokenRequest{ String? code; FindMyCourseStudentExaminationResultRequest({ this.code, String? token, }) : super( token: token, ); factory FindMyCourseStudentExaminationResultRequest.fromJson(Map map) { return FindMyCourseStudentExaminationResultRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; return map; } } class LiveCourseBaseResult { String? courseCode; LiveCourseBaseResult({ this.courseCode, }); factory LiveCourseBaseResult.fromJson(Map map) { return LiveCourseBaseResult( courseCode: map['CourseCode'], ); } Map toJson() { final map = Map(); if(courseCode != null) map['CourseCode'] = courseCode; return map; } } class InitiateLiveCourseResult extends LiveCourseBaseResult{ String? initiatorCode; int roomNo; TransactionStatusEnum liveProtocol; int appId; String? userSign; int heartRateInterval; List? memberLiveDatas; LiveDataDTO? courseChannel; LiveDataDTO? othersScreenSharingChannel; ScreenSharingChannelDTO? rtcScreenSharingChannel; InitiateLiveCourseResult({ this.initiatorCode, this.roomNo = 0, this.liveProtocol = TransactionStatusEnum.Applied, this.appId = 0, this.userSign, this.heartRateInterval = 0, this.memberLiveDatas, this.courseChannel, this.othersScreenSharingChannel, this.rtcScreenSharingChannel, String? courseCode, }) : super( courseCode: courseCode, ); factory InitiateLiveCourseResult.fromJson(Map map) { return InitiateLiveCourseResult( initiatorCode: map['InitiatorCode'], roomNo: map['RoomNo'], liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']), appId: map['AppId'], userSign: map['UserSign'], heartRateInterval: map['HeartRateInterval'], memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveCourseMember.fromJson(e as Map)).toList() : null, courseChannel: map['CourseChannel'] != null ? LiveDataDTO.fromJson(map['CourseChannel']) : null, othersScreenSharingChannel: map['OthersScreenSharingChannel'] != null ? LiveDataDTO.fromJson(map['OthersScreenSharingChannel']) : null, rtcScreenSharingChannel: map['RtcScreenSharingChannel'] != null ? ScreenSharingChannelDTO.fromJson(map['RtcScreenSharingChannel']) : null, courseCode: map['CourseCode'], ); } Map toJson() { final map = super.toJson(); if(initiatorCode != null) map['InitiatorCode'] = initiatorCode; map['RoomNo'] = roomNo; map['LiveProtocol'] = liveProtocol.index; map['AppId'] = appId; if(userSign != null) map['UserSign'] = userSign; map['HeartRateInterval'] = heartRateInterval; if(memberLiveDatas != null) map['MemberLiveDatas'] = memberLiveDatas; if(courseChannel != null) map['CourseChannel'] = courseChannel; if(othersScreenSharingChannel != null) map['OthersScreenSharingChannel'] = othersScreenSharingChannel; if(rtcScreenSharingChannel != null) map['RtcScreenSharingChannel'] = rtcScreenSharingChannel; return map; } } class InitiateLiveCourseRequest extends TokenRequest{ String? courseCode; InitiateLiveCourseRequest({ this.courseCode, String? token, }) : super( token: token, ); factory InitiateLiveCourseRequest.fromJson(Map map) { return InitiateLiveCourseRequest( courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; return map; } } class JoinLiveCourseResult extends LiveCourseBaseResult{ String? userCode; int roomNo; TransactionStatusEnum liveProtocol; int appId; String? userSign; List? memberLiveDatas; List? deviceLiveDatas; int heartRateInterval; LiveDataDTO? courseChannel; ShareInfoDTO? shareInfo; LiveDataDTO? othersScreenSharingChannel; ScreenSharingChannelDTO? rtcScreenSharingChannel; JoinLiveCourseResult({ this.userCode, this.roomNo = 0, this.liveProtocol = TransactionStatusEnum.Applied, this.appId = 0, this.userSign, this.memberLiveDatas, this.deviceLiveDatas, this.heartRateInterval = 0, this.courseChannel, this.shareInfo, this.othersScreenSharingChannel, this.rtcScreenSharingChannel, String? courseCode, }) : super( courseCode: courseCode, ); factory JoinLiveCourseResult.fromJson(Map map) { return JoinLiveCourseResult( userCode: map['UserCode'], roomNo: map['RoomNo'], liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']), appId: map['AppId'], userSign: map['UserSign'], memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveCourseMember.fromJson(e as Map)).toList() : null, deviceLiveDatas: map['DeviceLiveDatas'] != null ? (map['DeviceLiveDatas'] as List).map((e)=>LiveCourseMember.fromJson(e as Map)).toList() : null, heartRateInterval: map['HeartRateInterval'], courseChannel: map['CourseChannel'] != null ? LiveDataDTO.fromJson(map['CourseChannel']) : null, shareInfo: map['ShareInfo'] != null ? ShareInfoDTO.fromJson(map['ShareInfo']) : null, othersScreenSharingChannel: map['OthersScreenSharingChannel'] != null ? LiveDataDTO.fromJson(map['OthersScreenSharingChannel']) : null, rtcScreenSharingChannel: map['RtcScreenSharingChannel'] != null ? ScreenSharingChannelDTO.fromJson(map['RtcScreenSharingChannel']) : null, courseCode: map['CourseCode'], ); } Map toJson() { final map = super.toJson(); if(userCode != null) map['UserCode'] = userCode; map['RoomNo'] = roomNo; map['LiveProtocol'] = liveProtocol.index; map['AppId'] = appId; if(userSign != null) map['UserSign'] = userSign; if(memberLiveDatas != null) map['MemberLiveDatas'] = memberLiveDatas; if(deviceLiveDatas != null) map['DeviceLiveDatas'] = deviceLiveDatas; map['HeartRateInterval'] = heartRateInterval; if(courseChannel != null) map['CourseChannel'] = courseChannel; if(shareInfo != null) map['ShareInfo'] = shareInfo; if(othersScreenSharingChannel != null) map['OthersScreenSharingChannel'] = othersScreenSharingChannel; if(rtcScreenSharingChannel != null) map['RtcScreenSharingChannel'] = rtcScreenSharingChannel; return map; } } class JoinLiveCourseRequest extends InitiateLiveCourseRequest{ String? deviceCode; JoinLiveCourseRequest({ this.deviceCode, String? courseCode, String? token, }) : super( courseCode: courseCode, token: token, ); factory JoinLiveCourseRequest.fromJson(Map map) { return JoinLiveCourseRequest( deviceCode: map['DeviceCode'], courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; return map; } } class StudentLivePullUrlResult { String? rtmpPullUrl; String? httpPullUrl; String? hlsPullUrl; StudentLivePullUrlResult({ this.rtmpPullUrl, this.httpPullUrl, this.hlsPullUrl, }); factory StudentLivePullUrlResult.fromJson(Map map) { return StudentLivePullUrlResult( rtmpPullUrl: map['RtmpPullUrl'], httpPullUrl: map['HttpPullUrl'], hlsPullUrl: map['HlsPullUrl'], ); } Map toJson() { final map = Map(); if(rtmpPullUrl != null) map['RtmpPullUrl'] = rtmpPullUrl; if(httpPullUrl != null) map['HttpPullUrl'] = httpPullUrl; if(hlsPullUrl != null) map['HlsPullUrl'] = hlsPullUrl; return map; } } class LiveHeartRateResult { String? liveCode; LiveHeartRateResult({ this.liveCode, }); factory LiveHeartRateResult.fromJson(Map map) { return LiveHeartRateResult( liveCode: map['LiveCode'], ); } Map toJson() { final map = Map(); if(liveCode != null) map['LiveCode'] = liveCode; return map; } } class LiveHeartRateRequest extends TokenRequest{ String? liveCode; LiveHeartRateRequest({ this.liveCode, String? token, }) : super( token: token, ); factory LiveHeartRateRequest.fromJson(Map map) { return LiveHeartRateRequest( liveCode: map['LiveCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(liveCode != null) map['LiveCode'] = liveCode; return map; } } class LeaveLiveCourseRequest extends InitiateLiveCourseRequest{ LeaveLiveCourseRequest({ String? courseCode, String? token, }) : super( courseCode: courseCode, token: token, ); factory LeaveLiveCourseRequest.fromJson(Map map) { return LeaveLiveCourseRequest( courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); return map; } } class SetMuteLiveCourseRequest extends InitiateLiveCourseRequest{ bool isMute; SetMuteLiveCourseRequest({ this.isMute = false, String? courseCode, String? token, }) : super( courseCode: courseCode, token: token, ); factory SetMuteLiveCourseRequest.fromJson(Map map) { return SetMuteLiveCourseRequest( isMute: map['IsMute'], courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); map['IsMute'] = isMute; return map; } } class SetVideoLiveCourseRequest extends InitiateLiveCourseRequest{ bool isOpened; SetVideoLiveCourseRequest({ this.isOpened = false, String? courseCode, String? token, }) : super( courseCode: courseCode, token: token, ); factory SetVideoLiveCourseRequest.fromJson(Map map) { return SetVideoLiveCourseRequest( isOpened: map['IsOpened'], courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); map['IsOpened'] = isOpened; return map; } } class ControlParameterInCourseRequest extends InitiateLiveCourseRequest{ List? parameters; ControlDeviceParameterEnum controlType; ControlParameterInCourseRequest({ this.parameters, this.controlType = ControlDeviceParameterEnum.Start, String? courseCode, String? token, }) : super( courseCode: courseCode, token: token, ); factory ControlParameterInCourseRequest.fromJson(Map map) { return ControlParameterInCourseRequest( parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map)).toList() : null, controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']), courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(parameters != null) map['Parameters'] = parameters; map['ControlType'] = controlType.index; return map; } } class UploadRemoteExamRequest extends TokenRequest{ String? deviceUniqueCode; String? previewFileToken; String? fileToken; int fileSize; String? coverImageToken; String? applicationCategory; String? application; RemedicalFileDataTypeEnum fileDataType; MeasuredResultsDTO? measuredResult; ScanImageDTO? commentResult; UploadRemoteExamRequest({ this.deviceUniqueCode, this.previewFileToken, this.fileToken, this.fileSize = 0, this.coverImageToken, this.applicationCategory, this.application, this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle, this.measuredResult, this.commentResult, String? token, }) : super( token: token, ); factory UploadRemoteExamRequest.fromJson(Map map) { return UploadRemoteExamRequest( deviceUniqueCode: map['DeviceUniqueCode'], previewFileToken: map['PreviewFileToken'], fileToken: map['FileToken'], fileSize: map['FileSize'], coverImageToken: map['CoverImageToken'], applicationCategory: map['ApplicationCategory'], application: map['Application'], fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']), measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null, commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(deviceUniqueCode != null) map['DeviceUniqueCode'] = deviceUniqueCode; if(previewFileToken != null) map['PreviewFileToken'] = previewFileToken; if(fileToken != null) map['FileToken'] = fileToken; map['FileSize'] = fileSize; if(coverImageToken != null) map['CoverImageToken'] = coverImageToken; if(applicationCategory != null) map['ApplicationCategory'] = applicationCategory; if(application != null) map['Application'] = application; map['FileDataType'] = fileDataType.index; if(measuredResult != null) map['MeasuredResult'] = measuredResult; if(commentResult != null) map['CommentResult'] = commentResult; return map; } } class RemoteExaminationDTO extends BaseDTO{ String? code; String? deviceCode; String? userCode; String? application; String? previewUrl; String? imageUrl; String? coverImageUrl; String? originImageUrl; int imageSize; RemedicalFileDataTypeEnum fileDataType; MeasuredResultsDTO? measuredResult; ScanImageDTO? commentResult; bool isDelete; RemoteExaminationDTO({ this.code, this.deviceCode, this.userCode, this.application, this.previewUrl, this.imageUrl, this.coverImageUrl, this.originImageUrl, this.imageSize = 0, this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle, this.measuredResult, this.commentResult, this.isDelete = false, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory RemoteExaminationDTO.fromJson(Map map) { return RemoteExaminationDTO( code: map['Code'], deviceCode: map['DeviceCode'], userCode: map['UserCode'], application: map['Application'], previewUrl: map['PreviewUrl'], imageUrl: map['ImageUrl'], coverImageUrl: map['CoverImageUrl'], originImageUrl: map['OriginImageUrl'], imageSize: map['ImageSize'], fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']), measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null, commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null, isDelete: map['IsDelete'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if(code != null) map['Code'] = code; if(deviceCode != null) map['DeviceCode'] = deviceCode; if(userCode != null) map['UserCode'] = userCode; if(application != null) map['Application'] = application; if(previewUrl != null) map['PreviewUrl'] = previewUrl; if(imageUrl != null) map['ImageUrl'] = imageUrl; if(coverImageUrl != null) map['CoverImageUrl'] = coverImageUrl; if(originImageUrl != null) map['OriginImageUrl'] = originImageUrl; map['ImageSize'] = imageSize; map['FileDataType'] = fileDataType.index; if(measuredResult != null) map['MeasuredResult'] = measuredResult; if(commentResult != null) map['CommentResult'] = commentResult; map['IsDelete'] = isDelete; return map; } } class RemoteExaminationPageDTO extends RemoteExaminationDTO{ String? deviceName; RemoteExaminationPageDTO({ this.deviceName, String? code, String? deviceCode, String? userCode, String? application, String? previewUrl, String? imageUrl, String? coverImageUrl, String? originImageUrl, int imageSize = 0, RemedicalFileDataTypeEnum fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle, MeasuredResultsDTO? measuredResult, ScanImageDTO? commentResult, bool isDelete = false, DateTime? createTime, DateTime? updateTime, }) : super( code: code, deviceCode: deviceCode, userCode: userCode, application: application, previewUrl: previewUrl, imageUrl: imageUrl, coverImageUrl: coverImageUrl, originImageUrl: originImageUrl, imageSize: imageSize, fileDataType: fileDataType, measuredResult: measuredResult, commentResult: commentResult, isDelete: isDelete, createTime: createTime, updateTime: updateTime, ); factory RemoteExaminationPageDTO.fromJson(Map map) { return RemoteExaminationPageDTO( deviceName: map['DeviceName'], code: map['Code'], deviceCode: map['DeviceCode'], userCode: map['UserCode'], application: map['Application'], previewUrl: map['PreviewUrl'], imageUrl: map['ImageUrl'], coverImageUrl: map['CoverImageUrl'], originImageUrl: map['OriginImageUrl'], imageSize: map['ImageSize'], fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']), measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null, commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null, isDelete: map['IsDelete'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if(deviceName != null) map['DeviceName'] = deviceName; return map; } } class AddStudentInCourseUserGroupRequest extends TokenRequest{ String? userGroupCode; String? shortCode; AddStudentInCourseUserGroupRequest({ this.userGroupCode, this.shortCode, String? token, }) : super( token: token, ); factory AddStudentInCourseUserGroupRequest.fromJson(Map map) { return AddStudentInCourseUserGroupRequest( userGroupCode: map['UserGroupCode'], shortCode: map['ShortCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; if(shortCode != null) map['ShortCode'] = shortCode; return map; } } class StudentLeaveCourseUserGroupRequest extends TokenRequest{ String? userGroupCode; StudentLeaveCourseUserGroupRequest({ this.userGroupCode, String? token, }) : super( token: token, ); factory StudentLeaveCourseUserGroupRequest.fromJson(Map map) { return StudentLeaveCourseUserGroupRequest( userGroupCode: map['UserGroupCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; return map; } } class StudyCompletedRequest { String? courseCode; String? studentCode; StudyCompletedRequest({ this.courseCode, this.studentCode, }); factory StudyCompletedRequest.fromJson(Map map) { return StudyCompletedRequest( courseCode: map['CourseCode'], studentCode: map['StudentCode'], ); } Map toJson() { final map = Map(); if(courseCode != null) map['CourseCode'] = courseCode; if(studentCode != null) map['StudentCode'] = studentCode; return map; } } class AddCourseAlbumRequest extends TokenRequest{ String? name; List? courseCodes; String? cover; String? introduction; List? courseLabelCodes; int sort; bool isStick; String? teacherCode; String? teacherName; CourseViewRangeEnum viewRange; double price; AddCourseAlbumRequest({ this.name, this.courseCodes, this.cover, this.introduction, this.courseLabelCodes, this.sort = 0, this.isStick = false, this.teacherCode, this.teacherName, this.viewRange = CourseViewRangeEnum.All, this.price = 0, String? token, }) : super( token: token, ); factory AddCourseAlbumRequest.fromJson(Map map) { return AddCourseAlbumRequest( name: map['Name'], courseCodes: map['CourseCodes'] != null ? map['CourseCodes'].cast().toList() : null, cover: map['Cover'], introduction: map['Introduction'], courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast().toList() : null, sort: map['Sort'], isStick: map['IsStick'], teacherCode: map['TeacherCode'], teacherName: map['TeacherName'], viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']), price: double.parse(map['Price'].toString()), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(name != null) map['Name'] = name; if(courseCodes != null) map['CourseCodes'] = courseCodes; if(cover != null) map['Cover'] = cover; if(introduction != null) map['Introduction'] = introduction; if(courseLabelCodes != null) map['CourseLabelCodes'] = courseLabelCodes; map['Sort'] = sort; map['IsStick'] = isStick; if(teacherCode != null) map['TeacherCode'] = teacherCode; if(teacherName != null) map['TeacherName'] = teacherName; map['ViewRange'] = viewRange.index; map['Price'] = price; return map; } } class DeleteCourseAlbumRequest { String? courseAlbumCode; DeleteCourseAlbumRequest({ this.courseAlbumCode, }); factory DeleteCourseAlbumRequest.fromJson(Map map) { return DeleteCourseAlbumRequest( courseAlbumCode: map['CourseAlbumCode'], ); } Map toJson() { final map = Map(); if(courseAlbumCode != null) map['CourseAlbumCode'] = courseAlbumCode; return map; } } class CourseCommonInfoDTO extends BaseCourseAlbumDTO{ String? cover; String? introduction; List? courseLabels; String? teacherCode; String? teacherName; CourseViewRangeEnum viewRange; double price; CourseTypeEnum courseType; List? userGroupList; List? courseAlbumList; StudentCourseStatusEnum signCourseStatus; bool isPay; CourseCommonInfoDTO({ this.cover, this.introduction, this.courseLabels, this.teacherCode, this.teacherName, this.viewRange = CourseViewRangeEnum.All, this.price = 0, this.courseType = CourseTypeEnum.Unknown, this.userGroupList, this.courseAlbumList, this.signCourseStatus = StudentCourseStatusEnum.All, this.isPay = false, String? code, String? name, }) : super( code: code, name: name, ); factory CourseCommonInfoDTO.fromJson(Map map) { return CourseCommonInfoDTO( cover: map['Cover'], introduction: map['Introduction'], courseLabels: map['CourseLabels'] != null ? map['CourseLabels'].cast().toList() : null, teacherCode: map['TeacherCode'], teacherName: map['TeacherName'], viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']), price: double.parse(map['Price'].toString()), courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']), userGroupList: map['UserGroupList'] != null ? (map['UserGroupList'] as List).map((e)=>BaseUserGroupDTO.fromJson(e as Map)).toList() : null, courseAlbumList: map['CourseAlbumList'] != null ? (map['CourseAlbumList'] as List).map((e)=>BaseCourseAlbumDTO.fromJson(e as Map)).toList() : null, signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']), isPay: map['IsPay'], code: map['Code'], name: map['Name'], ); } Map toJson() { final map = super.toJson(); if(cover != null) map['Cover'] = cover; if(introduction != null) map['Introduction'] = introduction; if(courseLabels != null) map['CourseLabels'] = courseLabels; if(teacherCode != null) map['TeacherCode'] = teacherCode; if(teacherName != null) map['TeacherName'] = teacherName; map['ViewRange'] = viewRange.index; map['Price'] = price; map['CourseType'] = courseType.index; if(userGroupList != null) map['UserGroupList'] = userGroupList; if(courseAlbumList != null) map['CourseAlbumList'] = courseAlbumList; map['SignCourseStatus'] = signCourseStatus.index; map['IsPay'] = isPay; return map; } } class CourseAlbumExtendDTO extends BaseCourseAlbumDTO{ List? courseInfos; int studentCount; String? cover; List? courseCodes; String? courseIntro; List? courseLabelCodes; List? courseLabelNames; String? teacherCode; String? teacherName; CourseViewRangeEnum viewRange; double price; DateTime? createTime; int sort; bool isStick; StudentCourseStatusEnum signCourseStatus; bool isPay; CourseAlbumExtendDTO({ this.courseInfos, this.studentCount = 0, this.cover, this.courseCodes, this.courseIntro, this.courseLabelCodes, this.courseLabelNames, this.teacherCode, this.teacherName, this.viewRange = CourseViewRangeEnum.All, this.price = 0, this.createTime, this.sort = 0, this.isStick = false, this.signCourseStatus = StudentCourseStatusEnum.All, this.isPay = false, String? code, String? name, }) : super( code: code, name: name, ); factory CourseAlbumExtendDTO.fromJson(Map map) { return CourseAlbumExtendDTO( courseInfos: map['CourseInfos'] != null ? (map['CourseInfos'] as List).map((e)=>CourseInfoDetailDTO.fromJson(e as Map)).toList() : null, studentCount: map['StudentCount'], cover: map['Cover'], courseCodes: map['CourseCodes'] != null ? map['CourseCodes'].cast().toList() : null, courseIntro: map['CourseIntro'], courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast().toList() : null, courseLabelNames: map['CourseLabelNames'] != null ? map['CourseLabelNames'].cast().toList() : null, teacherCode: map['TeacherCode'], teacherName: map['TeacherName'], viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']), price: double.parse(map['Price'].toString()), createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, sort: map['Sort'], isStick: map['IsStick'], signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']), isPay: map['IsPay'], code: map['Code'], name: map['Name'], ); } Map toJson() { final map = super.toJson(); if(courseInfos != null) map['CourseInfos'] = courseInfos; map['StudentCount'] = studentCount; if(cover != null) map['Cover'] = cover; if(courseCodes != null) map['CourseCodes'] = courseCodes; if(courseIntro != null) map['CourseIntro'] = courseIntro; if(courseLabelCodes != null) map['CourseLabelCodes'] = courseLabelCodes; if(courseLabelNames != null) map['CourseLabelNames'] = courseLabelNames; if(teacherCode != null) map['TeacherCode'] = teacherCode; if(teacherName != null) map['TeacherName'] = teacherName; map['ViewRange'] = viewRange.index; map['Price'] = price; if(createTime != null) map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!); map['Sort'] = sort; map['IsStick'] = isStick; map['SignCourseStatus'] = signCourseStatus.index; map['IsPay'] = isPay; return map; } } class FindCourseAlbumByCodeRequest extends TokenRequest{ String? courseAlbumCode; String? languageCode; FindCourseAlbumByCodeRequest({ this.courseAlbumCode, this.languageCode, String? token, }) : super( token: token, ); factory FindCourseAlbumByCodeRequest.fromJson(Map map) { return FindCourseAlbumByCodeRequest( courseAlbumCode: map['CourseAlbumCode'], languageCode: map['LanguageCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseAlbumCode != null) map['CourseAlbumCode'] = courseAlbumCode; if(languageCode != null) map['LanguageCode'] = languageCode; return map; } } class TeacherAddStudentsInUserGroupsRequest extends TokenRequest{ String? userGroupCode; List? studentCodes; TeacherAddStudentsInUserGroupsRequest({ this.userGroupCode, this.studentCodes, String? token, }) : super( token: token, ); factory TeacherAddStudentsInUserGroupsRequest.fromJson(Map map) { return TeacherAddStudentsInUserGroupsRequest( userGroupCode: map['UserGroupCode'], studentCodes: map['StudentCodes'] != null ? map['StudentCodes'].cast().toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; if(studentCodes != null) map['StudentCodes'] = studentCodes; return map; } } class JoinClassApprovedRequest extends TokenRequest{ String? userGroupCode; List? students; JoinClassApprovedRequest({ this.userGroupCode, this.students, String? token, }) : super( token: token, ); factory JoinClassApprovedRequest.fromJson(Map map) { return JoinClassApprovedRequest( userGroupCode: map['UserGroupCode'], students: map['Students'] != null ? map['Students'].cast().toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; if(students != null) map['Students'] = students; return map; } } class JoinClassRejectedRequest extends TokenRequest{ String? userGroupCode; List? students; JoinClassRejectedRequest({ this.userGroupCode, this.students, String? token, }) : super( token: token, ); factory JoinClassRejectedRequest.fromJson(Map map) { return JoinClassRejectedRequest( userGroupCode: map['UserGroupCode'], students: map['Students'] != null ? map['Students'].cast().toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; if(students != null) map['Students'] = students; return map; } } class UserGroupStudentsDTO { String? code; String? name; String? userGroupCode; String? phone; bool isPay; LearnerStatusEnum learnerStatus; String? organizationName; UserGroupStudentsDTO({ this.code, this.name, this.userGroupCode, this.phone, this.isPay = false, this.learnerStatus = LearnerStatusEnum.Unknown, this.organizationName, }); factory UserGroupStudentsDTO.fromJson(Map map) { return UserGroupStudentsDTO( code: map['Code'], name: map['Name'], userGroupCode: map['UserGroupCode'], phone: map['Phone'], isPay: map['IsPay'], learnerStatus: LearnerStatusEnum.values.firstWhere((e) => e.index == map['LearnerStatus']), organizationName: map['OrganizationName'], ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; if(phone != null) map['Phone'] = phone; map['IsPay'] = isPay; map['LearnerStatus'] = learnerStatus.index; if(organizationName != null) map['OrganizationName'] = organizationName; return map; } } class FindStudentListRequest extends TokenRequest{ String? userGroupCode; LearnerStatusEnum learnerStatus; FindStudentListRequest({ this.userGroupCode, this.learnerStatus = LearnerStatusEnum.Unknown, String? token, }) : super( token: token, ); factory FindStudentListRequest.fromJson(Map map) { return FindStudentListRequest( userGroupCode: map['UserGroupCode'], learnerStatus: LearnerStatusEnum.values.firstWhere((e) => e.index == map['LearnerStatus']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; map['LearnerStatus'] = learnerStatus.index; return map; } } class CreateVideosRequest extends TokenRequest{ List? videoList; CreateVideosRequest({ this.videoList, String? token, }) : super( token: token, ); factory CreateVideosRequest.fromJson(Map map) { return CreateVideosRequest( videoList: map['VideoList'] != null ? (map['VideoList'] as List).map((e)=>SaveVideoRequest.fromJson(e as Map)).toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(videoList != null) map['VideoList'] = videoList; return map; } } class GetUserPagesRequest extends PageRequest{ String? queryType; String? keyword; String? queryState; List? excludeUserCodes; GetUserPagesRequest({ this.queryType, this.keyword, this.queryState, this.excludeUserCodes, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory GetUserPagesRequest.fromJson(Map map) { return GetUserPagesRequest( queryType: map['QueryType'], keyword: map['Keyword'], queryState: map['QueryState'], excludeUserCodes: map['ExcludeUserCodes'] != null ? map['ExcludeUserCodes'].cast().toList() : null, pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(queryType != null) map['QueryType'] = queryType; if(keyword != null) map['Keyword'] = keyword; if(queryState != null) map['QueryState'] = queryState; if(excludeUserCodes != null) map['ExcludeUserCodes'] = excludeUserCodes; return map; } } class SetShareInLiveCourseRequest extends InitiateLiveCourseRequest{ CourseShareStates currentShareState; CourseShareType currentShareType; String? currentShareMemberCode; SetShareInLiveCourseRequest({ this.currentShareState = CourseShareStates.Opened, this.currentShareType = CourseShareType.Window, this.currentShareMemberCode, String? courseCode, String? token, }) : super( courseCode: courseCode, token: token, ); factory SetShareInLiveCourseRequest.fromJson(Map map) { return SetShareInLiveCourseRequest( currentShareState: CourseShareStates.values.firstWhere((e) => e.index == map['CurrentShareState']), currentShareType: CourseShareType.values.firstWhere((e) => e.index == map['CurrentShareType']), currentShareMemberCode: map['CurrentShareMemberCode'], courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); map['CurrentShareState'] = currentShareState.index; map['CurrentShareType'] = currentShareType.index; if(currentShareMemberCode != null) map['CurrentShareMemberCode'] = currentShareMemberCode; return map; } } class FindMyOrganizationExpertsRequest extends TokenRequest{ String? name; FindMyOrganizationExpertsRequest({ this.name, String? token, }) : super( token: token, ); factory FindMyOrganizationExpertsRequest.fromJson(Map map) { return FindMyOrganizationExpertsRequest( name: map['Name'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(name != null) map['Name'] = name; return map; } } class SendLiveInteractiveBoardDataRequest extends TokenRequest{ String? roomId; bool isClear; String? boardData; SendLiveInteractiveBoardDataRequest({ this.roomId, this.isClear = false, this.boardData, String? token, }) : super( token: token, ); factory SendLiveInteractiveBoardDataRequest.fromJson(Map map) { return SendLiveInteractiveBoardDataRequest( roomId: map['RoomId'], isClear: map['IsClear'], boardData: map['BoardData'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(roomId != null) map['RoomId'] = roomId; map['IsClear'] = isClear; if(boardData != null) map['BoardData'] = boardData; return map; } } class SendCourseEntryNoticeRequest extends TokenRequest{ String? clientId; String? noticeData; SendCourseEntryNoticeRequest({ this.clientId, this.noticeData, String? token, }) : super( token: token, ); factory SendCourseEntryNoticeRequest.fromJson(Map map) { return SendCourseEntryNoticeRequest( clientId: map['ClientId'], noticeData: map['NoticeData'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(clientId != null) map['ClientId'] = clientId; if(noticeData != null) map['NoticeData'] = noticeData; return map; } } class DeviceLeaveLiveCourseRequest extends JoinLiveCourseRequest{ DeviceLeaveLiveCourseRequest({ String? deviceCode, String? courseCode, String? token, }) : super( deviceCode: deviceCode, courseCode: courseCode, token: token, ); factory DeviceLeaveLiveCourseRequest.fromJson(Map map) { return DeviceLeaveLiveCourseRequest( deviceCode: map['DeviceCode'], courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); return map; } } class UpdateCourseAlbumRequest extends TokenRequest{ String? name; String? courseAlbumCode; List? courseCodes; String? cover; String? introduction; List? courseLabelCodes; int sort; bool isStick; String? teacherCode; String? teacherName; CourseViewRangeEnum viewRange; double price; UpdateCourseAlbumRequest({ this.name, this.courseAlbumCode, this.courseCodes, this.cover, this.introduction, this.courseLabelCodes, this.sort = 0, this.isStick = false, this.teacherCode, this.teacherName, this.viewRange = CourseViewRangeEnum.All, this.price = 0, String? token, }) : super( token: token, ); factory UpdateCourseAlbumRequest.fromJson(Map map) { return UpdateCourseAlbumRequest( name: map['Name'], courseAlbumCode: map['CourseAlbumCode'], courseCodes: map['CourseCodes'] != null ? map['CourseCodes'].cast().toList() : null, cover: map['Cover'], introduction: map['Introduction'], courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast().toList() : null, sort: map['Sort'], isStick: map['IsStick'], teacherCode: map['TeacherCode'], teacherName: map['TeacherName'], viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']), price: double.parse(map['Price'].toString()), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(name != null) map['Name'] = name; if(courseAlbumCode != null) map['CourseAlbumCode'] = courseAlbumCode; if(courseCodes != null) map['CourseCodes'] = courseCodes; if(cover != null) map['Cover'] = cover; if(introduction != null) map['Introduction'] = introduction; if(courseLabelCodes != null) map['CourseLabelCodes'] = courseLabelCodes; map['Sort'] = sort; map['IsStick'] = isStick; if(teacherCode != null) map['TeacherCode'] = teacherCode; if(teacherName != null) map['TeacherName'] = teacherName; map['ViewRange'] = viewRange.index; map['Price'] = price; return map; } }