education.m.dart 111 KB

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