education.m.dart 126 KB

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