education.m.dart 113 KB

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