import 'notification.m.dart'; import 'liveConsultation.m.dart'; import 'device.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, } class ValueType { ValueType(); factory ValueType.fromJson(Map map) { return ValueType( ); } Map toJson() { final map = Map(); return map; } } class Decimal extends ValueType{ Decimal( ) : super( ); factory Decimal.fromJson(Map map) { return Decimal( ); } Map toJson() { final map = super.toJson(); return map; } } enum CourseExaminationTypeEnum { Practice, Release, } 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; } } class ApplyCourseRequest extends TokenRequest{ String? name; String? courseIntro; String? teacherCode; String? poster; DateTime? startTime; int duration; CourseTypeEnum courseType; CourseAudienceTypeEnum audienceType; String? coursewareToken; List? caseLabelCodes; List? courseLabelCodes; List? userGroupCodes; Decimal? price; List? courseVideoCodes; List? bindExams; List? assistants; List? experts; bool isAgentCourse; ApplyCourseRequest({ this.name, this.courseIntro, this.teacherCode, this.poster, this.startTime, this.duration = 0, this.courseType = CourseTypeEnum.Unknown, this.audienceType = CourseAudienceTypeEnum.Unknown, this.coursewareToken, this.caseLabelCodes, this.courseLabelCodes, this.userGroupCodes, this.price, this.courseVideoCodes, this.bindExams, this.assistants, this.experts, this.isAgentCourse = false, String? token, }) : super( token: token, ); factory ApplyCourseRequest.fromJson(Map map) { return ApplyCourseRequest( name: map['Name'], courseIntro: map['CourseIntro'], teacherCode: map['TeacherCode'], poster: map['Poster'], 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: map['Price'] != null ? Decimal.fromJson(map['Price']) : null, courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast().toList() : null, bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map)).toList() : null, assistants: map['Assistants'] != null ? map['Assistants'].cast().toList() : null, experts: map['Experts'] != null ? map['Experts'].cast().toList() : null, isAgentCourse: map['IsAgentCourse'], 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(poster != null) map['Poster'] = poster; 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; if(price != null) map['Price'] = price; if(courseVideoCodes != null) map['CourseVideoCodes'] = courseVideoCodes; if(bindExams != null) map['BindExams'] = bindExams; if(assistants != null) map['Assistants'] = assistants; if(experts != null) map['Experts'] = experts; map['IsAgentCourse'] = isAgentCourse; return map; } } class BaseCoursePageDTO { String? code; String? name; String? poster; DateTime? startTime; CourseStatusEnum status; String? teacherName; CourseTypeEnum courseType; CourseAudienceTypeEnum audienceType; int duration; Decimal? price; BaseCoursePageDTO({ this.code, this.name, this.poster, this.startTime, this.status = CourseStatusEnum.Unknown, this.teacherName, this.courseType = CourseTypeEnum.Unknown, this.audienceType = CourseAudienceTypeEnum.Unknown, this.duration = 0, this.price, }); factory BaseCoursePageDTO.fromJson(Map map) { return BaseCoursePageDTO( code: map['Code'], name: map['Name'], poster: map['Poster'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']), teacherName: map['TeacherName'], courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']), audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']), duration: map['Duration'], price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null, ); } Map toJson() { final map = Map(); if(code != null) map['Code'] = code; if(name != null) map['Name'] = name; if(poster != null) map['Poster'] = poster; if(startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); map['Status'] = status.index; if(teacherName != null) map['TeacherName'] = teacherName; map['CourseType'] = courseType.index; map['AudienceType'] = audienceType.index; map['Duration'] = duration; if(price != null) map['Price'] = price; return map; } } class CoursePageDTO extends BaseCoursePageDTO{ CoursePageDTO({ String? code, String? name, String? poster, DateTime? startTime, CourseStatusEnum status = CourseStatusEnum.Unknown, String? teacherName, CourseTypeEnum courseType = CourseTypeEnum.Unknown, CourseAudienceTypeEnum audienceType = CourseAudienceTypeEnum.Unknown, int duration = 0, Decimal? price, }) : super( code: code, name: name, poster: poster, startTime: startTime, status: status, teacherName: teacherName, courseType: courseType, audienceType: audienceType, duration: duration, price: price, ); factory CoursePageDTO.fromJson(Map map) { return CoursePageDTO( code: map['Code'], name: map['Name'], poster: map['Poster'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']), teacherName: map['TeacherName'], courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']), audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']), duration: map['Duration'], price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null, ); } Map toJson() { final map = super.toJson(); return map; } } class FindCoursePagesRequest extends PageRequest{ String? keyword; List? courseLabels; FindCoursePagesRequest({ this.keyword, this.courseLabels, 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, 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; 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? poster; DateTime? startTime; int duration; CourseTypeEnum courseType; CourseAudienceTypeEnum audienceType; String? coursewareToken; List? caseLabelCodes; List? courseLabelCodes; List? userGroupCodes; Decimal? price; List? courseVideoCodes; List? bindExams; List? assistants; List? experts; bool isAgentCourse; UpdateCourseRequest({ this.code, this.name, this.courseIntro, this.teacherCode, this.poster, this.startTime, this.duration = 0, this.courseType = CourseTypeEnum.Unknown, this.audienceType = CourseAudienceTypeEnum.Unknown, this.coursewareToken, this.caseLabelCodes, this.courseLabelCodes, this.userGroupCodes, this.price, this.courseVideoCodes, this.bindExams, this.assistants, this.experts, this.isAgentCourse = false, String? token, }) : super( token: token, ); factory UpdateCourseRequest.fromJson(Map map) { return UpdateCourseRequest( code: map['Code'], name: map['Name'], courseIntro: map['CourseIntro'], teacherCode: map['TeacherCode'], poster: map['Poster'], 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: map['Price'] != null ? Decimal.fromJson(map['Price']) : null, courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast().toList() : null, bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map)).toList() : null, assistants: map['Assistants'] != null ? map['Assistants'].cast().toList() : null, experts: map['Experts'] != null ? map['Experts'].cast().toList() : null, isAgentCourse: map['IsAgentCourse'], 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(poster != null) map['Poster'] = poster; 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; if(price != null) map['Price'] = price; if(courseVideoCodes != null) map['CourseVideoCodes'] = courseVideoCodes; if(bindExams != null) map['BindExams'] = bindExams; if(assistants != null) map['Assistants'] = assistants; if(experts != null) map['Experts'] = experts; map['IsAgentCourse'] = isAgentCourse; return map; } } enum CourseViewRangeEnum { All, Domestic, Overseas, } enum StudentCourseStatusEnum { All, SignUp, NoSignUp, Joined, Ended, } class StudentInfoDTO { String? code; String? name; String? phone; bool isPay; StudentCourseStatusEnum signCourseStatus; StudentInfoDTO({ this.code, this.name, this.phone, this.isPay = false, this.signCourseStatus = StudentCourseStatusEnum.All, }); 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']), ); } 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; return map; } } class BaseCourseInfoDTO { String? code; String? name; String? courseIntro; String? teacherCode; String? teacherName; String? poster; DateTime? startTime; int duration; CourseTypeEnum courseType; CourseAudienceTypeEnum audienceType; String? coursewareToken; CourseStatusEnum status; CourseViewRangeEnum viewRange; String? creatorCode; String? organizationCode; DateTime? createTime; Decimal? price; List? courseLabelCodes; List? caseLabelCodes; List? userGroupCodes; List? courseVideoCodes; List? bindExams; List? assistants; List? experts; bool isAgentCourse; BaseCourseInfoDTO({ this.code, this.name, this.courseIntro, this.teacherCode, this.teacherName, this.poster, this.startTime, this.duration = 0, 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, this.courseLabelCodes, this.caseLabelCodes, this.userGroupCodes, this.courseVideoCodes, this.bindExams, this.assistants, this.experts, this.isAgentCourse = false, }); factory BaseCourseInfoDTO.fromJson(Map map) { return BaseCourseInfoDTO( code: map['Code'], name: map['Name'], courseIntro: map['CourseIntro'], teacherCode: map['TeacherCode'], teacherName: map['TeacherName'], poster: map['Poster'], 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'], 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: map['Price'] != null ? Decimal.fromJson(map['Price']) : null, 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, bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map)).toList() : null, 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'], ); } 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(poster != null) map['Poster'] = poster; 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; 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!); if(price != null) 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(bindExams != null) map['BindExams'] = bindExams; if(assistants != null) map['Assistants'] = assistants; if(experts != null) map['Experts'] = experts; map['IsAgentCourse'] = isAgentCourse; return map; } } class BaseUserGroupDTO extends BaseDTO{ String? code; String? name; BaseUserGroupDTO({ this.code, this.name, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory BaseUserGroupDTO.fromJson(Map map) { return BaseUserGroupDTO( code: map['Code'], name: map['Name'], 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; return map; } } class VideoInfoDTO { String? code; String? name; String? videoToken; String? poster; String? vodFileId; int duration; double videoSize; DateTime? createTime; VideoInfoDTO({ this.code, this.name, this.videoToken, this.poster, this.vodFileId, this.duration = 0, this.videoSize = 0, this.createTime, }); 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, ); } 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!); return map; } } class CourseInfoDetailDTO extends BaseCourseInfoDTO{ List? students; List? caseLabels; List? courseLabels; List? userGroups; List? courseVideos; bool needPay; StudentCourseStatusEnum signCourseStatus; bool isPay; CourseInfoDetailDTO({ this.students, this.caseLabels, this.courseLabels, this.userGroups, this.courseVideos, this.needPay = false, this.signCourseStatus = StudentCourseStatusEnum.All, this.isPay = false, String? code, String? name, String? courseIntro, String? teacherCode, String? teacherName, String? poster, DateTime? startTime, int duration = 0, CourseTypeEnum courseType = CourseTypeEnum.Unknown, CourseAudienceTypeEnum audienceType = CourseAudienceTypeEnum.Unknown, String? coursewareToken, CourseStatusEnum status = CourseStatusEnum.Unknown, CourseViewRangeEnum viewRange = CourseViewRangeEnum.All, String? creatorCode, String? organizationCode, DateTime? createTime, Decimal? price, List? courseLabelCodes, List? caseLabelCodes, List? userGroupCodes, List? courseVideoCodes, List? bindExams, List? assistants, List? experts, bool isAgentCourse = false, }) : super( code: code, name: name, courseIntro: courseIntro, teacherCode: teacherCode, teacherName: teacherName, poster: poster, startTime: startTime, duration: duration, 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, bindExams: bindExams, assistants: assistants, experts: experts, isAgentCourse: isAgentCourse, ); factory CourseInfoDetailDTO.fromJson(Map map) { return CourseInfoDetailDTO( students: map['Students'] != null ? (map['Students'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map)).toList() : null, 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, needPay: map['NeedPay'], signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']), isPay: map['IsPay'], code: map['Code'], name: map['Name'], courseIntro: map['CourseIntro'], teacherCode: map['TeacherCode'], teacherName: map['TeacherName'], poster: map['Poster'], 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'], 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: map['Price'] != null ? Decimal.fromJson(map['Price']) : null, 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, bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map)).toList() : null, 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'], ); } Map toJson() { final map = super.toJson(); if(students != null) map['Students'] = students; if(caseLabels != null) map['CaseLabels'] = caseLabels; if(courseLabels != null) map['CourseLabels'] = courseLabels; if(userGroups != null) map['UserGroups'] = userGroups; if(courseVideos != null) map['CourseVideos'] = courseVideos; map['NeedPay'] = needPay; map['SignCourseStatus'] = signCourseStatus.index; map['IsPay'] = isPay; 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 StudentInCoursePageDTO extends BaseCoursePageDTO{ StudentCourseStatusEnum signCourseStatus; bool isPay; StudentInCoursePageDTO({ this.signCourseStatus = StudentCourseStatusEnum.All, this.isPay = false, String? code, String? name, String? poster, DateTime? startTime, CourseStatusEnum status = CourseStatusEnum.Unknown, String? teacherName, CourseTypeEnum courseType = CourseTypeEnum.Unknown, CourseAudienceTypeEnum audienceType = CourseAudienceTypeEnum.Unknown, int duration = 0, Decimal? price, }) : super( code: code, name: name, poster: poster, startTime: startTime, status: status, teacherName: teacherName, courseType: courseType, audienceType: audienceType, duration: duration, price: price, ); factory StudentInCoursePageDTO.fromJson(Map map) { return StudentInCoursePageDTO( signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']), isPay: map['IsPay'], code: map['Code'], name: map['Name'], poster: map['Poster'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']), teacherName: map['TeacherName'], courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']), audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']), duration: map['Duration'], price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null, ); } Map toJson() { final map = super.toJson(); map['SignCourseStatus'] = signCourseStatus.index; map['IsPay'] = isPay; return map; } } enum QueryCourseSortEnum { StartTime, Recommended, } enum QueryCourseTypeEnum { All, LiveCourse, VideoCourse, } class FindStudentInCoursePagesRequest extends PageRequest{ String? keyword; StudentCourseStatusEnum queryStatus; DateTime? startTime; QueryCourseSortEnum queryCourseSort; QueryCourseTypeEnum courseType; FindStudentInCoursePagesRequest({ this.keyword, this.queryStatus = StudentCourseStatusEnum.All, this.startTime, this.queryCourseSort = QueryCourseSortEnum.StartTime, this.courseType = QueryCourseTypeEnum.All, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory FindStudentInCoursePagesRequest.fromJson(Map map) { return FindStudentInCoursePagesRequest( keyword: map['Keyword'], queryStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['QueryStatus']), startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, queryCourseSort: QueryCourseSortEnum.values.firstWhere((e) => e.index == map['QueryCourseSort']), courseType: QueryCourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']), 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; if(startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); map['QueryCourseSort'] = queryCourseSort.index; map['CourseType'] = courseType.index; return map; } } class UserGroupDTO extends BaseUserGroupDTO{ int maxPeople; String? creatorCode; String? creatorName; List? students; UserGroupDTO({ this.maxPeople = 0, this.creatorCode, this.creatorName, this.students, String? code, String? name, DateTime? createTime, DateTime? updateTime, }) : super( code: code, name: name, 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, code: map['Code'], name: map['Name'], 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; return map; } } class UserGroupRequest extends TokenRequest{ String? code; String? name; int maxPeople; String? creatorCode; List? students; List? removeStudentCodes; UserGroupRequest({ this.code, this.name, this.maxPeople = 0, this.creatorCode, this.students, this.removeStudentCodes, 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, 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; return map; } } class QueryStudentByGroupCodePageRequest extends PageRequest{ String? keyword; String? userGroupCode; QueryStudentByGroupCodePageRequest({ this.keyword, this.userGroupCode, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory QueryStudentByGroupCodePageRequest.fromJson(Map map) { return QueryStudentByGroupCodePageRequest( keyword: map['Keyword'], userGroupCode: map['UserGroupCode'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyword != null) map['Keyword'] = keyword; if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; 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; String? code; String? name; String? videoToken; String? vodFileId; String? poster; int duration; double videoSize; SaveVideoRequest({ this.courseCode, this.code, this.name, this.videoToken, this.vodFileId, this.poster, this.duration = 0, this.videoSize = 0, String? token, }) : super( token: token, ); factory SaveVideoRequest.fromJson(Map map) { return SaveVideoRequest( courseCode: map['CourseCode'], code: map['Code'], name: map['Name'], videoToken: map['VideoToken'], vodFileId: map['VodFileId'], poster: map['Poster'], duration: map['Duration'], videoSize: double.parse(map['VideoSize'].toString()), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; 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; return map; } } class FindVideoPagesRequest extends PageRequest{ String? keyword; String? courseCode; FindVideoPagesRequest({ this.keyword, this.courseCode, 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'], 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; 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? courseCode; SignUpCourseRequest({ this.courseCode, String? token, }) : super( token: token, ); factory SignUpCourseRequest.fromJson(Map map) { return SignUpCourseRequest( courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; return map; } } class CancelSignUpCourseRequest extends TokenRequest{ String? courseCode; CancelSignUpCourseRequest({ this.courseCode, String? token, }) : super( token: token, ); factory CancelSignUpCourseRequest.fromJson(Map map) { return CancelSignUpCourseRequest( courseCode: map['CourseCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(courseCode != null) map['CourseCode'] = courseCode; 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; } } enum LiveMemberStatus { Default, Accepted, Rejected, Joined, Left, } class LiveCourseMember { String? id; String? name; LiveMemberEnum memberType; String? headImageToken; UserStatusEnum userStatusType; bool mute; bool videoOpend; bool isTeacher; bool isExpertUser; bool isAssistantUser; LiveMemberStatus status; String? loginServerUrl; LoginSource loginSource; LiveDataDTO? liveData; List? videoDeviceInfos; bool isControllingParameter; bool mergedChannel; int mergedVideoOutputWidth; int mergedVideoOutputHeight; LiveCourseMember({ this.id, this.name, this.memberType = LiveMemberEnum.User, this.headImageToken, this.userStatusType = UserStatusEnum.NotOnline, this.mute = false, this.videoOpend = false, this.isTeacher = false, this.isExpertUser = false, this.isAssistantUser = false, this.status = LiveMemberStatus.Default, this.loginServerUrl, this.loginSource = LoginSource.PC, this.liveData, this.videoDeviceInfos, this.isControllingParameter = false, this.mergedChannel = false, this.mergedVideoOutputWidth = 0, this.mergedVideoOutputHeight = 0, }); factory LiveCourseMember.fromJson(Map map) { return LiveCourseMember( id: map['Id'], name: map['Name'], memberType: LiveMemberEnum.values.firstWhere((e) => e.index == map['MemberType']), headImageToken: map['HeadImageToken'], userStatusType: UserStatusEnum.values.firstWhere((e) => e.index == map['UserStatusType']), mute: map['Mute'], videoOpend: map['VideoOpend'], isTeacher: map['IsTeacher'], isExpertUser: map['IsExpertUser'], isAssistantUser: map['IsAssistantUser'], status: LiveMemberStatus.values.firstWhere((e) => e.index == map['Status']), loginServerUrl: map['LoginServerUrl'], loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']), liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null, videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map)).toList() : null, isControllingParameter: map['IsControllingParameter'], mergedChannel: map['MergedChannel'], mergedVideoOutputWidth: map['MergedVideoOutputWidth'], mergedVideoOutputHeight: map['MergedVideoOutputHeight'], ); } Map toJson() { final map = Map(); if(id != null) map['Id'] = id; if(name != null) map['Name'] = name; map['MemberType'] = memberType.index; if(headImageToken != null) map['HeadImageToken'] = headImageToken; map['UserStatusType'] = userStatusType.index; map['Mute'] = mute; map['VideoOpend'] = videoOpend; map['IsTeacher'] = isTeacher; map['IsExpertUser'] = isExpertUser; map['IsAssistantUser'] = isAssistantUser; map['Status'] = status.index; if(loginServerUrl != null) map['LoginServerUrl'] = loginServerUrl; map['LoginSource'] = loginSource.index; if(liveData != null) map['LiveData'] = liveData; if(videoDeviceInfos != null) map['VideoDeviceInfos'] = videoDeviceInfos; map['IsControllingParameter'] = isControllingParameter; map['MergedChannel'] = mergedChannel; map['MergedVideoOutputWidth'] = mergedVideoOutputWidth; map['MergedVideoOutputHeight'] = mergedVideoOutputHeight; return map; } } class InitiateLiveCourseResult extends LiveCourseBaseResult{ String? initiatorCode; int roomNo; String? liveProtocol; int appId; String? userSign; List? memberLiveDatas; InitiateLiveCourseResult({ this.initiatorCode, this.roomNo = 0, this.liveProtocol, this.appId = 0, this.userSign, this.memberLiveDatas, String? courseCode, }) : super( courseCode: courseCode, ); factory InitiateLiveCourseResult.fromJson(Map map) { return InitiateLiveCourseResult( initiatorCode: map['InitiatorCode'], roomNo: map['RoomNo'], liveProtocol: 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, courseCode: map['CourseCode'], ); } Map toJson() { final map = super.toJson(); if(initiatorCode != null) map['InitiatorCode'] = initiatorCode; map['RoomNo'] = roomNo; if(liveProtocol != null) map['LiveProtocol'] = liveProtocol; map['AppId'] = appId; if(userSign != null) map['UserSign'] = userSign; if(memberLiveDatas != null) map['MemberLiveDatas'] = memberLiveDatas; 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; String? liveProtocol; int appId; String? userSign; List? memberLiveDatas; JoinLiveCourseResult({ this.userCode, this.roomNo = 0, this.liveProtocol, this.appId = 0, this.userSign, this.memberLiveDatas, String? courseCode, }) : super( courseCode: courseCode, ); factory JoinLiveCourseResult.fromJson(Map map) { return JoinLiveCourseResult( userCode: map['UserCode'], roomNo: map['RoomNo'], liveProtocol: 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, courseCode: map['CourseCode'], ); } Map toJson() { final map = super.toJson(); if(userCode != null) map['UserCode'] = userCode; map['RoomNo'] = roomNo; if(liveProtocol != null) map['LiveProtocol'] = liveProtocol; map['AppId'] = appId; if(userSign != null) map['UserSign'] = userSign; if(memberLiveDatas != null) map['MemberLiveDatas'] = memberLiveDatas; 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 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 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; 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, 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, 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; 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, 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, 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, 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 { String? userGroupCode; List? studentCodes; AddStudentInCourseUserGroupRequest({ this.userGroupCode, this.studentCodes, }); factory AddStudentInCourseUserGroupRequest.fromJson(Map map) { return AddStudentInCourseUserGroupRequest( userGroupCode: map['UserGroupCode'], studentCodes: map['StudentCodes'] != null ? map['StudentCodes'].cast().toList() : null, ); } Map toJson() { final map = Map(); if(userGroupCode != null) map['UserGroupCode'] = userGroupCode; if(studentCodes != null) map['StudentCodes'] = studentCodes; 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; } }