education.m.dart 97 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673
  1. import 'notification.m.dart';
  2. import 'liveConsultation.m.dart';
  3. import 'package:fis_jsonrpc/utils.dart';
  4. class BaseLabelInfoDTO extends BaseDTO{
  5. String? code;
  6. String? name;
  7. String? parentCode;
  8. BaseLabelInfoDTO({
  9. this.code,
  10. this.name,
  11. this.parentCode,
  12. DateTime? createTime,
  13. DateTime? updateTime,
  14. }) : super(
  15. createTime: createTime,
  16. updateTime: updateTime,
  17. );
  18. factory BaseLabelInfoDTO.fromJson(Map<String, dynamic> map) {
  19. return BaseLabelInfoDTO(
  20. code: map['Code'],
  21. name: map['Name'],
  22. parentCode: map['ParentCode'],
  23. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  24. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  25. );
  26. }
  27. Map<String, dynamic> toJson() {
  28. final map = super.toJson();
  29. if(code != null)
  30. map['Code'] = code;
  31. if(name != null)
  32. map['Name'] = name;
  33. if(parentCode != null)
  34. map['ParentCode'] = parentCode;
  35. return map;
  36. }
  37. }
  38. enum LabelTypeEnum {
  39. Unknown,
  40. CaseLabel,
  41. CourseLabel,
  42. }
  43. class LabelLanguageConfigDTO {
  44. String? name;
  45. String? languageCode;
  46. LabelLanguageConfigDTO({
  47. this.name,
  48. this.languageCode,
  49. });
  50. factory LabelLanguageConfigDTO.fromJson(Map<String, dynamic> map) {
  51. return LabelLanguageConfigDTO(
  52. name: map['Name'],
  53. languageCode: map['LanguageCode'],
  54. );
  55. }
  56. Map<String, dynamic> toJson() {
  57. final map = Map<String, dynamic>();
  58. if(name != null)
  59. map['Name'] = name;
  60. if(languageCode != null)
  61. map['LanguageCode'] = languageCode;
  62. return map;
  63. }
  64. }
  65. class CourseLabelDTO extends BaseLabelInfoDTO{
  66. String? languageCode;
  67. LabelTypeEnum type;
  68. OrganizationPatientTypeEnum useObjectType;
  69. bool isLastLevel;
  70. List<CourseLabelDTO >? childLabels;
  71. List<LabelLanguageConfigDTO >? labelLanguageConfigs;
  72. CourseLabelDTO({
  73. this.languageCode,
  74. this.type = LabelTypeEnum.Unknown,
  75. this.useObjectType = OrganizationPatientTypeEnum.Person,
  76. this.isLastLevel = false,
  77. this.childLabels,
  78. this.labelLanguageConfigs,
  79. String? code,
  80. String? name,
  81. String? parentCode,
  82. DateTime? createTime,
  83. DateTime? updateTime,
  84. }) : super(
  85. code: code,
  86. name: name,
  87. parentCode: parentCode,
  88. createTime: createTime,
  89. updateTime: updateTime,
  90. );
  91. factory CourseLabelDTO.fromJson(Map<String, dynamic> map) {
  92. return CourseLabelDTO(
  93. languageCode: map['LanguageCode'],
  94. type: LabelTypeEnum.values.firstWhere((e) => e.index == map['Type']),
  95. useObjectType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['UseObjectType']),
  96. isLastLevel: map['IsLastLevel'],
  97. childLabels: map['ChildLabels'] != null ? (map['ChildLabels'] as List).map((e)=>CourseLabelDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  98. labelLanguageConfigs: map['LabelLanguageConfigs'] != null ? (map['LabelLanguageConfigs'] as List).map((e)=>LabelLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  99. code: map['Code'],
  100. name: map['Name'],
  101. parentCode: map['ParentCode'],
  102. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  103. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  104. );
  105. }
  106. Map<String, dynamic> toJson() {
  107. final map = super.toJson();
  108. if(languageCode != null)
  109. map['LanguageCode'] = languageCode;
  110. map['Type'] = type.index;
  111. map['UseObjectType'] = useObjectType.index;
  112. map['IsLastLevel'] = isLastLevel;
  113. if(childLabels != null)
  114. map['ChildLabels'] = childLabels;
  115. if(labelLanguageConfigs != null)
  116. map['LabelLanguageConfigs'] = labelLanguageConfigs;
  117. return map;
  118. }
  119. }
  120. class QueryCourseLabelListRequest extends TokenRequest{
  121. String? name;
  122. String? languageCode;
  123. LabelTypeEnum type;
  124. String? parentCode;
  125. QueryCourseLabelListRequest({
  126. this.name,
  127. this.languageCode,
  128. this.type = LabelTypeEnum.Unknown,
  129. this.parentCode,
  130. String? token,
  131. }) : super(
  132. token: token,
  133. );
  134. factory QueryCourseLabelListRequest.fromJson(Map<String, dynamic> map) {
  135. return QueryCourseLabelListRequest(
  136. name: map['Name'],
  137. languageCode: map['LanguageCode'],
  138. type: LabelTypeEnum.values.firstWhere((e) => e.index == map['Type']),
  139. parentCode: map['ParentCode'],
  140. token: map['Token'],
  141. );
  142. }
  143. Map<String, dynamic> toJson() {
  144. final map = super.toJson();
  145. if(name != null)
  146. map['Name'] = name;
  147. if(languageCode != null)
  148. map['LanguageCode'] = languageCode;
  149. map['Type'] = type.index;
  150. if(parentCode != null)
  151. map['ParentCode'] = parentCode;
  152. return map;
  153. }
  154. }
  155. enum CourseTypeEnum {
  156. Unknown,
  157. LiveCourse,
  158. VideoCourse,
  159. Multimedia,
  160. }
  161. enum CourseAudienceTypeEnum {
  162. Unknown,
  163. PublicClass,
  164. PrivateClass,
  165. }
  166. enum CourseAppearTypeEnum {
  167. Unknown,
  168. Independent,
  169. Album,
  170. }
  171. class ApplyCourseRequest extends TokenRequest{
  172. String? name;
  173. String? courseIntro;
  174. String? teacherCode;
  175. String? poster;
  176. DateTime? startTime;
  177. int duration;
  178. CourseTypeEnum courseType;
  179. CourseAudienceTypeEnum audienceType;
  180. String? coursewareToken;
  181. List<String >? caseLabelCodes;
  182. List<String >? courseLabelCodes;
  183. List<String >? userGroupCodes;
  184. double price;
  185. List<String >? courseVideoCodes;
  186. List<String >? courseMaterialCodes;
  187. List<String >? bindExams;
  188. List<String >? assistants;
  189. List<String >? experts;
  190. bool isAgentCourse;
  191. List<String >? courseAlbumCodes;
  192. CourseAppearTypeEnum courseAppearType;
  193. ApplyCourseRequest({
  194. this.name,
  195. this.courseIntro,
  196. this.teacherCode,
  197. this.poster,
  198. this.startTime,
  199. this.duration = 0,
  200. this.courseType = CourseTypeEnum.Unknown,
  201. this.audienceType = CourseAudienceTypeEnum.Unknown,
  202. this.coursewareToken,
  203. this.caseLabelCodes,
  204. this.courseLabelCodes,
  205. this.userGroupCodes,
  206. this.price = 0,
  207. this.courseVideoCodes,
  208. this.courseMaterialCodes,
  209. this.bindExams,
  210. this.assistants,
  211. this.experts,
  212. this.isAgentCourse = false,
  213. this.courseAlbumCodes,
  214. this.courseAppearType = CourseAppearTypeEnum.Unknown,
  215. String? token,
  216. }) : super(
  217. token: token,
  218. );
  219. factory ApplyCourseRequest.fromJson(Map<String, dynamic> map) {
  220. return ApplyCourseRequest(
  221. name: map['Name'],
  222. courseIntro: map['CourseIntro'],
  223. teacherCode: map['TeacherCode'],
  224. poster: map['Poster'],
  225. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  226. duration: map['Duration'],
  227. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  228. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  229. coursewareToken: map['CoursewareToken'],
  230. caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast<String>().toList() : null,
  231. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  232. userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast<String>().toList() : null,
  233. price: double.parse(map['Price'].toString()),
  234. courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast<String>().toList() : null,
  235. courseMaterialCodes: map['CourseMaterialCodes'] != null ? map['CourseMaterialCodes'].cast<String>().toList() : null,
  236. bindExams: map['BindExams'] != null ? map['BindExams'].cast<String>().toList() : null,
  237. assistants: map['Assistants'] != null ? map['Assistants'].cast<String>().toList() : null,
  238. experts: map['Experts'] != null ? map['Experts'].cast<String>().toList() : null,
  239. isAgentCourse: map['IsAgentCourse'],
  240. courseAlbumCodes: map['CourseAlbumCodes'] != null ? map['CourseAlbumCodes'].cast<String>().toList() : null,
  241. courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']),
  242. token: map['Token'],
  243. );
  244. }
  245. Map<String, dynamic> toJson() {
  246. final map = super.toJson();
  247. if(name != null)
  248. map['Name'] = name;
  249. if(courseIntro != null)
  250. map['CourseIntro'] = courseIntro;
  251. if(teacherCode != null)
  252. map['TeacherCode'] = teacherCode;
  253. if(poster != null)
  254. map['Poster'] = poster;
  255. if(startTime != null)
  256. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  257. map['Duration'] = duration;
  258. map['CourseType'] = courseType.index;
  259. map['AudienceType'] = audienceType.index;
  260. if(coursewareToken != null)
  261. map['CoursewareToken'] = coursewareToken;
  262. if(caseLabelCodes != null)
  263. map['CaseLabelCodes'] = caseLabelCodes;
  264. if(courseLabelCodes != null)
  265. map['CourseLabelCodes'] = courseLabelCodes;
  266. if(userGroupCodes != null)
  267. map['UserGroupCodes'] = userGroupCodes;
  268. map['Price'] = price;
  269. if(courseVideoCodes != null)
  270. map['CourseVideoCodes'] = courseVideoCodes;
  271. if(courseMaterialCodes != null)
  272. map['CourseMaterialCodes'] = courseMaterialCodes;
  273. if(bindExams != null)
  274. map['BindExams'] = bindExams;
  275. if(assistants != null)
  276. map['Assistants'] = assistants;
  277. if(experts != null)
  278. map['Experts'] = experts;
  279. map['IsAgentCourse'] = isAgentCourse;
  280. if(courseAlbumCodes != null)
  281. map['CourseAlbumCodes'] = courseAlbumCodes;
  282. map['CourseAppearType'] = courseAppearType.index;
  283. return map;
  284. }
  285. }
  286. enum CourseViewRangeEnum {
  287. All,
  288. Domestic,
  289. Overseas,
  290. }
  291. enum CourseExaminationTypeEnum {
  292. Practice,
  293. Exam,
  294. }
  295. class BaseCourseExaminationDTO {
  296. String? code;
  297. String? name;
  298. bool isRelease;
  299. CourseExaminationTypeEnum examinationType;
  300. DateTime? startTime;
  301. int examDuration;
  302. double totalScore;
  303. BaseCourseExaminationDTO({
  304. this.code,
  305. this.name,
  306. this.isRelease = false,
  307. this.examinationType = CourseExaminationTypeEnum.Practice,
  308. this.startTime,
  309. this.examDuration = 0,
  310. this.totalScore = 0,
  311. });
  312. factory BaseCourseExaminationDTO.fromJson(Map<String, dynamic> map) {
  313. return BaseCourseExaminationDTO(
  314. code: map['Code'],
  315. name: map['Name'],
  316. isRelease: map['IsRelease'],
  317. examinationType: CourseExaminationTypeEnum.values.firstWhere((e) => e.index == map['ExaminationType']),
  318. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  319. examDuration: map['ExamDuration'],
  320. totalScore: double.parse(map['TotalScore'].toString()),
  321. );
  322. }
  323. Map<String, dynamic> toJson() {
  324. final map = Map<String, dynamic>();
  325. if(code != null)
  326. map['Code'] = code;
  327. if(name != null)
  328. map['Name'] = name;
  329. map['IsRelease'] = isRelease;
  330. map['ExaminationType'] = examinationType.index;
  331. if(startTime != null)
  332. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  333. map['ExamDuration'] = examDuration;
  334. map['TotalScore'] = totalScore;
  335. return map;
  336. }
  337. }
  338. enum QuestionTypeEnum {
  339. placeHolder_0,
  340. Judge,
  341. SingleChoice,
  342. MultipleChoice,
  343. ShortAnswer,
  344. }
  345. class QuestionOptionDTO {
  346. String? code;
  347. String? content;
  348. bool trueOrFalse;
  349. QuestionOptionDTO({
  350. this.code,
  351. this.content,
  352. this.trueOrFalse = false,
  353. });
  354. factory QuestionOptionDTO.fromJson(Map<String, dynamic> map) {
  355. return QuestionOptionDTO(
  356. code: map['Code'],
  357. content: map['Content'],
  358. trueOrFalse: map['TrueOrFalse'],
  359. );
  360. }
  361. Map<String, dynamic> toJson() {
  362. final map = Map<String, dynamic>();
  363. if(code != null)
  364. map['Code'] = code;
  365. if(content != null)
  366. map['Content'] = content;
  367. map['TrueOrFalse'] = trueOrFalse;
  368. return map;
  369. }
  370. }
  371. class QuestionFileDTO {
  372. String? sourceUrl;
  373. String? previewImageUrl;
  374. String? coverImageUrl;
  375. DateTime? createTime;
  376. String? creatorCode;
  377. RemedicalFileDataTypeEnum fileDataType;
  378. QuestionFileDTO({
  379. this.sourceUrl,
  380. this.previewImageUrl,
  381. this.coverImageUrl,
  382. this.createTime,
  383. this.creatorCode,
  384. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  385. });
  386. factory QuestionFileDTO.fromJson(Map<String, dynamic> map) {
  387. return QuestionFileDTO(
  388. sourceUrl: map['SourceUrl'],
  389. previewImageUrl: map['PreviewImageUrl'],
  390. coverImageUrl: map['CoverImageUrl'],
  391. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  392. creatorCode: map['CreatorCode'],
  393. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  394. );
  395. }
  396. Map<String, dynamic> toJson() {
  397. final map = Map<String, dynamic>();
  398. if(sourceUrl != null)
  399. map['SourceUrl'] = sourceUrl;
  400. if(previewImageUrl != null)
  401. map['PreviewImageUrl'] = previewImageUrl;
  402. if(coverImageUrl != null)
  403. map['CoverImageUrl'] = coverImageUrl;
  404. if(createTime != null)
  405. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  406. if(creatorCode != null)
  407. map['CreatorCode'] = creatorCode;
  408. map['FileDataType'] = fileDataType.index;
  409. return map;
  410. }
  411. }
  412. class CourseExaminationQuestionDTO {
  413. String? code;
  414. String? stem;
  415. QuestionTypeEnum questionType;
  416. List<QuestionOptionDTO >? questionOptionList;
  417. List<QuestionFileDTO >? fileList;
  418. bool trueOrFalse;
  419. double score;
  420. CourseExaminationQuestionDTO({
  421. this.code,
  422. this.stem,
  423. this.questionType = QuestionTypeEnum.Judge,
  424. this.questionOptionList,
  425. this.fileList,
  426. this.trueOrFalse = false,
  427. this.score = 0,
  428. });
  429. factory CourseExaminationQuestionDTO.fromJson(Map<String, dynamic> map) {
  430. return CourseExaminationQuestionDTO(
  431. code: map['Code'],
  432. stem: map['Stem'],
  433. questionType: QuestionTypeEnum.values.firstWhere((e) => e.index == map['QuestionType']),
  434. questionOptionList: map['QuestionOptionList'] != null ? (map['QuestionOptionList'] as List).map((e)=>QuestionOptionDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  435. fileList: map['FileList'] != null ? (map['FileList'] as List).map((e)=>QuestionFileDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  436. trueOrFalse: map['TrueOrFalse'],
  437. score: double.parse(map['Score'].toString()),
  438. );
  439. }
  440. Map<String, dynamic> toJson() {
  441. final map = Map<String, dynamic>();
  442. if(code != null)
  443. map['Code'] = code;
  444. if(stem != null)
  445. map['Stem'] = stem;
  446. map['QuestionType'] = questionType.index;
  447. if(questionOptionList != null)
  448. map['QuestionOptionList'] = questionOptionList;
  449. if(fileList != null)
  450. map['FileList'] = fileList;
  451. map['TrueOrFalse'] = trueOrFalse;
  452. map['Score'] = score;
  453. return map;
  454. }
  455. }
  456. class CourseExaminationDTO extends BaseCourseExaminationDTO{
  457. List<CourseExaminationQuestionDTO >? questionList;
  458. int submitLimitCount;
  459. int passingScore;
  460. CourseExaminationDTO({
  461. this.questionList,
  462. this.submitLimitCount = 0,
  463. this.passingScore = 0,
  464. String? code,
  465. String? name,
  466. bool isRelease = false,
  467. CourseExaminationTypeEnum examinationType = CourseExaminationTypeEnum.Practice,
  468. DateTime? startTime,
  469. int examDuration = 0,
  470. double totalScore = 0,
  471. }) : super(
  472. code: code,
  473. name: name,
  474. isRelease: isRelease,
  475. examinationType: examinationType,
  476. startTime: startTime,
  477. examDuration: examDuration,
  478. totalScore: totalScore,
  479. );
  480. factory CourseExaminationDTO.fromJson(Map<String, dynamic> map) {
  481. return CourseExaminationDTO(
  482. questionList: map['QuestionList'] != null ? (map['QuestionList'] as List).map((e)=>CourseExaminationQuestionDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  483. submitLimitCount: map['SubmitLimitCount'],
  484. passingScore: map['PassingScore'],
  485. code: map['Code'],
  486. name: map['Name'],
  487. isRelease: map['IsRelease'],
  488. examinationType: CourseExaminationTypeEnum.values.firstWhere((e) => e.index == map['ExaminationType']),
  489. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  490. examDuration: map['ExamDuration'],
  491. totalScore: double.parse(map['TotalScore'].toString()),
  492. );
  493. }
  494. Map<String, dynamic> toJson() {
  495. final map = super.toJson();
  496. if(questionList != null)
  497. map['QuestionList'] = questionList;
  498. map['SubmitLimitCount'] = submitLimitCount;
  499. map['PassingScore'] = passingScore;
  500. return map;
  501. }
  502. }
  503. enum StudentCourseStatusEnum {
  504. All,
  505. SignUp,
  506. NoSignUp,
  507. Joined,
  508. Ended,
  509. }
  510. enum LearnerStatusEnum {
  511. Unknown,
  512. NoApproval,
  513. Accept,
  514. Reject,
  515. }
  516. class StudentInfoDTO {
  517. String? code;
  518. String? name;
  519. String? phone;
  520. bool isPay;
  521. StudentCourseStatusEnum signCourseStatus;
  522. LearnerStatusEnum learnerStatus;
  523. StudentInfoDTO({
  524. this.code,
  525. this.name,
  526. this.phone,
  527. this.isPay = false,
  528. this.signCourseStatus = StudentCourseStatusEnum.All,
  529. this.learnerStatus = LearnerStatusEnum.Unknown,
  530. });
  531. factory StudentInfoDTO.fromJson(Map<String, dynamic> map) {
  532. return StudentInfoDTO(
  533. code: map['Code'],
  534. name: map['Name'],
  535. phone: map['Phone'],
  536. isPay: map['IsPay'],
  537. signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']),
  538. learnerStatus: LearnerStatusEnum.values.firstWhere((e) => e.index == map['LearnerStatus']),
  539. );
  540. }
  541. Map<String, dynamic> toJson() {
  542. final map = Map<String, dynamic>();
  543. if(code != null)
  544. map['Code'] = code;
  545. if(name != null)
  546. map['Name'] = name;
  547. if(phone != null)
  548. map['Phone'] = phone;
  549. map['IsPay'] = isPay;
  550. map['SignCourseStatus'] = signCourseStatus.index;
  551. map['LearnerStatus'] = learnerStatus.index;
  552. return map;
  553. }
  554. }
  555. class BaseCourseInfoDTO {
  556. String? code;
  557. String? name;
  558. String? courseIntro;
  559. String? teacherCode;
  560. String? teacherName;
  561. String? poster;
  562. DateTime? startTime;
  563. int duration;
  564. CourseTypeEnum courseType;
  565. CourseAudienceTypeEnum audienceType;
  566. String? coursewareToken;
  567. CourseStatusEnum status;
  568. CourseViewRangeEnum viewRange;
  569. String? creatorCode;
  570. String? organizationCode;
  571. DateTime? createTime;
  572. double price;
  573. List<String >? courseLabelCodes;
  574. List<String >? caseLabelCodes;
  575. List<String >? userGroupCodes;
  576. List<String >? courseVideoCodes;
  577. List<String >? courseMaterialCodes;
  578. List<CourseExaminationDTO >? bindExams;
  579. List<StudentInfoDTO >? assistants;
  580. List<StudentInfoDTO >? experts;
  581. bool isAgentCourse;
  582. List<String >? courseAlbumCodes;
  583. CourseAppearTypeEnum courseAppearType;
  584. bool isStick;
  585. int sort;
  586. int playCount;
  587. int signInCount;
  588. String? defaultVideoToken;
  589. BaseCourseInfoDTO({
  590. this.code,
  591. this.name,
  592. this.courseIntro,
  593. this.teacherCode,
  594. this.teacherName,
  595. this.poster,
  596. this.startTime,
  597. this.duration = 0,
  598. this.courseType = CourseTypeEnum.Unknown,
  599. this.audienceType = CourseAudienceTypeEnum.Unknown,
  600. this.coursewareToken,
  601. this.status = CourseStatusEnum.Unknown,
  602. this.viewRange = CourseViewRangeEnum.All,
  603. this.creatorCode,
  604. this.organizationCode,
  605. this.createTime,
  606. this.price = 0,
  607. this.courseLabelCodes,
  608. this.caseLabelCodes,
  609. this.userGroupCodes,
  610. this.courseVideoCodes,
  611. this.courseMaterialCodes,
  612. this.bindExams,
  613. this.assistants,
  614. this.experts,
  615. this.isAgentCourse = false,
  616. this.courseAlbumCodes,
  617. this.courseAppearType = CourseAppearTypeEnum.Unknown,
  618. this.isStick = false,
  619. this.sort = 0,
  620. this.playCount = 0,
  621. this.signInCount = 0,
  622. this.defaultVideoToken,
  623. });
  624. factory BaseCourseInfoDTO.fromJson(Map<String, dynamic> map) {
  625. return BaseCourseInfoDTO(
  626. code: map['Code'],
  627. name: map['Name'],
  628. courseIntro: map['CourseIntro'],
  629. teacherCode: map['TeacherCode'],
  630. teacherName: map['TeacherName'],
  631. poster: map['Poster'],
  632. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  633. duration: map['Duration'],
  634. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  635. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  636. coursewareToken: map['CoursewareToken'],
  637. status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  638. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  639. creatorCode: map['CreatorCode'],
  640. organizationCode: map['OrganizationCode'],
  641. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  642. price: double.parse(map['Price'].toString()),
  643. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  644. caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast<String>().toList() : null,
  645. userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast<String>().toList() : null,
  646. courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast<String>().toList() : null,
  647. courseMaterialCodes: map['CourseMaterialCodes'] != null ? map['CourseMaterialCodes'].cast<String>().toList() : null,
  648. bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  649. assistants: map['Assistants'] != null ? (map['Assistants'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  650. experts: map['Experts'] != null ? (map['Experts'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  651. isAgentCourse: map['IsAgentCourse'],
  652. courseAlbumCodes: map['CourseAlbumCodes'] != null ? map['CourseAlbumCodes'].cast<String>().toList() : null,
  653. courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']),
  654. isStick: map['IsStick'],
  655. sort: map['Sort'],
  656. playCount: map['PlayCount'],
  657. signInCount: map['SignInCount'],
  658. defaultVideoToken: map['DefaultVideoToken'],
  659. );
  660. }
  661. Map<String, dynamic> toJson() {
  662. final map = Map<String, dynamic>();
  663. if(code != null)
  664. map['Code'] = code;
  665. if(name != null)
  666. map['Name'] = name;
  667. if(courseIntro != null)
  668. map['CourseIntro'] = courseIntro;
  669. if(teacherCode != null)
  670. map['TeacherCode'] = teacherCode;
  671. if(teacherName != null)
  672. map['TeacherName'] = teacherName;
  673. if(poster != null)
  674. map['Poster'] = poster;
  675. if(startTime != null)
  676. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  677. map['Duration'] = duration;
  678. map['CourseType'] = courseType.index;
  679. map['AudienceType'] = audienceType.index;
  680. if(coursewareToken != null)
  681. map['CoursewareToken'] = coursewareToken;
  682. map['Status'] = status.index;
  683. map['ViewRange'] = viewRange.index;
  684. if(creatorCode != null)
  685. map['CreatorCode'] = creatorCode;
  686. if(organizationCode != null)
  687. map['OrganizationCode'] = organizationCode;
  688. if(createTime != null)
  689. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  690. map['Price'] = price;
  691. if(courseLabelCodes != null)
  692. map['CourseLabelCodes'] = courseLabelCodes;
  693. if(caseLabelCodes != null)
  694. map['CaseLabelCodes'] = caseLabelCodes;
  695. if(userGroupCodes != null)
  696. map['UserGroupCodes'] = userGroupCodes;
  697. if(courseVideoCodes != null)
  698. map['CourseVideoCodes'] = courseVideoCodes;
  699. if(courseMaterialCodes != null)
  700. map['CourseMaterialCodes'] = courseMaterialCodes;
  701. if(bindExams != null)
  702. map['BindExams'] = bindExams;
  703. if(assistants != null)
  704. map['Assistants'] = assistants;
  705. if(experts != null)
  706. map['Experts'] = experts;
  707. map['IsAgentCourse'] = isAgentCourse;
  708. if(courseAlbumCodes != null)
  709. map['CourseAlbumCodes'] = courseAlbumCodes;
  710. map['CourseAppearType'] = courseAppearType.index;
  711. map['IsStick'] = isStick;
  712. map['Sort'] = sort;
  713. map['PlayCount'] = playCount;
  714. map['SignInCount'] = signInCount;
  715. if(defaultVideoToken != null)
  716. map['DefaultVideoToken'] = defaultVideoToken;
  717. return map;
  718. }
  719. }
  720. class BaseUserGroupDTO extends BaseDTO{
  721. String? code;
  722. String? name;
  723. String? shortCode;
  724. BaseUserGroupDTO({
  725. this.code,
  726. this.name,
  727. this.shortCode,
  728. DateTime? createTime,
  729. DateTime? updateTime,
  730. }) : super(
  731. createTime: createTime,
  732. updateTime: updateTime,
  733. );
  734. factory BaseUserGroupDTO.fromJson(Map<String, dynamic> map) {
  735. return BaseUserGroupDTO(
  736. code: map['Code'],
  737. name: map['Name'],
  738. shortCode: map['ShortCode'],
  739. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  740. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  741. );
  742. }
  743. Map<String, dynamic> toJson() {
  744. final map = super.toJson();
  745. if(code != null)
  746. map['Code'] = code;
  747. if(name != null)
  748. map['Name'] = name;
  749. if(shortCode != null)
  750. map['ShortCode'] = shortCode;
  751. return map;
  752. }
  753. }
  754. enum UploadFileTypeEnum {
  755. Unknown,
  756. EXE,
  757. APK,
  758. IPA,
  759. ZIP,
  760. DAT,
  761. RAR,
  762. PNG,
  763. ICON,
  764. BMP,
  765. JPEG,
  766. JPG,
  767. GIF,
  768. WEBP,
  769. TIFF,
  770. IMG,
  771. PDF,
  772. DOC,
  773. DOCX,
  774. XLS,
  775. XLSX,
  776. MP4,
  777. MSI,
  778. VID,
  779. DICOM,
  780. PPT,
  781. PPTX,
  782. M4V,
  783. }
  784. class VideoInfoDTO {
  785. String? code;
  786. String? name;
  787. String? videoToken;
  788. String? poster;
  789. String? vodFileId;
  790. int duration;
  791. double videoSize;
  792. DateTime? createTime;
  793. String? creatorCode;
  794. String? creatorName;
  795. UploadFileTypeEnum fodderType;
  796. bool isPublic;
  797. CourseViewRangeEnum viewRange;
  798. int playCount;
  799. VideoInfoDTO({
  800. this.code,
  801. this.name,
  802. this.videoToken,
  803. this.poster,
  804. this.vodFileId,
  805. this.duration = 0,
  806. this.videoSize = 0,
  807. this.createTime,
  808. this.creatorCode,
  809. this.creatorName,
  810. this.fodderType = UploadFileTypeEnum.Unknown,
  811. this.isPublic = false,
  812. this.viewRange = CourseViewRangeEnum.All,
  813. this.playCount = 0,
  814. });
  815. factory VideoInfoDTO.fromJson(Map<String, dynamic> map) {
  816. return VideoInfoDTO(
  817. code: map['Code'],
  818. name: map['Name'],
  819. videoToken: map['VideoToken'],
  820. poster: map['Poster'],
  821. vodFileId: map['VodFileId'],
  822. duration: map['Duration'],
  823. videoSize: double.parse(map['VideoSize'].toString()),
  824. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  825. creatorCode: map['CreatorCode'],
  826. creatorName: map['CreatorName'],
  827. fodderType: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FodderType']),
  828. isPublic: map['IsPublic'],
  829. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  830. playCount: map['PlayCount'],
  831. );
  832. }
  833. Map<String, dynamic> toJson() {
  834. final map = Map<String, dynamic>();
  835. if(code != null)
  836. map['Code'] = code;
  837. if(name != null)
  838. map['Name'] = name;
  839. if(videoToken != null)
  840. map['VideoToken'] = videoToken;
  841. if(poster != null)
  842. map['Poster'] = poster;
  843. if(vodFileId != null)
  844. map['VodFileId'] = vodFileId;
  845. map['Duration'] = duration;
  846. map['VideoSize'] = videoSize;
  847. if(createTime != null)
  848. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  849. if(creatorCode != null)
  850. map['CreatorCode'] = creatorCode;
  851. if(creatorName != null)
  852. map['CreatorName'] = creatorName;
  853. map['FodderType'] = fodderType.index;
  854. map['IsPublic'] = isPublic;
  855. map['ViewRange'] = viewRange.index;
  856. map['PlayCount'] = playCount;
  857. return map;
  858. }
  859. }
  860. class BaseCourseAlbumDTO {
  861. String? code;
  862. String? name;
  863. BaseCourseAlbumDTO({
  864. this.code,
  865. this.name,
  866. });
  867. factory BaseCourseAlbumDTO.fromJson(Map<String, dynamic> map) {
  868. return BaseCourseAlbumDTO(
  869. code: map['Code'],
  870. name: map['Name'],
  871. );
  872. }
  873. Map<String, dynamic> toJson() {
  874. final map = Map<String, dynamic>();
  875. if(code != null)
  876. map['Code'] = code;
  877. if(name != null)
  878. map['Name'] = name;
  879. return map;
  880. }
  881. }
  882. class CourseInfoDetailDTO extends BaseCourseInfoDTO{
  883. List<StudentInfoDTO >? students;
  884. List<BaseLabelInfoDTO >? caseLabels;
  885. List<BaseLabelInfoDTO >? courseLabels;
  886. List<BaseUserGroupDTO >? userGroups;
  887. List<VideoInfoDTO >? courseVideos;
  888. List<VideoInfoDTO >? courseMaterials;
  889. List<BaseCourseAlbumDTO >? courseAlbums;
  890. bool needPay;
  891. StudentCourseStatusEnum signCourseStatus;
  892. bool isPay;
  893. CourseInfoDetailDTO({
  894. this.students,
  895. this.caseLabels,
  896. this.courseLabels,
  897. this.userGroups,
  898. this.courseVideos,
  899. this.courseMaterials,
  900. this.courseAlbums,
  901. this.needPay = false,
  902. this.signCourseStatus = StudentCourseStatusEnum.All,
  903. this.isPay = false,
  904. String? code,
  905. String? name,
  906. String? courseIntro,
  907. String? teacherCode,
  908. String? teacherName,
  909. String? poster,
  910. DateTime? startTime,
  911. int duration = 0,
  912. CourseTypeEnum courseType = CourseTypeEnum.Unknown,
  913. CourseAudienceTypeEnum audienceType = CourseAudienceTypeEnum.Unknown,
  914. String? coursewareToken,
  915. CourseStatusEnum status = CourseStatusEnum.Unknown,
  916. CourseViewRangeEnum viewRange = CourseViewRangeEnum.All,
  917. String? creatorCode,
  918. String? organizationCode,
  919. DateTime? createTime,
  920. double price = 0,
  921. List<String >? courseLabelCodes,
  922. List<String >? caseLabelCodes,
  923. List<String >? userGroupCodes,
  924. List<String >? courseVideoCodes,
  925. List<String >? courseMaterialCodes,
  926. List<CourseExaminationDTO >? bindExams,
  927. List<StudentInfoDTO >? assistants,
  928. List<StudentInfoDTO >? experts,
  929. bool isAgentCourse = false,
  930. List<String >? courseAlbumCodes,
  931. CourseAppearTypeEnum courseAppearType = CourseAppearTypeEnum.Unknown,
  932. bool isStick = false,
  933. int sort = 0,
  934. int playCount = 0,
  935. int signInCount = 0,
  936. String? defaultVideoToken,
  937. }) : super(
  938. code: code,
  939. name: name,
  940. courseIntro: courseIntro,
  941. teacherCode: teacherCode,
  942. teacherName: teacherName,
  943. poster: poster,
  944. startTime: startTime,
  945. duration: duration,
  946. courseType: courseType,
  947. audienceType: audienceType,
  948. coursewareToken: coursewareToken,
  949. status: status,
  950. viewRange: viewRange,
  951. creatorCode: creatorCode,
  952. organizationCode: organizationCode,
  953. createTime: createTime,
  954. price: price,
  955. courseLabelCodes: courseLabelCodes,
  956. caseLabelCodes: caseLabelCodes,
  957. userGroupCodes: userGroupCodes,
  958. courseVideoCodes: courseVideoCodes,
  959. courseMaterialCodes: courseMaterialCodes,
  960. bindExams: bindExams,
  961. assistants: assistants,
  962. experts: experts,
  963. isAgentCourse: isAgentCourse,
  964. courseAlbumCodes: courseAlbumCodes,
  965. courseAppearType: courseAppearType,
  966. isStick: isStick,
  967. sort: sort,
  968. playCount: playCount,
  969. signInCount: signInCount,
  970. defaultVideoToken: defaultVideoToken,
  971. );
  972. factory CourseInfoDetailDTO.fromJson(Map<String, dynamic> map) {
  973. return CourseInfoDetailDTO(
  974. students: map['Students'] != null ? (map['Students'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  975. caseLabels: map['CaseLabels'] != null ? (map['CaseLabels'] as List).map((e)=>BaseLabelInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  976. courseLabels: map['CourseLabels'] != null ? (map['CourseLabels'] as List).map((e)=>BaseLabelInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  977. userGroups: map['UserGroups'] != null ? (map['UserGroups'] as List).map((e)=>BaseUserGroupDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  978. courseVideos: map['CourseVideos'] != null ? (map['CourseVideos'] as List).map((e)=>VideoInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  979. courseMaterials: map['CourseMaterials'] != null ? (map['CourseMaterials'] as List).map((e)=>VideoInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  980. courseAlbums: map['CourseAlbums'] != null ? (map['CourseAlbums'] as List).map((e)=>BaseCourseAlbumDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  981. needPay: map['NeedPay'],
  982. signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']),
  983. isPay: map['IsPay'],
  984. code: map['Code'],
  985. name: map['Name'],
  986. courseIntro: map['CourseIntro'],
  987. teacherCode: map['TeacherCode'],
  988. teacherName: map['TeacherName'],
  989. poster: map['Poster'],
  990. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  991. duration: map['Duration'],
  992. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  993. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  994. coursewareToken: map['CoursewareToken'],
  995. status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  996. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  997. creatorCode: map['CreatorCode'],
  998. organizationCode: map['OrganizationCode'],
  999. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1000. price: double.parse(map['Price'].toString()),
  1001. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  1002. caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast<String>().toList() : null,
  1003. userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast<String>().toList() : null,
  1004. courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast<String>().toList() : null,
  1005. courseMaterialCodes: map['CourseMaterialCodes'] != null ? map['CourseMaterialCodes'].cast<String>().toList() : null,
  1006. bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1007. assistants: map['Assistants'] != null ? (map['Assistants'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1008. experts: map['Experts'] != null ? (map['Experts'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1009. isAgentCourse: map['IsAgentCourse'],
  1010. courseAlbumCodes: map['CourseAlbumCodes'] != null ? map['CourseAlbumCodes'].cast<String>().toList() : null,
  1011. courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']),
  1012. isStick: map['IsStick'],
  1013. sort: map['Sort'],
  1014. playCount: map['PlayCount'],
  1015. signInCount: map['SignInCount'],
  1016. defaultVideoToken: map['DefaultVideoToken'],
  1017. );
  1018. }
  1019. Map<String, dynamic> toJson() {
  1020. final map = super.toJson();
  1021. if(students != null)
  1022. map['Students'] = students;
  1023. if(caseLabels != null)
  1024. map['CaseLabels'] = caseLabels;
  1025. if(courseLabels != null)
  1026. map['CourseLabels'] = courseLabels;
  1027. if(userGroups != null)
  1028. map['UserGroups'] = userGroups;
  1029. if(courseVideos != null)
  1030. map['CourseVideos'] = courseVideos;
  1031. if(courseMaterials != null)
  1032. map['CourseMaterials'] = courseMaterials;
  1033. if(courseAlbums != null)
  1034. map['CourseAlbums'] = courseAlbums;
  1035. map['NeedPay'] = needPay;
  1036. map['SignCourseStatus'] = signCourseStatus.index;
  1037. map['IsPay'] = isPay;
  1038. return map;
  1039. }
  1040. }
  1041. class FindCoursePagesRequest extends PageRequest{
  1042. String? keyword;
  1043. List<String >? courseLabels;
  1044. DateTime? startTime;
  1045. DateTime? endTime;
  1046. String? teacherCode;
  1047. String? languageCode;
  1048. FindCoursePagesRequest({
  1049. this.keyword,
  1050. this.courseLabels,
  1051. this.startTime,
  1052. this.endTime,
  1053. this.teacherCode,
  1054. this.languageCode,
  1055. int pageIndex = 0,
  1056. int pageSize = 0,
  1057. String? token,
  1058. }) : super(
  1059. pageIndex: pageIndex,
  1060. pageSize: pageSize,
  1061. token: token,
  1062. );
  1063. factory FindCoursePagesRequest.fromJson(Map<String, dynamic> map) {
  1064. return FindCoursePagesRequest(
  1065. keyword: map['Keyword'],
  1066. courseLabels: map['CourseLabels'] != null ? map['CourseLabels'].cast<String>().toList() : null,
  1067. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1068. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  1069. teacherCode: map['TeacherCode'],
  1070. languageCode: map['LanguageCode'],
  1071. pageIndex: map['PageIndex'],
  1072. pageSize: map['PageSize'],
  1073. token: map['Token'],
  1074. );
  1075. }
  1076. Map<String, dynamic> toJson() {
  1077. final map = super.toJson();
  1078. if(keyword != null)
  1079. map['Keyword'] = keyword;
  1080. if(courseLabels != null)
  1081. map['CourseLabels'] = courseLabels;
  1082. if(startTime != null)
  1083. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1084. if(endTime != null)
  1085. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  1086. if(teacherCode != null)
  1087. map['TeacherCode'] = teacherCode;
  1088. if(languageCode != null)
  1089. map['LanguageCode'] = languageCode;
  1090. return map;
  1091. }
  1092. }
  1093. class DeleteCourseByCodeRequest extends TokenRequest{
  1094. String? code;
  1095. DeleteCourseByCodeRequest({
  1096. this.code,
  1097. String? token,
  1098. }) : super(
  1099. token: token,
  1100. );
  1101. factory DeleteCourseByCodeRequest.fromJson(Map<String, dynamic> map) {
  1102. return DeleteCourseByCodeRequest(
  1103. code: map['Code'],
  1104. token: map['Token'],
  1105. );
  1106. }
  1107. Map<String, dynamic> toJson() {
  1108. final map = super.toJson();
  1109. if(code != null)
  1110. map['Code'] = code;
  1111. return map;
  1112. }
  1113. }
  1114. class UpdateCourseRequest extends TokenRequest{
  1115. String? code;
  1116. String? name;
  1117. String? courseIntro;
  1118. String? teacherCode;
  1119. String? poster;
  1120. DateTime? startTime;
  1121. int duration;
  1122. CourseTypeEnum courseType;
  1123. CourseAudienceTypeEnum audienceType;
  1124. String? coursewareToken;
  1125. List<String >? caseLabelCodes;
  1126. List<String >? courseLabelCodes;
  1127. List<String >? userGroupCodes;
  1128. double price;
  1129. List<String >? courseVideoCodes;
  1130. List<String >? bindExams;
  1131. List<String >? assistants;
  1132. List<String >? experts;
  1133. bool isAgentCourse;
  1134. List<String >? courseAlbumCodes;
  1135. CourseAppearTypeEnum courseAppearType;
  1136. List<String >? courseMaterialCodes;
  1137. UpdateCourseRequest({
  1138. this.code,
  1139. this.name,
  1140. this.courseIntro,
  1141. this.teacherCode,
  1142. this.poster,
  1143. this.startTime,
  1144. this.duration = 0,
  1145. this.courseType = CourseTypeEnum.Unknown,
  1146. this.audienceType = CourseAudienceTypeEnum.Unknown,
  1147. this.coursewareToken,
  1148. this.caseLabelCodes,
  1149. this.courseLabelCodes,
  1150. this.userGroupCodes,
  1151. this.price = 0,
  1152. this.courseVideoCodes,
  1153. this.bindExams,
  1154. this.assistants,
  1155. this.experts,
  1156. this.isAgentCourse = false,
  1157. this.courseAlbumCodes,
  1158. this.courseAppearType = CourseAppearTypeEnum.Unknown,
  1159. this.courseMaterialCodes,
  1160. String? token,
  1161. }) : super(
  1162. token: token,
  1163. );
  1164. factory UpdateCourseRequest.fromJson(Map<String, dynamic> map) {
  1165. return UpdateCourseRequest(
  1166. code: map['Code'],
  1167. name: map['Name'],
  1168. courseIntro: map['CourseIntro'],
  1169. teacherCode: map['TeacherCode'],
  1170. poster: map['Poster'],
  1171. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1172. duration: map['Duration'],
  1173. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  1174. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  1175. coursewareToken: map['CoursewareToken'],
  1176. caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast<String>().toList() : null,
  1177. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  1178. userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast<String>().toList() : null,
  1179. price: double.parse(map['Price'].toString()),
  1180. courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast<String>().toList() : null,
  1181. bindExams: map['BindExams'] != null ? map['BindExams'].cast<String>().toList() : null,
  1182. assistants: map['Assistants'] != null ? map['Assistants'].cast<String>().toList() : null,
  1183. experts: map['Experts'] != null ? map['Experts'].cast<String>().toList() : null,
  1184. isAgentCourse: map['IsAgentCourse'],
  1185. courseAlbumCodes: map['CourseAlbumCodes'] != null ? map['CourseAlbumCodes'].cast<String>().toList() : null,
  1186. courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']),
  1187. courseMaterialCodes: map['CourseMaterialCodes'] != null ? map['CourseMaterialCodes'].cast<String>().toList() : null,
  1188. token: map['Token'],
  1189. );
  1190. }
  1191. Map<String, dynamic> toJson() {
  1192. final map = super.toJson();
  1193. if(code != null)
  1194. map['Code'] = code;
  1195. if(name != null)
  1196. map['Name'] = name;
  1197. if(courseIntro != null)
  1198. map['CourseIntro'] = courseIntro;
  1199. if(teacherCode != null)
  1200. map['TeacherCode'] = teacherCode;
  1201. if(poster != null)
  1202. map['Poster'] = poster;
  1203. if(startTime != null)
  1204. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1205. map['Duration'] = duration;
  1206. map['CourseType'] = courseType.index;
  1207. map['AudienceType'] = audienceType.index;
  1208. if(coursewareToken != null)
  1209. map['CoursewareToken'] = coursewareToken;
  1210. if(caseLabelCodes != null)
  1211. map['CaseLabelCodes'] = caseLabelCodes;
  1212. if(courseLabelCodes != null)
  1213. map['CourseLabelCodes'] = courseLabelCodes;
  1214. if(userGroupCodes != null)
  1215. map['UserGroupCodes'] = userGroupCodes;
  1216. map['Price'] = price;
  1217. if(courseVideoCodes != null)
  1218. map['CourseVideoCodes'] = courseVideoCodes;
  1219. if(bindExams != null)
  1220. map['BindExams'] = bindExams;
  1221. if(assistants != null)
  1222. map['Assistants'] = assistants;
  1223. if(experts != null)
  1224. map['Experts'] = experts;
  1225. map['IsAgentCourse'] = isAgentCourse;
  1226. if(courseAlbumCodes != null)
  1227. map['CourseAlbumCodes'] = courseAlbumCodes;
  1228. map['CourseAppearType'] = courseAppearType.index;
  1229. if(courseMaterialCodes != null)
  1230. map['CourseMaterialCodes'] = courseMaterialCodes;
  1231. return map;
  1232. }
  1233. }
  1234. class FindCourseByCodeRequest extends TokenRequest{
  1235. String? code;
  1236. String? languageCode;
  1237. FindCourseByCodeRequest({
  1238. this.code,
  1239. this.languageCode,
  1240. String? token,
  1241. }) : super(
  1242. token: token,
  1243. );
  1244. factory FindCourseByCodeRequest.fromJson(Map<String, dynamic> map) {
  1245. return FindCourseByCodeRequest(
  1246. code: map['Code'],
  1247. languageCode: map['LanguageCode'],
  1248. token: map['Token'],
  1249. );
  1250. }
  1251. Map<String, dynamic> toJson() {
  1252. final map = super.toJson();
  1253. if(code != null)
  1254. map['Code'] = code;
  1255. if(languageCode != null)
  1256. map['LanguageCode'] = languageCode;
  1257. return map;
  1258. }
  1259. }
  1260. class FindMyCoursePagesRequest extends PageRequest{
  1261. String? keyword;
  1262. StudentCourseStatusEnum queryStatus;
  1263. FindMyCoursePagesRequest({
  1264. this.keyword,
  1265. this.queryStatus = StudentCourseStatusEnum.All,
  1266. int pageIndex = 0,
  1267. int pageSize = 0,
  1268. String? token,
  1269. }) : super(
  1270. pageIndex: pageIndex,
  1271. pageSize: pageSize,
  1272. token: token,
  1273. );
  1274. factory FindMyCoursePagesRequest.fromJson(Map<String, dynamic> map) {
  1275. return FindMyCoursePagesRequest(
  1276. keyword: map['Keyword'],
  1277. queryStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['QueryStatus']),
  1278. pageIndex: map['PageIndex'],
  1279. pageSize: map['PageSize'],
  1280. token: map['Token'],
  1281. );
  1282. }
  1283. Map<String, dynamic> toJson() {
  1284. final map = super.toJson();
  1285. if(keyword != null)
  1286. map['Keyword'] = keyword;
  1287. map['QueryStatus'] = queryStatus.index;
  1288. return map;
  1289. }
  1290. }
  1291. class CourseAlbumDTO extends BaseCourseAlbumDTO{
  1292. String? cover;
  1293. List<String >? courseCodes;
  1294. String? introduction;
  1295. List<String >? courseLabelCodes;
  1296. String? teacherCode;
  1297. String? teacherName;
  1298. CourseViewRangeEnum viewRange;
  1299. double price;
  1300. DateTime? createTime;
  1301. int sort;
  1302. bool isStick;
  1303. CourseAlbumDTO({
  1304. this.cover,
  1305. this.courseCodes,
  1306. this.introduction,
  1307. this.courseLabelCodes,
  1308. this.teacherCode,
  1309. this.teacherName,
  1310. this.viewRange = CourseViewRangeEnum.All,
  1311. this.price = 0,
  1312. this.createTime,
  1313. this.sort = 0,
  1314. this.isStick = false,
  1315. String? code,
  1316. String? name,
  1317. }) : super(
  1318. code: code,
  1319. name: name,
  1320. );
  1321. factory CourseAlbumDTO.fromJson(Map<String, dynamic> map) {
  1322. return CourseAlbumDTO(
  1323. cover: map['Cover'],
  1324. courseCodes: map['CourseCodes'] != null ? map['CourseCodes'].cast<String>().toList() : null,
  1325. introduction: map['Introduction'],
  1326. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  1327. teacherCode: map['TeacherCode'],
  1328. teacherName: map['TeacherName'],
  1329. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  1330. price: double.parse(map['Price'].toString()),
  1331. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1332. sort: map['Sort'],
  1333. isStick: map['IsStick'],
  1334. code: map['Code'],
  1335. name: map['Name'],
  1336. );
  1337. }
  1338. Map<String, dynamic> toJson() {
  1339. final map = super.toJson();
  1340. if(cover != null)
  1341. map['Cover'] = cover;
  1342. if(courseCodes != null)
  1343. map['CourseCodes'] = courseCodes;
  1344. if(introduction != null)
  1345. map['Introduction'] = introduction;
  1346. if(courseLabelCodes != null)
  1347. map['CourseLabelCodes'] = courseLabelCodes;
  1348. if(teacherCode != null)
  1349. map['TeacherCode'] = teacherCode;
  1350. if(teacherName != null)
  1351. map['TeacherName'] = teacherName;
  1352. map['ViewRange'] = viewRange.index;
  1353. map['Price'] = price;
  1354. if(createTime != null)
  1355. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  1356. map['Sort'] = sort;
  1357. map['IsStick'] = isStick;
  1358. return map;
  1359. }
  1360. }
  1361. class UserGroupDTO extends BaseUserGroupDTO{
  1362. int maxPeople;
  1363. String? creatorCode;
  1364. String? creatorName;
  1365. List<StudentInfoDTO >? students;
  1366. int courseCount;
  1367. int practiceCount;
  1368. int examCount;
  1369. int studentCount;
  1370. UserGroupDTO({
  1371. this.maxPeople = 0,
  1372. this.creatorCode,
  1373. this.creatorName,
  1374. this.students,
  1375. this.courseCount = 0,
  1376. this.practiceCount = 0,
  1377. this.examCount = 0,
  1378. this.studentCount = 0,
  1379. String? code,
  1380. String? name,
  1381. String? shortCode,
  1382. DateTime? createTime,
  1383. DateTime? updateTime,
  1384. }) : super(
  1385. code: code,
  1386. name: name,
  1387. shortCode: shortCode,
  1388. createTime: createTime,
  1389. updateTime: updateTime,
  1390. );
  1391. factory UserGroupDTO.fromJson(Map<String, dynamic> map) {
  1392. return UserGroupDTO(
  1393. maxPeople: map['MaxPeople'],
  1394. creatorCode: map['CreatorCode'],
  1395. creatorName: map['CreatorName'],
  1396. students: map['Students'] != null ? (map['Students'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1397. courseCount: map['CourseCount'],
  1398. practiceCount: map['PracticeCount'],
  1399. examCount: map['ExamCount'],
  1400. studentCount: map['StudentCount'],
  1401. code: map['Code'],
  1402. name: map['Name'],
  1403. shortCode: map['ShortCode'],
  1404. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1405. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  1406. );
  1407. }
  1408. Map<String, dynamic> toJson() {
  1409. final map = super.toJson();
  1410. map['MaxPeople'] = maxPeople;
  1411. if(creatorCode != null)
  1412. map['CreatorCode'] = creatorCode;
  1413. if(creatorName != null)
  1414. map['CreatorName'] = creatorName;
  1415. if(students != null)
  1416. map['Students'] = students;
  1417. map['CourseCount'] = courseCount;
  1418. map['PracticeCount'] = practiceCount;
  1419. map['ExamCount'] = examCount;
  1420. map['StudentCount'] = studentCount;
  1421. return map;
  1422. }
  1423. }
  1424. class QueryUserGroupPageRequest extends PageRequest{
  1425. String? keyword;
  1426. String? teacherCode;
  1427. QueryUserGroupPageRequest({
  1428. this.keyword,
  1429. this.teacherCode,
  1430. int pageIndex = 0,
  1431. int pageSize = 0,
  1432. String? token,
  1433. }) : super(
  1434. pageIndex: pageIndex,
  1435. pageSize: pageSize,
  1436. token: token,
  1437. );
  1438. factory QueryUserGroupPageRequest.fromJson(Map<String, dynamic> map) {
  1439. return QueryUserGroupPageRequest(
  1440. keyword: map['Keyword'],
  1441. teacherCode: map['TeacherCode'],
  1442. pageIndex: map['PageIndex'],
  1443. pageSize: map['PageSize'],
  1444. token: map['Token'],
  1445. );
  1446. }
  1447. Map<String, dynamic> toJson() {
  1448. final map = super.toJson();
  1449. if(keyword != null)
  1450. map['Keyword'] = keyword;
  1451. if(teacherCode != null)
  1452. map['TeacherCode'] = teacherCode;
  1453. return map;
  1454. }
  1455. }
  1456. class UserGroupRequest extends TokenRequest{
  1457. String? code;
  1458. String? name;
  1459. int maxPeople;
  1460. String? creatorCode;
  1461. List<StudentInfoDTO >? students;
  1462. List<String >? removeStudentCodes;
  1463. UserGroupRequest({
  1464. this.code,
  1465. this.name,
  1466. this.maxPeople = 0,
  1467. this.creatorCode,
  1468. this.students,
  1469. this.removeStudentCodes,
  1470. String? token,
  1471. }) : super(
  1472. token: token,
  1473. );
  1474. factory UserGroupRequest.fromJson(Map<String, dynamic> map) {
  1475. return UserGroupRequest(
  1476. code: map['Code'],
  1477. name: map['Name'],
  1478. maxPeople: map['MaxPeople'],
  1479. creatorCode: map['CreatorCode'],
  1480. students: map['Students'] != null ? (map['Students'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1481. removeStudentCodes: map['RemoveStudentCodes'] != null ? map['RemoveStudentCodes'].cast<String>().toList() : null,
  1482. token: map['Token'],
  1483. );
  1484. }
  1485. Map<String, dynamic> toJson() {
  1486. final map = super.toJson();
  1487. if(code != null)
  1488. map['Code'] = code;
  1489. if(name != null)
  1490. map['Name'] = name;
  1491. map['MaxPeople'] = maxPeople;
  1492. if(creatorCode != null)
  1493. map['CreatorCode'] = creatorCode;
  1494. if(students != null)
  1495. map['Students'] = students;
  1496. if(removeStudentCodes != null)
  1497. map['RemoveStudentCodes'] = removeStudentCodes;
  1498. return map;
  1499. }
  1500. }
  1501. class UserGroupFilterRequest extends TokenRequest{
  1502. String? userGroupCode;
  1503. String? creatorCode;
  1504. String? keyword;
  1505. List<String >? studentCodes;
  1506. UserGroupFilterRequest({
  1507. this.userGroupCode,
  1508. this.creatorCode,
  1509. this.keyword,
  1510. this.studentCodes,
  1511. String? token,
  1512. }) : super(
  1513. token: token,
  1514. );
  1515. factory UserGroupFilterRequest.fromJson(Map<String, dynamic> map) {
  1516. return UserGroupFilterRequest(
  1517. userGroupCode: map['UserGroupCode'],
  1518. creatorCode: map['CreatorCode'],
  1519. keyword: map['Keyword'],
  1520. studentCodes: map['StudentCodes'] != null ? map['StudentCodes'].cast<String>().toList() : null,
  1521. token: map['Token'],
  1522. );
  1523. }
  1524. Map<String, dynamic> toJson() {
  1525. final map = super.toJson();
  1526. if(userGroupCode != null)
  1527. map['UserGroupCode'] = userGroupCode;
  1528. if(creatorCode != null)
  1529. map['CreatorCode'] = creatorCode;
  1530. if(keyword != null)
  1531. map['Keyword'] = keyword;
  1532. if(studentCodes != null)
  1533. map['StudentCodes'] = studentCodes;
  1534. return map;
  1535. }
  1536. }
  1537. class SaveVideoRequest extends TokenRequest{
  1538. String? courseCode;
  1539. int category;
  1540. String? code;
  1541. String? name;
  1542. String? videoToken;
  1543. String? vodFileId;
  1544. String? poster;
  1545. int duration;
  1546. double videoSize;
  1547. String? creatorCode;
  1548. String? creatorName;
  1549. UploadFileTypeEnum fodderType;
  1550. bool isPublic;
  1551. CourseViewRangeEnum viewRange;
  1552. SaveVideoRequest({
  1553. this.courseCode,
  1554. this.category = 0,
  1555. this.code,
  1556. this.name,
  1557. this.videoToken,
  1558. this.vodFileId,
  1559. this.poster,
  1560. this.duration = 0,
  1561. this.videoSize = 0,
  1562. this.creatorCode,
  1563. this.creatorName,
  1564. this.fodderType = UploadFileTypeEnum.Unknown,
  1565. this.isPublic = false,
  1566. this.viewRange = CourseViewRangeEnum.All,
  1567. String? token,
  1568. }) : super(
  1569. token: token,
  1570. );
  1571. factory SaveVideoRequest.fromJson(Map<String, dynamic> map) {
  1572. return SaveVideoRequest(
  1573. courseCode: map['CourseCode'],
  1574. category: map['Category'],
  1575. code: map['Code'],
  1576. name: map['Name'],
  1577. videoToken: map['VideoToken'],
  1578. vodFileId: map['VodFileId'],
  1579. poster: map['Poster'],
  1580. duration: map['Duration'],
  1581. videoSize: double.parse(map['VideoSize'].toString()),
  1582. creatorCode: map['CreatorCode'],
  1583. creatorName: map['CreatorName'],
  1584. fodderType: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FodderType']),
  1585. isPublic: map['IsPublic'],
  1586. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  1587. token: map['Token'],
  1588. );
  1589. }
  1590. Map<String, dynamic> toJson() {
  1591. final map = super.toJson();
  1592. if(courseCode != null)
  1593. map['CourseCode'] = courseCode;
  1594. map['Category'] = category;
  1595. if(code != null)
  1596. map['Code'] = code;
  1597. if(name != null)
  1598. map['Name'] = name;
  1599. if(videoToken != null)
  1600. map['VideoToken'] = videoToken;
  1601. if(vodFileId != null)
  1602. map['VodFileId'] = vodFileId;
  1603. if(poster != null)
  1604. map['Poster'] = poster;
  1605. map['Duration'] = duration;
  1606. map['VideoSize'] = videoSize;
  1607. if(creatorCode != null)
  1608. map['CreatorCode'] = creatorCode;
  1609. if(creatorName != null)
  1610. map['CreatorName'] = creatorName;
  1611. map['FodderType'] = fodderType.index;
  1612. map['IsPublic'] = isPublic;
  1613. map['ViewRange'] = viewRange.index;
  1614. return map;
  1615. }
  1616. }
  1617. class FindVideoPagesRequest extends PageRequest{
  1618. String? keyword;
  1619. String? courseCode;
  1620. int category;
  1621. UploadFileTypeEnum fodderType;
  1622. bool isJustQueryMyUpload;
  1623. FindVideoPagesRequest({
  1624. this.keyword,
  1625. this.courseCode,
  1626. this.category = 0,
  1627. this.fodderType = UploadFileTypeEnum.Unknown,
  1628. this.isJustQueryMyUpload = false,
  1629. int pageIndex = 0,
  1630. int pageSize = 0,
  1631. String? token,
  1632. }) : super(
  1633. pageIndex: pageIndex,
  1634. pageSize: pageSize,
  1635. token: token,
  1636. );
  1637. factory FindVideoPagesRequest.fromJson(Map<String, dynamic> map) {
  1638. return FindVideoPagesRequest(
  1639. keyword: map['Keyword'],
  1640. courseCode: map['CourseCode'],
  1641. category: map['Category'],
  1642. fodderType: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FodderType']),
  1643. isJustQueryMyUpload: map['IsJustQueryMyUpload'],
  1644. pageIndex: map['PageIndex'],
  1645. pageSize: map['PageSize'],
  1646. token: map['Token'],
  1647. );
  1648. }
  1649. Map<String, dynamic> toJson() {
  1650. final map = super.toJson();
  1651. if(keyword != null)
  1652. map['Keyword'] = keyword;
  1653. if(courseCode != null)
  1654. map['CourseCode'] = courseCode;
  1655. map['Category'] = category;
  1656. map['FodderType'] = fodderType.index;
  1657. map['IsJustQueryMyUpload'] = isJustQueryMyUpload;
  1658. return map;
  1659. }
  1660. }
  1661. class DeleteVideoRequest extends TokenRequest{
  1662. String? code;
  1663. String? courseCode;
  1664. DeleteVideoRequest({
  1665. this.code,
  1666. this.courseCode,
  1667. String? token,
  1668. }) : super(
  1669. token: token,
  1670. );
  1671. factory DeleteVideoRequest.fromJson(Map<String, dynamic> map) {
  1672. return DeleteVideoRequest(
  1673. code: map['Code'],
  1674. courseCode: map['CourseCode'],
  1675. token: map['Token'],
  1676. );
  1677. }
  1678. Map<String, dynamic> toJson() {
  1679. final map = super.toJson();
  1680. if(code != null)
  1681. map['Code'] = code;
  1682. if(courseCode != null)
  1683. map['CourseCode'] = courseCode;
  1684. return map;
  1685. }
  1686. }
  1687. class BuyCourseResult {
  1688. String? courseCode;
  1689. String? paymentOrderCode;
  1690. String? orderTitle;
  1691. double orderAmount;
  1692. String? payUrl;
  1693. BuyCourseResult({
  1694. this.courseCode,
  1695. this.paymentOrderCode,
  1696. this.orderTitle,
  1697. this.orderAmount = 0,
  1698. this.payUrl,
  1699. });
  1700. factory BuyCourseResult.fromJson(Map<String, dynamic> map) {
  1701. return BuyCourseResult(
  1702. courseCode: map['CourseCode'],
  1703. paymentOrderCode: map['PaymentOrderCode'],
  1704. orderTitle: map['OrderTitle'],
  1705. orderAmount: double.parse(map['OrderAmount'].toString()),
  1706. payUrl: map['PayUrl'],
  1707. );
  1708. }
  1709. Map<String, dynamic> toJson() {
  1710. final map = Map<String, dynamic>();
  1711. if(courseCode != null)
  1712. map['CourseCode'] = courseCode;
  1713. if(paymentOrderCode != null)
  1714. map['PaymentOrderCode'] = paymentOrderCode;
  1715. if(orderTitle != null)
  1716. map['OrderTitle'] = orderTitle;
  1717. map['OrderAmount'] = orderAmount;
  1718. if(payUrl != null)
  1719. map['PayUrl'] = payUrl;
  1720. return map;
  1721. }
  1722. }
  1723. enum PayTypeEnum {
  1724. Alipay_PAGE,
  1725. Alipay_WAP,
  1726. WeChat_PAGE,
  1727. WeChat_WAP,
  1728. Paypal,
  1729. }
  1730. class BuyCourseRequest extends TokenRequest{
  1731. String? courseCode;
  1732. int quantity;
  1733. PayTypeEnum payType;
  1734. BuyCourseRequest({
  1735. this.courseCode,
  1736. this.quantity = 0,
  1737. this.payType = PayTypeEnum.Alipay_PAGE,
  1738. String? token,
  1739. }) : super(
  1740. token: token,
  1741. );
  1742. factory BuyCourseRequest.fromJson(Map<String, dynamic> map) {
  1743. return BuyCourseRequest(
  1744. courseCode: map['CourseCode'],
  1745. quantity: map['Quantity'],
  1746. payType: PayTypeEnum.values.firstWhere((e) => e.index == map['PayType']),
  1747. token: map['Token'],
  1748. );
  1749. }
  1750. Map<String, dynamic> toJson() {
  1751. final map = super.toJson();
  1752. if(courseCode != null)
  1753. map['CourseCode'] = courseCode;
  1754. map['Quantity'] = quantity;
  1755. map['PayType'] = payType.index;
  1756. return map;
  1757. }
  1758. }
  1759. enum PayStatusEnum {
  1760. NoPay,
  1761. InPayment,
  1762. Paid,
  1763. }
  1764. class PaymentCallbackRequest extends TokenRequest{
  1765. String? paymentOrderCode;
  1766. PayStatusEnum payStatus;
  1767. DateTime? payTime;
  1768. PaymentCallbackRequest({
  1769. this.paymentOrderCode,
  1770. this.payStatus = PayStatusEnum.NoPay,
  1771. this.payTime,
  1772. String? token,
  1773. }) : super(
  1774. token: token,
  1775. );
  1776. factory PaymentCallbackRequest.fromJson(Map<String, dynamic> map) {
  1777. return PaymentCallbackRequest(
  1778. paymentOrderCode: map['PaymentOrderCode'],
  1779. payStatus: PayStatusEnum.values.firstWhere((e) => e.index == map['PayStatus']),
  1780. payTime: map['PayTime'] != null ? DateTime.parse(map['PayTime']) : null,
  1781. token: map['Token'],
  1782. );
  1783. }
  1784. Map<String, dynamic> toJson() {
  1785. final map = super.toJson();
  1786. if(paymentOrderCode != null)
  1787. map['PaymentOrderCode'] = paymentOrderCode;
  1788. map['PayStatus'] = payStatus.index;
  1789. if(payTime != null)
  1790. map['PayTime'] = JsonRpcUtils.dateFormat(payTime!);
  1791. return map;
  1792. }
  1793. }
  1794. class SignUpCourseRequest extends TokenRequest{
  1795. String? courseOrAlbumCode;
  1796. CourseAppearTypeEnum courseAppearType;
  1797. SignUpCourseRequest({
  1798. this.courseOrAlbumCode,
  1799. this.courseAppearType = CourseAppearTypeEnum.Unknown,
  1800. String? token,
  1801. }) : super(
  1802. token: token,
  1803. );
  1804. factory SignUpCourseRequest.fromJson(Map<String, dynamic> map) {
  1805. return SignUpCourseRequest(
  1806. courseOrAlbumCode: map['CourseOrAlbumCode'],
  1807. courseAppearType: CourseAppearTypeEnum.values.firstWhere((e) => e.index == map['CourseAppearType']),
  1808. token: map['Token'],
  1809. );
  1810. }
  1811. Map<String, dynamic> toJson() {
  1812. final map = super.toJson();
  1813. if(courseOrAlbumCode != null)
  1814. map['CourseOrAlbumCode'] = courseOrAlbumCode;
  1815. map['CourseAppearType'] = courseAppearType.index;
  1816. return map;
  1817. }
  1818. }
  1819. class CancelSignUpCourseRequest extends TokenRequest{
  1820. String? courseOrAlbumCode;
  1821. CancelSignUpCourseRequest({
  1822. this.courseOrAlbumCode,
  1823. String? token,
  1824. }) : super(
  1825. token: token,
  1826. );
  1827. factory CancelSignUpCourseRequest.fromJson(Map<String, dynamic> map) {
  1828. return CancelSignUpCourseRequest(
  1829. courseOrAlbumCode: map['CourseOrAlbumCode'],
  1830. token: map['Token'],
  1831. );
  1832. }
  1833. Map<String, dynamic> toJson() {
  1834. final map = super.toJson();
  1835. if(courseOrAlbumCode != null)
  1836. map['CourseOrAlbumCode'] = courseOrAlbumCode;
  1837. return map;
  1838. }
  1839. }
  1840. class PublishCourseExaminationPaperRequest extends TokenRequest{
  1841. String? code;
  1842. String? courseCode;
  1843. DateTime? startTime;
  1844. PublishCourseExaminationPaperRequest({
  1845. this.code,
  1846. this.courseCode,
  1847. this.startTime,
  1848. String? token,
  1849. }) : super(
  1850. token: token,
  1851. );
  1852. factory PublishCourseExaminationPaperRequest.fromJson(Map<String, dynamic> map) {
  1853. return PublishCourseExaminationPaperRequest(
  1854. code: map['Code'],
  1855. courseCode: map['CourseCode'],
  1856. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1857. token: map['Token'],
  1858. );
  1859. }
  1860. Map<String, dynamic> toJson() {
  1861. final map = super.toJson();
  1862. if(code != null)
  1863. map['Code'] = code;
  1864. if(courseCode != null)
  1865. map['CourseCode'] = courseCode;
  1866. if(startTime != null)
  1867. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1868. return map;
  1869. }
  1870. }
  1871. class FindCourseExaminationPapersRequest extends TokenRequest{
  1872. String? courseCode;
  1873. FindCourseExaminationPapersRequest({
  1874. this.courseCode,
  1875. String? token,
  1876. }) : super(
  1877. token: token,
  1878. );
  1879. factory FindCourseExaminationPapersRequest.fromJson(Map<String, dynamic> map) {
  1880. return FindCourseExaminationPapersRequest(
  1881. courseCode: map['CourseCode'],
  1882. token: map['Token'],
  1883. );
  1884. }
  1885. Map<String, dynamic> toJson() {
  1886. final map = super.toJson();
  1887. if(courseCode != null)
  1888. map['CourseCode'] = courseCode;
  1889. return map;
  1890. }
  1891. }
  1892. class FindCourseExaminationPaperByCodeRequest extends TokenRequest{
  1893. String? code;
  1894. String? courseCode;
  1895. FindCourseExaminationPaperByCodeRequest({
  1896. this.code,
  1897. this.courseCode,
  1898. String? token,
  1899. }) : super(
  1900. token: token,
  1901. );
  1902. factory FindCourseExaminationPaperByCodeRequest.fromJson(Map<String, dynamic> map) {
  1903. return FindCourseExaminationPaperByCodeRequest(
  1904. code: map['Code'],
  1905. courseCode: map['CourseCode'],
  1906. token: map['Token'],
  1907. );
  1908. }
  1909. Map<String, dynamic> toJson() {
  1910. final map = super.toJson();
  1911. if(code != null)
  1912. map['Code'] = code;
  1913. if(courseCode != null)
  1914. map['CourseCode'] = courseCode;
  1915. return map;
  1916. }
  1917. }
  1918. class StudentSetExaminationAnswerDTO {
  1919. String? questionCode;
  1920. String? answer;
  1921. List<String >? files;
  1922. List<String >? optionCodeList;
  1923. StudentSetExaminationAnswerDTO({
  1924. this.questionCode,
  1925. this.answer,
  1926. this.files,
  1927. this.optionCodeList,
  1928. });
  1929. factory StudentSetExaminationAnswerDTO.fromJson(Map<String, dynamic> map) {
  1930. return StudentSetExaminationAnswerDTO(
  1931. questionCode: map['QuestionCode'],
  1932. answer: map['Answer'],
  1933. files: map['Files'] != null ? map['Files'].cast<String>().toList() : null,
  1934. optionCodeList: map['OptionCodeList'] != null ? map['OptionCodeList'].cast<String>().toList() : null,
  1935. );
  1936. }
  1937. Map<String, dynamic> toJson() {
  1938. final map = Map<String, dynamic>();
  1939. if(questionCode != null)
  1940. map['QuestionCode'] = questionCode;
  1941. if(answer != null)
  1942. map['Answer'] = answer;
  1943. if(files != null)
  1944. map['Files'] = files;
  1945. if(optionCodeList != null)
  1946. map['OptionCodeList'] = optionCodeList;
  1947. return map;
  1948. }
  1949. }
  1950. class SubmitCourseExaminationPaperRequest extends TokenRequest{
  1951. String? courseCode;
  1952. String? code;
  1953. List<StudentSetExaminationAnswerDTO >? answers;
  1954. SubmitCourseExaminationPaperRequest({
  1955. this.courseCode,
  1956. this.code,
  1957. this.answers,
  1958. String? token,
  1959. }) : super(
  1960. token: token,
  1961. );
  1962. factory SubmitCourseExaminationPaperRequest.fromJson(Map<String, dynamic> map) {
  1963. return SubmitCourseExaminationPaperRequest(
  1964. courseCode: map['CourseCode'],
  1965. code: map['Code'],
  1966. answers: map['Answers'] != null ? (map['Answers'] as List).map((e)=>StudentSetExaminationAnswerDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1967. token: map['Token'],
  1968. );
  1969. }
  1970. Map<String, dynamic> toJson() {
  1971. final map = super.toJson();
  1972. if(courseCode != null)
  1973. map['CourseCode'] = courseCode;
  1974. if(code != null)
  1975. map['Code'] = code;
  1976. if(answers != null)
  1977. map['Answers'] = answers;
  1978. return map;
  1979. }
  1980. }
  1981. class BaseStudentExaminationDTO {
  1982. String? code;
  1983. String? examinationCode;
  1984. String? studentCode;
  1985. String? studentName;
  1986. double totalScore;
  1987. BaseStudentExaminationDTO({
  1988. this.code,
  1989. this.examinationCode,
  1990. this.studentCode,
  1991. this.studentName,
  1992. this.totalScore = 0,
  1993. });
  1994. factory BaseStudentExaminationDTO.fromJson(Map<String, dynamic> map) {
  1995. return BaseStudentExaminationDTO(
  1996. code: map['Code'],
  1997. examinationCode: map['ExaminationCode'],
  1998. studentCode: map['StudentCode'],
  1999. studentName: map['StudentName'],
  2000. totalScore: double.parse(map['TotalScore'].toString()),
  2001. );
  2002. }
  2003. Map<String, dynamic> toJson() {
  2004. final map = Map<String, dynamic>();
  2005. if(code != null)
  2006. map['Code'] = code;
  2007. if(examinationCode != null)
  2008. map['ExaminationCode'] = examinationCode;
  2009. if(studentCode != null)
  2010. map['StudentCode'] = studentCode;
  2011. if(studentName != null)
  2012. map['StudentName'] = studentName;
  2013. map['TotalScore'] = totalScore;
  2014. return map;
  2015. }
  2016. }
  2017. class FindCourseStudentExaminationPagesRequest extends PageRequest{
  2018. String? courseCode;
  2019. String? keyword;
  2020. FindCourseStudentExaminationPagesRequest({
  2021. this.courseCode,
  2022. this.keyword,
  2023. int pageIndex = 0,
  2024. int pageSize = 0,
  2025. String? token,
  2026. }) : super(
  2027. pageIndex: pageIndex,
  2028. pageSize: pageSize,
  2029. token: token,
  2030. );
  2031. factory FindCourseStudentExaminationPagesRequest.fromJson(Map<String, dynamic> map) {
  2032. return FindCourseStudentExaminationPagesRequest(
  2033. courseCode: map['CourseCode'],
  2034. keyword: map['Keyword'],
  2035. pageIndex: map['PageIndex'],
  2036. pageSize: map['PageSize'],
  2037. token: map['Token'],
  2038. );
  2039. }
  2040. Map<String, dynamic> toJson() {
  2041. final map = super.toJson();
  2042. if(courseCode != null)
  2043. map['CourseCode'] = courseCode;
  2044. if(keyword != null)
  2045. map['Keyword'] = keyword;
  2046. return map;
  2047. }
  2048. }
  2049. class ExaminationAnswerDTO {
  2050. String? questionCode;
  2051. QuestionTypeEnum questionType;
  2052. String? answer;
  2053. List<String >? files;
  2054. List<String >? optionCodeList;
  2055. bool isCorrect;
  2056. double score;
  2057. ExaminationAnswerDTO({
  2058. this.questionCode,
  2059. this.questionType = QuestionTypeEnum.Judge,
  2060. this.answer,
  2061. this.files,
  2062. this.optionCodeList,
  2063. this.isCorrect = false,
  2064. this.score = 0,
  2065. });
  2066. factory ExaminationAnswerDTO.fromJson(Map<String, dynamic> map) {
  2067. return ExaminationAnswerDTO(
  2068. questionCode: map['QuestionCode'],
  2069. questionType: QuestionTypeEnum.values.firstWhere((e) => e.index == map['QuestionType']),
  2070. answer: map['Answer'],
  2071. files: map['Files'] != null ? map['Files'].cast<String>().toList() : null,
  2072. optionCodeList: map['OptionCodeList'] != null ? map['OptionCodeList'].cast<String>().toList() : null,
  2073. isCorrect: map['IsCorrect'],
  2074. score: double.parse(map['Score'].toString()),
  2075. );
  2076. }
  2077. Map<String, dynamic> toJson() {
  2078. final map = Map<String, dynamic>();
  2079. if(questionCode != null)
  2080. map['QuestionCode'] = questionCode;
  2081. map['QuestionType'] = questionType.index;
  2082. if(answer != null)
  2083. map['Answer'] = answer;
  2084. if(files != null)
  2085. map['Files'] = files;
  2086. if(optionCodeList != null)
  2087. map['OptionCodeList'] = optionCodeList;
  2088. map['IsCorrect'] = isCorrect;
  2089. map['Score'] = score;
  2090. return map;
  2091. }
  2092. }
  2093. class StudentExaminationDetailDTO extends BaseStudentExaminationDTO{
  2094. CourseExaminationDTO? examination;
  2095. List<ExaminationAnswerDTO >? studentAnswers;
  2096. StudentExaminationDetailDTO({
  2097. this.examination,
  2098. this.studentAnswers,
  2099. String? code,
  2100. String? examinationCode,
  2101. String? studentCode,
  2102. String? studentName,
  2103. double totalScore = 0,
  2104. }) : super(
  2105. code: code,
  2106. examinationCode: examinationCode,
  2107. studentCode: studentCode,
  2108. studentName: studentName,
  2109. totalScore: totalScore,
  2110. );
  2111. factory StudentExaminationDetailDTO.fromJson(Map<String, dynamic> map) {
  2112. return StudentExaminationDetailDTO(
  2113. examination: map['Examination'] != null ? CourseExaminationDTO.fromJson(map['Examination']) : null,
  2114. studentAnswers: map['StudentAnswers'] != null ? (map['StudentAnswers'] as List).map((e)=>ExaminationAnswerDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2115. code: map['Code'],
  2116. examinationCode: map['ExaminationCode'],
  2117. studentCode: map['StudentCode'],
  2118. studentName: map['StudentName'],
  2119. totalScore: double.parse(map['TotalScore'].toString()),
  2120. );
  2121. }
  2122. Map<String, dynamic> toJson() {
  2123. final map = super.toJson();
  2124. if(examination != null)
  2125. map['Examination'] = examination;
  2126. if(studentAnswers != null)
  2127. map['StudentAnswers'] = studentAnswers;
  2128. return map;
  2129. }
  2130. }
  2131. class FindStudentExaminationByCodeRequest extends TokenRequest{
  2132. String? code;
  2133. FindStudentExaminationByCodeRequest({
  2134. this.code,
  2135. String? token,
  2136. }) : super(
  2137. token: token,
  2138. );
  2139. factory FindStudentExaminationByCodeRequest.fromJson(Map<String, dynamic> map) {
  2140. return FindStudentExaminationByCodeRequest(
  2141. code: map['Code'],
  2142. token: map['Token'],
  2143. );
  2144. }
  2145. Map<String, dynamic> toJson() {
  2146. final map = super.toJson();
  2147. if(code != null)
  2148. map['Code'] = code;
  2149. return map;
  2150. }
  2151. }
  2152. class TeacherSetExaminationAnswerDTO {
  2153. String? questionCode;
  2154. bool isCorrect;
  2155. double score;
  2156. TeacherSetExaminationAnswerDTO({
  2157. this.questionCode,
  2158. this.isCorrect = false,
  2159. this.score = 0,
  2160. });
  2161. factory TeacherSetExaminationAnswerDTO.fromJson(Map<String, dynamic> map) {
  2162. return TeacherSetExaminationAnswerDTO(
  2163. questionCode: map['QuestionCode'],
  2164. isCorrect: map['IsCorrect'],
  2165. score: double.parse(map['Score'].toString()),
  2166. );
  2167. }
  2168. Map<String, dynamic> toJson() {
  2169. final map = Map<String, dynamic>();
  2170. if(questionCode != null)
  2171. map['QuestionCode'] = questionCode;
  2172. map['IsCorrect'] = isCorrect;
  2173. map['Score'] = score;
  2174. return map;
  2175. }
  2176. }
  2177. class SubmitReviewStudentExaminationRequest extends TokenRequest{
  2178. String? code;
  2179. List<TeacherSetExaminationAnswerDTO >? answers;
  2180. SubmitReviewStudentExaminationRequest({
  2181. this.code,
  2182. this.answers,
  2183. String? token,
  2184. }) : super(
  2185. token: token,
  2186. );
  2187. factory SubmitReviewStudentExaminationRequest.fromJson(Map<String, dynamic> map) {
  2188. return SubmitReviewStudentExaminationRequest(
  2189. code: map['Code'],
  2190. answers: map['Answers'] != null ? (map['Answers'] as List).map((e)=>TeacherSetExaminationAnswerDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2191. token: map['Token'],
  2192. );
  2193. }
  2194. Map<String, dynamic> toJson() {
  2195. final map = super.toJson();
  2196. if(code != null)
  2197. map['Code'] = code;
  2198. if(answers != null)
  2199. map['Answers'] = answers;
  2200. return map;
  2201. }
  2202. }
  2203. class FindMyCourseStudentExaminationResultPagesRequest extends PageRequest{
  2204. String? courseCode;
  2205. String? keyword;
  2206. FindMyCourseStudentExaminationResultPagesRequest({
  2207. this.courseCode,
  2208. this.keyword,
  2209. int pageIndex = 0,
  2210. int pageSize = 0,
  2211. String? token,
  2212. }) : super(
  2213. pageIndex: pageIndex,
  2214. pageSize: pageSize,
  2215. token: token,
  2216. );
  2217. factory FindMyCourseStudentExaminationResultPagesRequest.fromJson(Map<String, dynamic> map) {
  2218. return FindMyCourseStudentExaminationResultPagesRequest(
  2219. courseCode: map['CourseCode'],
  2220. keyword: map['Keyword'],
  2221. pageIndex: map['PageIndex'],
  2222. pageSize: map['PageSize'],
  2223. token: map['Token'],
  2224. );
  2225. }
  2226. Map<String, dynamic> toJson() {
  2227. final map = super.toJson();
  2228. if(courseCode != null)
  2229. map['CourseCode'] = courseCode;
  2230. if(keyword != null)
  2231. map['Keyword'] = keyword;
  2232. return map;
  2233. }
  2234. }
  2235. class FindMyCourseStudentExaminationResultRequest extends TokenRequest{
  2236. String? code;
  2237. FindMyCourseStudentExaminationResultRequest({
  2238. this.code,
  2239. String? token,
  2240. }) : super(
  2241. token: token,
  2242. );
  2243. factory FindMyCourseStudentExaminationResultRequest.fromJson(Map<String, dynamic> map) {
  2244. return FindMyCourseStudentExaminationResultRequest(
  2245. code: map['Code'],
  2246. token: map['Token'],
  2247. );
  2248. }
  2249. Map<String, dynamic> toJson() {
  2250. final map = super.toJson();
  2251. if(code != null)
  2252. map['Code'] = code;
  2253. return map;
  2254. }
  2255. }
  2256. class LiveCourseBaseResult {
  2257. String? courseCode;
  2258. LiveCourseBaseResult({
  2259. this.courseCode,
  2260. });
  2261. factory LiveCourseBaseResult.fromJson(Map<String, dynamic> map) {
  2262. return LiveCourseBaseResult(
  2263. courseCode: map['CourseCode'],
  2264. );
  2265. }
  2266. Map<String, dynamic> toJson() {
  2267. final map = Map<String, dynamic>();
  2268. if(courseCode != null)
  2269. map['CourseCode'] = courseCode;
  2270. return map;
  2271. }
  2272. }
  2273. class InitiateLiveCourseResult extends LiveCourseBaseResult{
  2274. String? initiatorCode;
  2275. int roomNo;
  2276. TransactionStatusEnum liveProtocol;
  2277. int appId;
  2278. String? userSign;
  2279. int heartRateInterval;
  2280. List<LiveCourseMember >? memberLiveDatas;
  2281. InitiateLiveCourseResult({
  2282. this.initiatorCode,
  2283. this.roomNo = 0,
  2284. this.liveProtocol = TransactionStatusEnum.Applied,
  2285. this.appId = 0,
  2286. this.userSign,
  2287. this.heartRateInterval = 0,
  2288. this.memberLiveDatas,
  2289. String? courseCode,
  2290. }) : super(
  2291. courseCode: courseCode,
  2292. );
  2293. factory InitiateLiveCourseResult.fromJson(Map<String, dynamic> map) {
  2294. return InitiateLiveCourseResult(
  2295. initiatorCode: map['InitiatorCode'],
  2296. roomNo: map['RoomNo'],
  2297. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  2298. appId: map['AppId'],
  2299. userSign: map['UserSign'],
  2300. heartRateInterval: map['HeartRateInterval'],
  2301. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveCourseMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  2302. courseCode: map['CourseCode'],
  2303. );
  2304. }
  2305. Map<String, dynamic> toJson() {
  2306. final map = super.toJson();
  2307. if(initiatorCode != null)
  2308. map['InitiatorCode'] = initiatorCode;
  2309. map['RoomNo'] = roomNo;
  2310. map['LiveProtocol'] = liveProtocol.index;
  2311. map['AppId'] = appId;
  2312. if(userSign != null)
  2313. map['UserSign'] = userSign;
  2314. map['HeartRateInterval'] = heartRateInterval;
  2315. if(memberLiveDatas != null)
  2316. map['MemberLiveDatas'] = memberLiveDatas;
  2317. return map;
  2318. }
  2319. }
  2320. class InitiateLiveCourseRequest extends TokenRequest{
  2321. String? courseCode;
  2322. InitiateLiveCourseRequest({
  2323. this.courseCode,
  2324. String? token,
  2325. }) : super(
  2326. token: token,
  2327. );
  2328. factory InitiateLiveCourseRequest.fromJson(Map<String, dynamic> map) {
  2329. return InitiateLiveCourseRequest(
  2330. courseCode: map['CourseCode'],
  2331. token: map['Token'],
  2332. );
  2333. }
  2334. Map<String, dynamic> toJson() {
  2335. final map = super.toJson();
  2336. if(courseCode != null)
  2337. map['CourseCode'] = courseCode;
  2338. return map;
  2339. }
  2340. }
  2341. class JoinLiveCourseResult extends LiveCourseBaseResult{
  2342. String? userCode;
  2343. int roomNo;
  2344. TransactionStatusEnum liveProtocol;
  2345. int appId;
  2346. String? userSign;
  2347. List<LiveCourseMember >? memberLiveDatas;
  2348. JoinLiveCourseResult({
  2349. this.userCode,
  2350. this.roomNo = 0,
  2351. this.liveProtocol = TransactionStatusEnum.Applied,
  2352. this.appId = 0,
  2353. this.userSign,
  2354. this.memberLiveDatas,
  2355. String? courseCode,
  2356. }) : super(
  2357. courseCode: courseCode,
  2358. );
  2359. factory JoinLiveCourseResult.fromJson(Map<String, dynamic> map) {
  2360. return JoinLiveCourseResult(
  2361. userCode: map['UserCode'],
  2362. roomNo: map['RoomNo'],
  2363. liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
  2364. appId: map['AppId'],
  2365. userSign: map['UserSign'],
  2366. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveCourseMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  2367. courseCode: map['CourseCode'],
  2368. );
  2369. }
  2370. Map<String, dynamic> toJson() {
  2371. final map = super.toJson();
  2372. if(userCode != null)
  2373. map['UserCode'] = userCode;
  2374. map['RoomNo'] = roomNo;
  2375. map['LiveProtocol'] = liveProtocol.index;
  2376. map['AppId'] = appId;
  2377. if(userSign != null)
  2378. map['UserSign'] = userSign;
  2379. if(memberLiveDatas != null)
  2380. map['MemberLiveDatas'] = memberLiveDatas;
  2381. return map;
  2382. }
  2383. }
  2384. class JoinLiveCourseRequest extends InitiateLiveCourseRequest{
  2385. String? deviceCode;
  2386. JoinLiveCourseRequest({
  2387. this.deviceCode,
  2388. String? courseCode,
  2389. String? token,
  2390. }) : super(
  2391. courseCode: courseCode,
  2392. token: token,
  2393. );
  2394. factory JoinLiveCourseRequest.fromJson(Map<String, dynamic> map) {
  2395. return JoinLiveCourseRequest(
  2396. deviceCode: map['DeviceCode'],
  2397. courseCode: map['CourseCode'],
  2398. token: map['Token'],
  2399. );
  2400. }
  2401. Map<String, dynamic> toJson() {
  2402. final map = super.toJson();
  2403. if(deviceCode != null)
  2404. map['DeviceCode'] = deviceCode;
  2405. return map;
  2406. }
  2407. }
  2408. class StudentLivePullUrlResult {
  2409. String? rtmpPullUrl;
  2410. String? httpPullUrl;
  2411. String? hlsPullUrl;
  2412. StudentLivePullUrlResult({
  2413. this.rtmpPullUrl,
  2414. this.httpPullUrl,
  2415. this.hlsPullUrl,
  2416. });
  2417. factory StudentLivePullUrlResult.fromJson(Map<String, dynamic> map) {
  2418. return StudentLivePullUrlResult(
  2419. rtmpPullUrl: map['RtmpPullUrl'],
  2420. httpPullUrl: map['HttpPullUrl'],
  2421. hlsPullUrl: map['HlsPullUrl'],
  2422. );
  2423. }
  2424. Map<String, dynamic> toJson() {
  2425. final map = Map<String, dynamic>();
  2426. if(rtmpPullUrl != null)
  2427. map['RtmpPullUrl'] = rtmpPullUrl;
  2428. if(httpPullUrl != null)
  2429. map['HttpPullUrl'] = httpPullUrl;
  2430. if(hlsPullUrl != null)
  2431. map['HlsPullUrl'] = hlsPullUrl;
  2432. return map;
  2433. }
  2434. }
  2435. class LiveHeartRateResult {
  2436. String? liveCode;
  2437. LiveHeartRateResult({
  2438. this.liveCode,
  2439. });
  2440. factory LiveHeartRateResult.fromJson(Map<String, dynamic> map) {
  2441. return LiveHeartRateResult(
  2442. liveCode: map['LiveCode'],
  2443. );
  2444. }
  2445. Map<String, dynamic> toJson() {
  2446. final map = Map<String, dynamic>();
  2447. if(liveCode != null)
  2448. map['LiveCode'] = liveCode;
  2449. return map;
  2450. }
  2451. }
  2452. class LiveHeartRateRequest extends TokenRequest{
  2453. String? liveCode;
  2454. LiveHeartRateRequest({
  2455. this.liveCode,
  2456. String? token,
  2457. }) : super(
  2458. token: token,
  2459. );
  2460. factory LiveHeartRateRequest.fromJson(Map<String, dynamic> map) {
  2461. return LiveHeartRateRequest(
  2462. liveCode: map['LiveCode'],
  2463. token: map['Token'],
  2464. );
  2465. }
  2466. Map<String, dynamic> toJson() {
  2467. final map = super.toJson();
  2468. if(liveCode != null)
  2469. map['LiveCode'] = liveCode;
  2470. return map;
  2471. }
  2472. }
  2473. class LeaveLiveCourseRequest extends InitiateLiveCourseRequest{
  2474. LeaveLiveCourseRequest({
  2475. String? courseCode,
  2476. String? token,
  2477. }) : super(
  2478. courseCode: courseCode,
  2479. token: token,
  2480. );
  2481. factory LeaveLiveCourseRequest.fromJson(Map<String, dynamic> map) {
  2482. return LeaveLiveCourseRequest(
  2483. courseCode: map['CourseCode'],
  2484. token: map['Token'],
  2485. );
  2486. }
  2487. Map<String, dynamic> toJson() {
  2488. final map = super.toJson();
  2489. return map;
  2490. }
  2491. }
  2492. class SetMuteLiveCourseRequest extends InitiateLiveCourseRequest{
  2493. bool isMute;
  2494. SetMuteLiveCourseRequest({
  2495. this.isMute = false,
  2496. String? courseCode,
  2497. String? token,
  2498. }) : super(
  2499. courseCode: courseCode,
  2500. token: token,
  2501. );
  2502. factory SetMuteLiveCourseRequest.fromJson(Map<String, dynamic> map) {
  2503. return SetMuteLiveCourseRequest(
  2504. isMute: map['IsMute'],
  2505. courseCode: map['CourseCode'],
  2506. token: map['Token'],
  2507. );
  2508. }
  2509. Map<String, dynamic> toJson() {
  2510. final map = super.toJson();
  2511. map['IsMute'] = isMute;
  2512. return map;
  2513. }
  2514. }
  2515. class SetVideoLiveCourseRequest extends InitiateLiveCourseRequest{
  2516. bool isOpened;
  2517. SetVideoLiveCourseRequest({
  2518. this.isOpened = false,
  2519. String? courseCode,
  2520. String? token,
  2521. }) : super(
  2522. courseCode: courseCode,
  2523. token: token,
  2524. );
  2525. factory SetVideoLiveCourseRequest.fromJson(Map<String, dynamic> map) {
  2526. return SetVideoLiveCourseRequest(
  2527. isOpened: map['IsOpened'],
  2528. courseCode: map['CourseCode'],
  2529. token: map['Token'],
  2530. );
  2531. }
  2532. Map<String, dynamic> toJson() {
  2533. final map = super.toJson();
  2534. map['IsOpened'] = isOpened;
  2535. return map;
  2536. }
  2537. }
  2538. class ControlParameterInCourseRequest extends InitiateLiveCourseRequest{
  2539. List<AdditionParameterDTO >? parameters;
  2540. ControlDeviceParameterEnum controlType;
  2541. ControlParameterInCourseRequest({
  2542. this.parameters,
  2543. this.controlType = ControlDeviceParameterEnum.Start,
  2544. String? courseCode,
  2545. String? token,
  2546. }) : super(
  2547. courseCode: courseCode,
  2548. token: token,
  2549. );
  2550. factory ControlParameterInCourseRequest.fromJson(Map<String, dynamic> map) {
  2551. return ControlParameterInCourseRequest(
  2552. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2553. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  2554. courseCode: map['CourseCode'],
  2555. token: map['Token'],
  2556. );
  2557. }
  2558. Map<String, dynamic> toJson() {
  2559. final map = super.toJson();
  2560. if(parameters != null)
  2561. map['Parameters'] = parameters;
  2562. map['ControlType'] = controlType.index;
  2563. return map;
  2564. }
  2565. }
  2566. class UploadRemoteExamRequest extends TokenRequest{
  2567. String? deviceUniqueCode;
  2568. String? previewFileToken;
  2569. String? fileToken;
  2570. int fileSize;
  2571. String? coverImageToken;
  2572. String? applicationCategory;
  2573. String? application;
  2574. RemedicalFileDataTypeEnum fileDataType;
  2575. MeasuredResultsDTO? measuredResult;
  2576. ScanImageDTO? commentResult;
  2577. UploadRemoteExamRequest({
  2578. this.deviceUniqueCode,
  2579. this.previewFileToken,
  2580. this.fileToken,
  2581. this.fileSize = 0,
  2582. this.coverImageToken,
  2583. this.applicationCategory,
  2584. this.application,
  2585. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  2586. this.measuredResult,
  2587. this.commentResult,
  2588. String? token,
  2589. }) : super(
  2590. token: token,
  2591. );
  2592. factory UploadRemoteExamRequest.fromJson(Map<String, dynamic> map) {
  2593. return UploadRemoteExamRequest(
  2594. deviceUniqueCode: map['DeviceUniqueCode'],
  2595. previewFileToken: map['PreviewFileToken'],
  2596. fileToken: map['FileToken'],
  2597. fileSize: map['FileSize'],
  2598. coverImageToken: map['CoverImageToken'],
  2599. applicationCategory: map['ApplicationCategory'],
  2600. application: map['Application'],
  2601. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  2602. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  2603. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  2604. token: map['Token'],
  2605. );
  2606. }
  2607. Map<String, dynamic> toJson() {
  2608. final map = super.toJson();
  2609. if(deviceUniqueCode != null)
  2610. map['DeviceUniqueCode'] = deviceUniqueCode;
  2611. if(previewFileToken != null)
  2612. map['PreviewFileToken'] = previewFileToken;
  2613. if(fileToken != null)
  2614. map['FileToken'] = fileToken;
  2615. map['FileSize'] = fileSize;
  2616. if(coverImageToken != null)
  2617. map['CoverImageToken'] = coverImageToken;
  2618. if(applicationCategory != null)
  2619. map['ApplicationCategory'] = applicationCategory;
  2620. if(application != null)
  2621. map['Application'] = application;
  2622. map['FileDataType'] = fileDataType.index;
  2623. if(measuredResult != null)
  2624. map['MeasuredResult'] = measuredResult;
  2625. if(commentResult != null)
  2626. map['CommentResult'] = commentResult;
  2627. return map;
  2628. }
  2629. }
  2630. class RemoteExaminationDTO extends BaseDTO{
  2631. String? code;
  2632. String? deviceCode;
  2633. String? userCode;
  2634. String? application;
  2635. String? previewUrl;
  2636. String? imageUrl;
  2637. String? coverImageUrl;
  2638. String? originImageUrl;
  2639. int imageSize;
  2640. RemedicalFileDataTypeEnum fileDataType;
  2641. MeasuredResultsDTO? measuredResult;
  2642. ScanImageDTO? commentResult;
  2643. RemoteExaminationDTO({
  2644. this.code,
  2645. this.deviceCode,
  2646. this.userCode,
  2647. this.application,
  2648. this.previewUrl,
  2649. this.imageUrl,
  2650. this.coverImageUrl,
  2651. this.originImageUrl,
  2652. this.imageSize = 0,
  2653. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  2654. this.measuredResult,
  2655. this.commentResult,
  2656. DateTime? createTime,
  2657. DateTime? updateTime,
  2658. }) : super(
  2659. createTime: createTime,
  2660. updateTime: updateTime,
  2661. );
  2662. factory RemoteExaminationDTO.fromJson(Map<String, dynamic> map) {
  2663. return RemoteExaminationDTO(
  2664. code: map['Code'],
  2665. deviceCode: map['DeviceCode'],
  2666. userCode: map['UserCode'],
  2667. application: map['Application'],
  2668. previewUrl: map['PreviewUrl'],
  2669. imageUrl: map['ImageUrl'],
  2670. coverImageUrl: map['CoverImageUrl'],
  2671. originImageUrl: map['OriginImageUrl'],
  2672. imageSize: map['ImageSize'],
  2673. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  2674. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  2675. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  2676. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2677. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2678. );
  2679. }
  2680. Map<String, dynamic> toJson() {
  2681. final map = super.toJson();
  2682. if(code != null)
  2683. map['Code'] = code;
  2684. if(deviceCode != null)
  2685. map['DeviceCode'] = deviceCode;
  2686. if(userCode != null)
  2687. map['UserCode'] = userCode;
  2688. if(application != null)
  2689. map['Application'] = application;
  2690. if(previewUrl != null)
  2691. map['PreviewUrl'] = previewUrl;
  2692. if(imageUrl != null)
  2693. map['ImageUrl'] = imageUrl;
  2694. if(coverImageUrl != null)
  2695. map['CoverImageUrl'] = coverImageUrl;
  2696. if(originImageUrl != null)
  2697. map['OriginImageUrl'] = originImageUrl;
  2698. map['ImageSize'] = imageSize;
  2699. map['FileDataType'] = fileDataType.index;
  2700. if(measuredResult != null)
  2701. map['MeasuredResult'] = measuredResult;
  2702. if(commentResult != null)
  2703. map['CommentResult'] = commentResult;
  2704. return map;
  2705. }
  2706. }
  2707. class RemoteExaminationPageDTO extends RemoteExaminationDTO{
  2708. String? deviceName;
  2709. RemoteExaminationPageDTO({
  2710. this.deviceName,
  2711. String? code,
  2712. String? deviceCode,
  2713. String? userCode,
  2714. String? application,
  2715. String? previewUrl,
  2716. String? imageUrl,
  2717. String? coverImageUrl,
  2718. String? originImageUrl,
  2719. int imageSize = 0,
  2720. RemedicalFileDataTypeEnum fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  2721. MeasuredResultsDTO? measuredResult,
  2722. ScanImageDTO? commentResult,
  2723. DateTime? createTime,
  2724. DateTime? updateTime,
  2725. }) : super(
  2726. code: code,
  2727. deviceCode: deviceCode,
  2728. userCode: userCode,
  2729. application: application,
  2730. previewUrl: previewUrl,
  2731. imageUrl: imageUrl,
  2732. coverImageUrl: coverImageUrl,
  2733. originImageUrl: originImageUrl,
  2734. imageSize: imageSize,
  2735. fileDataType: fileDataType,
  2736. measuredResult: measuredResult,
  2737. commentResult: commentResult,
  2738. createTime: createTime,
  2739. updateTime: updateTime,
  2740. );
  2741. factory RemoteExaminationPageDTO.fromJson(Map<String, dynamic> map) {
  2742. return RemoteExaminationPageDTO(
  2743. deviceName: map['DeviceName'],
  2744. code: map['Code'],
  2745. deviceCode: map['DeviceCode'],
  2746. userCode: map['UserCode'],
  2747. application: map['Application'],
  2748. previewUrl: map['PreviewUrl'],
  2749. imageUrl: map['ImageUrl'],
  2750. coverImageUrl: map['CoverImageUrl'],
  2751. originImageUrl: map['OriginImageUrl'],
  2752. imageSize: map['ImageSize'],
  2753. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  2754. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  2755. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  2756. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2757. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2758. );
  2759. }
  2760. Map<String, dynamic> toJson() {
  2761. final map = super.toJson();
  2762. if(deviceName != null)
  2763. map['DeviceName'] = deviceName;
  2764. return map;
  2765. }
  2766. }
  2767. class AddStudentInCourseUserGroupRequest extends TokenRequest{
  2768. String? userGroupCode;
  2769. String? shortCode;
  2770. AddStudentInCourseUserGroupRequest({
  2771. this.userGroupCode,
  2772. this.shortCode,
  2773. String? token,
  2774. }) : super(
  2775. token: token,
  2776. );
  2777. factory AddStudentInCourseUserGroupRequest.fromJson(Map<String, dynamic> map) {
  2778. return AddStudentInCourseUserGroupRequest(
  2779. userGroupCode: map['UserGroupCode'],
  2780. shortCode: map['ShortCode'],
  2781. token: map['Token'],
  2782. );
  2783. }
  2784. Map<String, dynamic> toJson() {
  2785. final map = super.toJson();
  2786. if(userGroupCode != null)
  2787. map['UserGroupCode'] = userGroupCode;
  2788. if(shortCode != null)
  2789. map['ShortCode'] = shortCode;
  2790. return map;
  2791. }
  2792. }
  2793. class StudentLeaveCourseUserGroupRequest extends TokenRequest{
  2794. String? userGroupCode;
  2795. StudentLeaveCourseUserGroupRequest({
  2796. this.userGroupCode,
  2797. String? token,
  2798. }) : super(
  2799. token: token,
  2800. );
  2801. factory StudentLeaveCourseUserGroupRequest.fromJson(Map<String, dynamic> map) {
  2802. return StudentLeaveCourseUserGroupRequest(
  2803. userGroupCode: map['UserGroupCode'],
  2804. token: map['Token'],
  2805. );
  2806. }
  2807. Map<String, dynamic> toJson() {
  2808. final map = super.toJson();
  2809. if(userGroupCode != null)
  2810. map['UserGroupCode'] = userGroupCode;
  2811. return map;
  2812. }
  2813. }
  2814. class StudyCompletedRequest {
  2815. String? courseCode;
  2816. String? studentCode;
  2817. StudyCompletedRequest({
  2818. this.courseCode,
  2819. this.studentCode,
  2820. });
  2821. factory StudyCompletedRequest.fromJson(Map<String, dynamic> map) {
  2822. return StudyCompletedRequest(
  2823. courseCode: map['CourseCode'],
  2824. studentCode: map['StudentCode'],
  2825. );
  2826. }
  2827. Map<String, dynamic> toJson() {
  2828. final map = Map<String, dynamic>();
  2829. if(courseCode != null)
  2830. map['CourseCode'] = courseCode;
  2831. if(studentCode != null)
  2832. map['StudentCode'] = studentCode;
  2833. return map;
  2834. }
  2835. }
  2836. class AddCourseAlbumRequest extends TokenRequest{
  2837. String? name;
  2838. List<String >? courseCodes;
  2839. String? cover;
  2840. String? introduction;
  2841. List<String >? courseLabelCodes;
  2842. int sort;
  2843. bool isStick;
  2844. String? teacherCode;
  2845. String? teacherName;
  2846. CourseViewRangeEnum viewRange;
  2847. double price;
  2848. AddCourseAlbumRequest({
  2849. this.name,
  2850. this.courseCodes,
  2851. this.cover,
  2852. this.introduction,
  2853. this.courseLabelCodes,
  2854. this.sort = 0,
  2855. this.isStick = false,
  2856. this.teacherCode,
  2857. this.teacherName,
  2858. this.viewRange = CourseViewRangeEnum.All,
  2859. this.price = 0,
  2860. String? token,
  2861. }) : super(
  2862. token: token,
  2863. );
  2864. factory AddCourseAlbumRequest.fromJson(Map<String, dynamic> map) {
  2865. return AddCourseAlbumRequest(
  2866. name: map['Name'],
  2867. courseCodes: map['CourseCodes'] != null ? map['CourseCodes'].cast<String>().toList() : null,
  2868. cover: map['Cover'],
  2869. introduction: map['Introduction'],
  2870. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  2871. sort: map['Sort'],
  2872. isStick: map['IsStick'],
  2873. teacherCode: map['TeacherCode'],
  2874. teacherName: map['TeacherName'],
  2875. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  2876. price: double.parse(map['Price'].toString()),
  2877. token: map['Token'],
  2878. );
  2879. }
  2880. Map<String, dynamic> toJson() {
  2881. final map = super.toJson();
  2882. if(name != null)
  2883. map['Name'] = name;
  2884. if(courseCodes != null)
  2885. map['CourseCodes'] = courseCodes;
  2886. if(cover != null)
  2887. map['Cover'] = cover;
  2888. if(introduction != null)
  2889. map['Introduction'] = introduction;
  2890. if(courseLabelCodes != null)
  2891. map['CourseLabelCodes'] = courseLabelCodes;
  2892. map['Sort'] = sort;
  2893. map['IsStick'] = isStick;
  2894. if(teacherCode != null)
  2895. map['TeacherCode'] = teacherCode;
  2896. if(teacherName != null)
  2897. map['TeacherName'] = teacherName;
  2898. map['ViewRange'] = viewRange.index;
  2899. map['Price'] = price;
  2900. return map;
  2901. }
  2902. }
  2903. class DeleteCourseAlbumRequest {
  2904. String? courseAlbumCode;
  2905. DeleteCourseAlbumRequest({
  2906. this.courseAlbumCode,
  2907. });
  2908. factory DeleteCourseAlbumRequest.fromJson(Map<String, dynamic> map) {
  2909. return DeleteCourseAlbumRequest(
  2910. courseAlbumCode: map['CourseAlbumCode'],
  2911. );
  2912. }
  2913. Map<String, dynamic> toJson() {
  2914. final map = Map<String, dynamic>();
  2915. if(courseAlbumCode != null)
  2916. map['CourseAlbumCode'] = courseAlbumCode;
  2917. return map;
  2918. }
  2919. }
  2920. class CourseCommonInfoDTO extends BaseCourseAlbumDTO{
  2921. String? cover;
  2922. String? introduction;
  2923. List<String >? courseLabels;
  2924. String? teacherCode;
  2925. String? teacherName;
  2926. CourseViewRangeEnum viewRange;
  2927. double price;
  2928. CourseTypeEnum courseType;
  2929. List<BaseUserGroupDTO >? userGroupList;
  2930. List<BaseCourseAlbumDTO >? courseAlbumList;
  2931. StudentCourseStatusEnum signCourseStatus;
  2932. bool isPay;
  2933. CourseCommonInfoDTO({
  2934. this.cover,
  2935. this.introduction,
  2936. this.courseLabels,
  2937. this.teacherCode,
  2938. this.teacherName,
  2939. this.viewRange = CourseViewRangeEnum.All,
  2940. this.price = 0,
  2941. this.courseType = CourseTypeEnum.Unknown,
  2942. this.userGroupList,
  2943. this.courseAlbumList,
  2944. this.signCourseStatus = StudentCourseStatusEnum.All,
  2945. this.isPay = false,
  2946. String? code,
  2947. String? name,
  2948. }) : super(
  2949. code: code,
  2950. name: name,
  2951. );
  2952. factory CourseCommonInfoDTO.fromJson(Map<String, dynamic> map) {
  2953. return CourseCommonInfoDTO(
  2954. cover: map['Cover'],
  2955. introduction: map['Introduction'],
  2956. courseLabels: map['CourseLabels'] != null ? map['CourseLabels'].cast<String>().toList() : null,
  2957. teacherCode: map['TeacherCode'],
  2958. teacherName: map['TeacherName'],
  2959. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  2960. price: double.parse(map['Price'].toString()),
  2961. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  2962. userGroupList: map['UserGroupList'] != null ? (map['UserGroupList'] as List).map((e)=>BaseUserGroupDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2963. courseAlbumList: map['CourseAlbumList'] != null ? (map['CourseAlbumList'] as List).map((e)=>BaseCourseAlbumDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2964. signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']),
  2965. isPay: map['IsPay'],
  2966. code: map['Code'],
  2967. name: map['Name'],
  2968. );
  2969. }
  2970. Map<String, dynamic> toJson() {
  2971. final map = super.toJson();
  2972. if(cover != null)
  2973. map['Cover'] = cover;
  2974. if(introduction != null)
  2975. map['Introduction'] = introduction;
  2976. if(courseLabels != null)
  2977. map['CourseLabels'] = courseLabels;
  2978. if(teacherCode != null)
  2979. map['TeacherCode'] = teacherCode;
  2980. if(teacherName != null)
  2981. map['TeacherName'] = teacherName;
  2982. map['ViewRange'] = viewRange.index;
  2983. map['Price'] = price;
  2984. map['CourseType'] = courseType.index;
  2985. if(userGroupList != null)
  2986. map['UserGroupList'] = userGroupList;
  2987. if(courseAlbumList != null)
  2988. map['CourseAlbumList'] = courseAlbumList;
  2989. map['SignCourseStatus'] = signCourseStatus.index;
  2990. map['IsPay'] = isPay;
  2991. return map;
  2992. }
  2993. }
  2994. class CourseAlbumExtendDTO extends BaseCourseAlbumDTO{
  2995. List<CourseInfoDetailDTO >? courseInfos;
  2996. int studentCount;
  2997. String? poster;
  2998. List<String >? courseCodes;
  2999. String? courseIntro;
  3000. List<String >? courseLabelCodes;
  3001. String? teacherCode;
  3002. String? teacherName;
  3003. CourseViewRangeEnum viewRange;
  3004. double price;
  3005. DateTime? createTime;
  3006. int sort;
  3007. bool isStick;
  3008. StudentCourseStatusEnum signCourseStatus;
  3009. bool isPay;
  3010. CourseAlbumExtendDTO({
  3011. this.courseInfos,
  3012. this.studentCount = 0,
  3013. this.poster,
  3014. this.courseCodes,
  3015. this.courseIntro,
  3016. this.courseLabelCodes,
  3017. this.teacherCode,
  3018. this.teacherName,
  3019. this.viewRange = CourseViewRangeEnum.All,
  3020. this.price = 0,
  3021. this.createTime,
  3022. this.sort = 0,
  3023. this.isStick = false,
  3024. this.signCourseStatus = StudentCourseStatusEnum.All,
  3025. this.isPay = false,
  3026. String? code,
  3027. String? name,
  3028. }) : super(
  3029. code: code,
  3030. name: name,
  3031. );
  3032. factory CourseAlbumExtendDTO.fromJson(Map<String, dynamic> map) {
  3033. return CourseAlbumExtendDTO(
  3034. courseInfos: map['CourseInfos'] != null ? (map['CourseInfos'] as List).map((e)=>CourseInfoDetailDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  3035. studentCount: map['StudentCount'],
  3036. poster: map['Poster'],
  3037. courseCodes: map['CourseCodes'] != null ? map['CourseCodes'].cast<String>().toList() : null,
  3038. courseIntro: map['CourseIntro'],
  3039. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  3040. teacherCode: map['TeacherCode'],
  3041. teacherName: map['TeacherName'],
  3042. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  3043. price: double.parse(map['Price'].toString()),
  3044. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  3045. sort: map['Sort'],
  3046. isStick: map['IsStick'],
  3047. signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']),
  3048. isPay: map['IsPay'],
  3049. code: map['Code'],
  3050. name: map['Name'],
  3051. );
  3052. }
  3053. Map<String, dynamic> toJson() {
  3054. final map = super.toJson();
  3055. if(courseInfos != null)
  3056. map['CourseInfos'] = courseInfos;
  3057. map['StudentCount'] = studentCount;
  3058. if(poster != null)
  3059. map['Poster'] = poster;
  3060. if(courseCodes != null)
  3061. map['CourseCodes'] = courseCodes;
  3062. if(courseIntro != null)
  3063. map['CourseIntro'] = courseIntro;
  3064. if(courseLabelCodes != null)
  3065. map['CourseLabelCodes'] = courseLabelCodes;
  3066. if(teacherCode != null)
  3067. map['TeacherCode'] = teacherCode;
  3068. if(teacherName != null)
  3069. map['TeacherName'] = teacherName;
  3070. map['ViewRange'] = viewRange.index;
  3071. map['Price'] = price;
  3072. if(createTime != null)
  3073. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  3074. map['Sort'] = sort;
  3075. map['IsStick'] = isStick;
  3076. map['SignCourseStatus'] = signCourseStatus.index;
  3077. map['IsPay'] = isPay;
  3078. return map;
  3079. }
  3080. }
  3081. class FindCourseAlbumByCodeRequest extends TokenRequest{
  3082. String? courseAlbumCode;
  3083. String? languageCode;
  3084. FindCourseAlbumByCodeRequest({
  3085. this.courseAlbumCode,
  3086. this.languageCode,
  3087. String? token,
  3088. }) : super(
  3089. token: token,
  3090. );
  3091. factory FindCourseAlbumByCodeRequest.fromJson(Map<String, dynamic> map) {
  3092. return FindCourseAlbumByCodeRequest(
  3093. courseAlbumCode: map['CourseAlbumCode'],
  3094. languageCode: map['LanguageCode'],
  3095. token: map['Token'],
  3096. );
  3097. }
  3098. Map<String, dynamic> toJson() {
  3099. final map = super.toJson();
  3100. if(courseAlbumCode != null)
  3101. map['CourseAlbumCode'] = courseAlbumCode;
  3102. if(languageCode != null)
  3103. map['LanguageCode'] = languageCode;
  3104. return map;
  3105. }
  3106. }
  3107. class TeacherAddStudentsInUserGroupsRequest extends TokenRequest{
  3108. String? userGroupCode;
  3109. List<String >? studentCodes;
  3110. TeacherAddStudentsInUserGroupsRequest({
  3111. this.userGroupCode,
  3112. this.studentCodes,
  3113. String? token,
  3114. }) : super(
  3115. token: token,
  3116. );
  3117. factory TeacherAddStudentsInUserGroupsRequest.fromJson(Map<String, dynamic> map) {
  3118. return TeacherAddStudentsInUserGroupsRequest(
  3119. userGroupCode: map['UserGroupCode'],
  3120. studentCodes: map['StudentCodes'] != null ? map['StudentCodes'].cast<String>().toList() : null,
  3121. token: map['Token'],
  3122. );
  3123. }
  3124. Map<String, dynamic> toJson() {
  3125. final map = super.toJson();
  3126. if(userGroupCode != null)
  3127. map['UserGroupCode'] = userGroupCode;
  3128. if(studentCodes != null)
  3129. map['StudentCodes'] = studentCodes;
  3130. return map;
  3131. }
  3132. }
  3133. class JoinClassApprovedRequest extends TokenRequest{
  3134. String? userGroupCode;
  3135. List<String >? students;
  3136. JoinClassApprovedRequest({
  3137. this.userGroupCode,
  3138. this.students,
  3139. String? token,
  3140. }) : super(
  3141. token: token,
  3142. );
  3143. factory JoinClassApprovedRequest.fromJson(Map<String, dynamic> map) {
  3144. return JoinClassApprovedRequest(
  3145. userGroupCode: map['UserGroupCode'],
  3146. students: map['Students'] != null ? map['Students'].cast<String>().toList() : null,
  3147. token: map['Token'],
  3148. );
  3149. }
  3150. Map<String, dynamic> toJson() {
  3151. final map = super.toJson();
  3152. if(userGroupCode != null)
  3153. map['UserGroupCode'] = userGroupCode;
  3154. if(students != null)
  3155. map['Students'] = students;
  3156. return map;
  3157. }
  3158. }
  3159. class JoinClassRejectedRequest extends TokenRequest{
  3160. String? userGroupCode;
  3161. List<String >? students;
  3162. JoinClassRejectedRequest({
  3163. this.userGroupCode,
  3164. this.students,
  3165. String? token,
  3166. }) : super(
  3167. token: token,
  3168. );
  3169. factory JoinClassRejectedRequest.fromJson(Map<String, dynamic> map) {
  3170. return JoinClassRejectedRequest(
  3171. userGroupCode: map['UserGroupCode'],
  3172. students: map['Students'] != null ? map['Students'].cast<String>().toList() : null,
  3173. token: map['Token'],
  3174. );
  3175. }
  3176. Map<String, dynamic> toJson() {
  3177. final map = super.toJson();
  3178. if(userGroupCode != null)
  3179. map['UserGroupCode'] = userGroupCode;
  3180. if(students != null)
  3181. map['Students'] = students;
  3182. return map;
  3183. }
  3184. }
  3185. class UserGroupStudentsDTO {
  3186. String? code;
  3187. String? name;
  3188. String? userGroupCode;
  3189. String? phone;
  3190. bool isPay;
  3191. LearnerStatusEnum learnerStatus;
  3192. String? organizationName;
  3193. UserGroupStudentsDTO({
  3194. this.code,
  3195. this.name,
  3196. this.userGroupCode,
  3197. this.phone,
  3198. this.isPay = false,
  3199. this.learnerStatus = LearnerStatusEnum.Unknown,
  3200. this.organizationName,
  3201. });
  3202. factory UserGroupStudentsDTO.fromJson(Map<String, dynamic> map) {
  3203. return UserGroupStudentsDTO(
  3204. code: map['Code'],
  3205. name: map['Name'],
  3206. userGroupCode: map['UserGroupCode'],
  3207. phone: map['Phone'],
  3208. isPay: map['IsPay'],
  3209. learnerStatus: LearnerStatusEnum.values.firstWhere((e) => e.index == map['LearnerStatus']),
  3210. organizationName: map['OrganizationName'],
  3211. );
  3212. }
  3213. Map<String, dynamic> toJson() {
  3214. final map = Map<String, dynamic>();
  3215. if(code != null)
  3216. map['Code'] = code;
  3217. if(name != null)
  3218. map['Name'] = name;
  3219. if(userGroupCode != null)
  3220. map['UserGroupCode'] = userGroupCode;
  3221. if(phone != null)
  3222. map['Phone'] = phone;
  3223. map['IsPay'] = isPay;
  3224. map['LearnerStatus'] = learnerStatus.index;
  3225. if(organizationName != null)
  3226. map['OrganizationName'] = organizationName;
  3227. return map;
  3228. }
  3229. }
  3230. class FindStudentListRequest extends TokenRequest{
  3231. String? userGroupCode;
  3232. LearnerStatusEnum learnerStatus;
  3233. FindStudentListRequest({
  3234. this.userGroupCode,
  3235. this.learnerStatus = LearnerStatusEnum.Unknown,
  3236. String? token,
  3237. }) : super(
  3238. token: token,
  3239. );
  3240. factory FindStudentListRequest.fromJson(Map<String, dynamic> map) {
  3241. return FindStudentListRequest(
  3242. userGroupCode: map['UserGroupCode'],
  3243. learnerStatus: LearnerStatusEnum.values.firstWhere((e) => e.index == map['LearnerStatus']),
  3244. token: map['Token'],
  3245. );
  3246. }
  3247. Map<String, dynamic> toJson() {
  3248. final map = super.toJson();
  3249. if(userGroupCode != null)
  3250. map['UserGroupCode'] = userGroupCode;
  3251. map['LearnerStatus'] = learnerStatus.index;
  3252. return map;
  3253. }
  3254. }
  3255. class CreateVideosRequest extends TokenRequest{
  3256. List<SaveVideoRequest >? videoList;
  3257. CreateVideosRequest({
  3258. this.videoList,
  3259. String? token,
  3260. }) : super(
  3261. token: token,
  3262. );
  3263. factory CreateVideosRequest.fromJson(Map<String, dynamic> map) {
  3264. return CreateVideosRequest(
  3265. videoList: map['VideoList'] != null ? (map['VideoList'] as List).map((e)=>SaveVideoRequest.fromJson(e as Map<String,dynamic>)).toList() : null,
  3266. token: map['Token'],
  3267. );
  3268. }
  3269. Map<String, dynamic> toJson() {
  3270. final map = super.toJson();
  3271. if(videoList != null)
  3272. map['VideoList'] = videoList;
  3273. return map;
  3274. }
  3275. }
  3276. class GetUserPagesRequest extends PageRequest{
  3277. String? queryType;
  3278. String? keyword;
  3279. String? queryState;
  3280. GetUserPagesRequest({
  3281. this.queryType,
  3282. this.keyword,
  3283. this.queryState,
  3284. int pageIndex = 0,
  3285. int pageSize = 0,
  3286. String? token,
  3287. }) : super(
  3288. pageIndex: pageIndex,
  3289. pageSize: pageSize,
  3290. token: token,
  3291. );
  3292. factory GetUserPagesRequest.fromJson(Map<String, dynamic> map) {
  3293. return GetUserPagesRequest(
  3294. queryType: map['QueryType'],
  3295. keyword: map['Keyword'],
  3296. queryState: map['QueryState'],
  3297. pageIndex: map['PageIndex'],
  3298. pageSize: map['PageSize'],
  3299. token: map['Token'],
  3300. );
  3301. }
  3302. Map<String, dynamic> toJson() {
  3303. final map = super.toJson();
  3304. if(queryType != null)
  3305. map['QueryType'] = queryType;
  3306. if(keyword != null)
  3307. map['Keyword'] = keyword;
  3308. if(queryState != null)
  3309. map['QueryState'] = queryState;
  3310. return map;
  3311. }
  3312. }
  3313. class SendLiveInteractiveBoardDataRequest extends TokenRequest{
  3314. String? roomId;
  3315. bool isClear;
  3316. String? boardData;
  3317. SendLiveInteractiveBoardDataRequest({
  3318. this.roomId,
  3319. this.isClear = false,
  3320. this.boardData,
  3321. String? token,
  3322. }) : super(
  3323. token: token,
  3324. );
  3325. factory SendLiveInteractiveBoardDataRequest.fromJson(Map<String, dynamic> map) {
  3326. return SendLiveInteractiveBoardDataRequest(
  3327. roomId: map['RoomId'],
  3328. isClear: map['IsClear'],
  3329. boardData: map['BoardData'],
  3330. token: map['Token'],
  3331. );
  3332. }
  3333. Map<String, dynamic> toJson() {
  3334. final map = super.toJson();
  3335. if(roomId != null)
  3336. map['RoomId'] = roomId;
  3337. map['IsClear'] = isClear;
  3338. if(boardData != null)
  3339. map['BoardData'] = boardData;
  3340. return map;
  3341. }
  3342. }