education.m.dart 109 KB

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