education.m.dart 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002
  1. import 'notification.m.dart';
  2. import 'liveConsultation.m.dart';
  3. import 'device.m.dart';
  4. import 'package:fis_jsonrpc/utils.dart';
  5. class BaseLabelInfoDTO extends BaseDTO{
  6. String? code;
  7. String? name;
  8. String? parentCode;
  9. BaseLabelInfoDTO({
  10. this.code,
  11. this.name,
  12. this.parentCode,
  13. DateTime? createTime,
  14. DateTime? updateTime,
  15. }) : super(
  16. createTime: createTime,
  17. updateTime: updateTime,
  18. );
  19. factory BaseLabelInfoDTO.fromJson(Map<String, dynamic> map) {
  20. return BaseLabelInfoDTO(
  21. code: map['Code'],
  22. name: map['Name'],
  23. parentCode: map['ParentCode'],
  24. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  25. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  26. );
  27. }
  28. Map<String, dynamic> toJson() {
  29. final map = super.toJson();
  30. if(code != null)
  31. map['Code'] = code;
  32. if(name != null)
  33. map['Name'] = name;
  34. if(parentCode != null)
  35. map['ParentCode'] = parentCode;
  36. return map;
  37. }
  38. }
  39. enum LabelTypeEnum {
  40. Unknown,
  41. CaseLabel,
  42. CourseLabel,
  43. }
  44. class LabelLanguageConfigDTO {
  45. String? name;
  46. String? languageCode;
  47. LabelLanguageConfigDTO({
  48. this.name,
  49. this.languageCode,
  50. });
  51. factory LabelLanguageConfigDTO.fromJson(Map<String, dynamic> map) {
  52. return LabelLanguageConfigDTO(
  53. name: map['Name'],
  54. languageCode: map['LanguageCode'],
  55. );
  56. }
  57. Map<String, dynamic> toJson() {
  58. final map = Map<String, dynamic>();
  59. if(name != null)
  60. map['Name'] = name;
  61. if(languageCode != null)
  62. map['LanguageCode'] = languageCode;
  63. return map;
  64. }
  65. }
  66. class CourseLabelDTO extends BaseLabelInfoDTO{
  67. String? languageCode;
  68. LabelTypeEnum type;
  69. OrganizationPatientTypeEnum useObjectType;
  70. bool isLastLevel;
  71. List<CourseLabelDTO >? childLabels;
  72. List<LabelLanguageConfigDTO >? labelLanguageConfigs;
  73. CourseLabelDTO({
  74. this.languageCode,
  75. this.type = LabelTypeEnum.Unknown,
  76. this.useObjectType = OrganizationPatientTypeEnum.Person,
  77. this.isLastLevel = false,
  78. this.childLabels,
  79. this.labelLanguageConfigs,
  80. String? code,
  81. String? name,
  82. String? parentCode,
  83. DateTime? createTime,
  84. DateTime? updateTime,
  85. }) : super(
  86. code: code,
  87. name: name,
  88. parentCode: parentCode,
  89. createTime: createTime,
  90. updateTime: updateTime,
  91. );
  92. factory CourseLabelDTO.fromJson(Map<String, dynamic> map) {
  93. return CourseLabelDTO(
  94. languageCode: map['LanguageCode'],
  95. type: LabelTypeEnum.values.firstWhere((e) => e.index == map['Type']),
  96. useObjectType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['UseObjectType']),
  97. isLastLevel: map['IsLastLevel'],
  98. childLabels: map['ChildLabels'] != null ? (map['ChildLabels'] as List).map((e)=>CourseLabelDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  99. labelLanguageConfigs: map['LabelLanguageConfigs'] != null ? (map['LabelLanguageConfigs'] as List).map((e)=>LabelLanguageConfigDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  100. code: map['Code'],
  101. name: map['Name'],
  102. parentCode: map['ParentCode'],
  103. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  104. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  105. );
  106. }
  107. Map<String, dynamic> toJson() {
  108. final map = super.toJson();
  109. if(languageCode != null)
  110. map['LanguageCode'] = languageCode;
  111. map['Type'] = type.index;
  112. map['UseObjectType'] = useObjectType.index;
  113. map['IsLastLevel'] = isLastLevel;
  114. if(childLabels != null)
  115. map['ChildLabels'] = childLabels;
  116. if(labelLanguageConfigs != null)
  117. map['LabelLanguageConfigs'] = labelLanguageConfigs;
  118. return map;
  119. }
  120. }
  121. class QueryCourseLabelListRequest extends TokenRequest{
  122. String? name;
  123. String? languageCode;
  124. LabelTypeEnum type;
  125. String? parentCode;
  126. QueryCourseLabelListRequest({
  127. this.name,
  128. this.languageCode,
  129. this.type = LabelTypeEnum.Unknown,
  130. this.parentCode,
  131. String? token,
  132. }) : super(
  133. token: token,
  134. );
  135. factory QueryCourseLabelListRequest.fromJson(Map<String, dynamic> map) {
  136. return QueryCourseLabelListRequest(
  137. name: map['Name'],
  138. languageCode: map['LanguageCode'],
  139. type: LabelTypeEnum.values.firstWhere((e) => e.index == map['Type']),
  140. parentCode: map['ParentCode'],
  141. token: map['Token'],
  142. );
  143. }
  144. Map<String, dynamic> toJson() {
  145. final map = super.toJson();
  146. if(name != null)
  147. map['Name'] = name;
  148. if(languageCode != null)
  149. map['LanguageCode'] = languageCode;
  150. map['Type'] = type.index;
  151. if(parentCode != null)
  152. map['ParentCode'] = parentCode;
  153. return map;
  154. }
  155. }
  156. enum CourseTypeEnum {
  157. Unknown,
  158. LiveCourse,
  159. VideoCourse,
  160. Multimedia,
  161. }
  162. enum CourseAudienceTypeEnum {
  163. Unknown,
  164. PublicClass,
  165. PrivateClass,
  166. }
  167. class ValueType {
  168. ValueType();
  169. factory ValueType.fromJson(Map<String, dynamic> map) {
  170. return ValueType(
  171. );
  172. }
  173. Map<String, dynamic> toJson() {
  174. final map = Map<String, dynamic>();
  175. return map;
  176. }
  177. }
  178. class Decimal extends ValueType{
  179. Decimal(
  180. ) : super(
  181. );
  182. factory Decimal.fromJson(Map<String, dynamic> map) {
  183. return Decimal(
  184. );
  185. }
  186. Map<String, dynamic> toJson() {
  187. final map = super.toJson();
  188. return map;
  189. }
  190. }
  191. enum CourseExaminationTypeEnum {
  192. Practice,
  193. Release,
  194. }
  195. class BaseCourseExaminationDTO {
  196. String? code;
  197. String? name;
  198. bool isRelease;
  199. CourseExaminationTypeEnum examinationType;
  200. DateTime? startTime;
  201. int examDuration;
  202. double totalScore;
  203. BaseCourseExaminationDTO({
  204. this.code,
  205. this.name,
  206. this.isRelease = false,
  207. this.examinationType = CourseExaminationTypeEnum.Practice,
  208. this.startTime,
  209. this.examDuration = 0,
  210. this.totalScore = 0,
  211. });
  212. factory BaseCourseExaminationDTO.fromJson(Map<String, dynamic> map) {
  213. return BaseCourseExaminationDTO(
  214. code: map['Code'],
  215. name: map['Name'],
  216. isRelease: map['IsRelease'],
  217. examinationType: CourseExaminationTypeEnum.values.firstWhere((e) => e.index == map['ExaminationType']),
  218. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  219. examDuration: map['ExamDuration'],
  220. totalScore: double.parse(map['TotalScore'].toString()),
  221. );
  222. }
  223. Map<String, dynamic> toJson() {
  224. final map = Map<String, dynamic>();
  225. if(code != null)
  226. map['Code'] = code;
  227. if(name != null)
  228. map['Name'] = name;
  229. map['IsRelease'] = isRelease;
  230. map['ExaminationType'] = examinationType.index;
  231. if(startTime != null)
  232. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  233. map['ExamDuration'] = examDuration;
  234. map['TotalScore'] = totalScore;
  235. return map;
  236. }
  237. }
  238. enum QuestionTypeEnum {
  239. placeHolder_0,
  240. Judge,
  241. SingleChoice,
  242. MultipleChoice,
  243. ShortAnswer,
  244. }
  245. class QuestionOptionDTO {
  246. String? code;
  247. String? content;
  248. bool trueOrFalse;
  249. QuestionOptionDTO({
  250. this.code,
  251. this.content,
  252. this.trueOrFalse = false,
  253. });
  254. factory QuestionOptionDTO.fromJson(Map<String, dynamic> map) {
  255. return QuestionOptionDTO(
  256. code: map['Code'],
  257. content: map['Content'],
  258. trueOrFalse: map['TrueOrFalse'],
  259. );
  260. }
  261. Map<String, dynamic> toJson() {
  262. final map = Map<String, dynamic>();
  263. if(code != null)
  264. map['Code'] = code;
  265. if(content != null)
  266. map['Content'] = content;
  267. map['TrueOrFalse'] = trueOrFalse;
  268. return map;
  269. }
  270. }
  271. class QuestionFileDTO {
  272. String? sourceUrl;
  273. String? previewImageUrl;
  274. String? coverImageUrl;
  275. DateTime? createTime;
  276. String? creatorCode;
  277. RemedicalFileDataTypeEnum fileDataType;
  278. QuestionFileDTO({
  279. this.sourceUrl,
  280. this.previewImageUrl,
  281. this.coverImageUrl,
  282. this.createTime,
  283. this.creatorCode,
  284. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  285. });
  286. factory QuestionFileDTO.fromJson(Map<String, dynamic> map) {
  287. return QuestionFileDTO(
  288. sourceUrl: map['SourceUrl'],
  289. previewImageUrl: map['PreviewImageUrl'],
  290. coverImageUrl: map['CoverImageUrl'],
  291. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  292. creatorCode: map['CreatorCode'],
  293. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  294. );
  295. }
  296. Map<String, dynamic> toJson() {
  297. final map = Map<String, dynamic>();
  298. if(sourceUrl != null)
  299. map['SourceUrl'] = sourceUrl;
  300. if(previewImageUrl != null)
  301. map['PreviewImageUrl'] = previewImageUrl;
  302. if(coverImageUrl != null)
  303. map['CoverImageUrl'] = coverImageUrl;
  304. if(createTime != null)
  305. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  306. if(creatorCode != null)
  307. map['CreatorCode'] = creatorCode;
  308. map['FileDataType'] = fileDataType.index;
  309. return map;
  310. }
  311. }
  312. class CourseExaminationQuestionDTO {
  313. String? code;
  314. String? stem;
  315. QuestionTypeEnum questionType;
  316. List<QuestionOptionDTO >? questionOptionList;
  317. List<QuestionFileDTO >? fileList;
  318. bool trueOrFalse;
  319. double score;
  320. CourseExaminationQuestionDTO({
  321. this.code,
  322. this.stem,
  323. this.questionType = QuestionTypeEnum.Judge,
  324. this.questionOptionList,
  325. this.fileList,
  326. this.trueOrFalse = false,
  327. this.score = 0,
  328. });
  329. factory CourseExaminationQuestionDTO.fromJson(Map<String, dynamic> map) {
  330. return CourseExaminationQuestionDTO(
  331. code: map['Code'],
  332. stem: map['Stem'],
  333. questionType: QuestionTypeEnum.values.firstWhere((e) => e.index == map['QuestionType']),
  334. questionOptionList: map['QuestionOptionList'] != null ? (map['QuestionOptionList'] as List).map((e)=>QuestionOptionDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  335. fileList: map['FileList'] != null ? (map['FileList'] as List).map((e)=>QuestionFileDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  336. trueOrFalse: map['TrueOrFalse'],
  337. score: double.parse(map['Score'].toString()),
  338. );
  339. }
  340. Map<String, dynamic> toJson() {
  341. final map = Map<String, dynamic>();
  342. if(code != null)
  343. map['Code'] = code;
  344. if(stem != null)
  345. map['Stem'] = stem;
  346. map['QuestionType'] = questionType.index;
  347. if(questionOptionList != null)
  348. map['QuestionOptionList'] = questionOptionList;
  349. if(fileList != null)
  350. map['FileList'] = fileList;
  351. map['TrueOrFalse'] = trueOrFalse;
  352. map['Score'] = score;
  353. return map;
  354. }
  355. }
  356. class CourseExaminationDTO extends BaseCourseExaminationDTO{
  357. List<CourseExaminationQuestionDTO >? questionList;
  358. int submitLimitCount;
  359. int passingScore;
  360. CourseExaminationDTO({
  361. this.questionList,
  362. this.submitLimitCount = 0,
  363. this.passingScore = 0,
  364. String? code,
  365. String? name,
  366. bool isRelease = false,
  367. CourseExaminationTypeEnum examinationType = CourseExaminationTypeEnum.Practice,
  368. DateTime? startTime,
  369. int examDuration = 0,
  370. double totalScore = 0,
  371. }) : super(
  372. code: code,
  373. name: name,
  374. isRelease: isRelease,
  375. examinationType: examinationType,
  376. startTime: startTime,
  377. examDuration: examDuration,
  378. totalScore: totalScore,
  379. );
  380. factory CourseExaminationDTO.fromJson(Map<String, dynamic> map) {
  381. return CourseExaminationDTO(
  382. questionList: map['QuestionList'] != null ? (map['QuestionList'] as List).map((e)=>CourseExaminationQuestionDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  383. submitLimitCount: map['SubmitLimitCount'],
  384. passingScore: map['PassingScore'],
  385. code: map['Code'],
  386. name: map['Name'],
  387. isRelease: map['IsRelease'],
  388. examinationType: CourseExaminationTypeEnum.values.firstWhere((e) => e.index == map['ExaminationType']),
  389. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  390. examDuration: map['ExamDuration'],
  391. totalScore: double.parse(map['TotalScore'].toString()),
  392. );
  393. }
  394. Map<String, dynamic> toJson() {
  395. final map = super.toJson();
  396. if(questionList != null)
  397. map['QuestionList'] = questionList;
  398. map['SubmitLimitCount'] = submitLimitCount;
  399. map['PassingScore'] = passingScore;
  400. return map;
  401. }
  402. }
  403. class ApplyCourseRequest extends TokenRequest{
  404. String? name;
  405. String? courseIntro;
  406. String? teacherCode;
  407. String? poster;
  408. DateTime? startTime;
  409. int duration;
  410. CourseTypeEnum courseType;
  411. CourseAudienceTypeEnum audienceType;
  412. String? coursewareToken;
  413. List<String >? caseLabelCodes;
  414. List<String >? courseLabelCodes;
  415. List<String >? userGroupCodes;
  416. Decimal? price;
  417. List<String >? courseVideoCodes;
  418. List<CourseExaminationDTO >? bindExams;
  419. List<String >? assistants;
  420. List<String >? experts;
  421. bool isAgentCourse;
  422. ApplyCourseRequest({
  423. this.name,
  424. this.courseIntro,
  425. this.teacherCode,
  426. this.poster,
  427. this.startTime,
  428. this.duration = 0,
  429. this.courseType = CourseTypeEnum.Unknown,
  430. this.audienceType = CourseAudienceTypeEnum.Unknown,
  431. this.coursewareToken,
  432. this.caseLabelCodes,
  433. this.courseLabelCodes,
  434. this.userGroupCodes,
  435. this.price,
  436. this.courseVideoCodes,
  437. this.bindExams,
  438. this.assistants,
  439. this.experts,
  440. this.isAgentCourse = false,
  441. String? token,
  442. }) : super(
  443. token: token,
  444. );
  445. factory ApplyCourseRequest.fromJson(Map<String, dynamic> map) {
  446. return ApplyCourseRequest(
  447. name: map['Name'],
  448. courseIntro: map['CourseIntro'],
  449. teacherCode: map['TeacherCode'],
  450. poster: map['Poster'],
  451. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  452. duration: map['Duration'],
  453. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  454. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  455. coursewareToken: map['CoursewareToken'],
  456. caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast<String>().toList() : null,
  457. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  458. userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast<String>().toList() : null,
  459. price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null,
  460. courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast<String>().toList() : null,
  461. bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  462. assistants: map['Assistants'] != null ? map['Assistants'].cast<String>().toList() : null,
  463. experts: map['Experts'] != null ? map['Experts'].cast<String>().toList() : null,
  464. isAgentCourse: map['IsAgentCourse'],
  465. token: map['Token'],
  466. );
  467. }
  468. Map<String, dynamic> toJson() {
  469. final map = super.toJson();
  470. if(name != null)
  471. map['Name'] = name;
  472. if(courseIntro != null)
  473. map['CourseIntro'] = courseIntro;
  474. if(teacherCode != null)
  475. map['TeacherCode'] = teacherCode;
  476. if(poster != null)
  477. map['Poster'] = poster;
  478. if(startTime != null)
  479. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  480. map['Duration'] = duration;
  481. map['CourseType'] = courseType.index;
  482. map['AudienceType'] = audienceType.index;
  483. if(coursewareToken != null)
  484. map['CoursewareToken'] = coursewareToken;
  485. if(caseLabelCodes != null)
  486. map['CaseLabelCodes'] = caseLabelCodes;
  487. if(courseLabelCodes != null)
  488. map['CourseLabelCodes'] = courseLabelCodes;
  489. if(userGroupCodes != null)
  490. map['UserGroupCodes'] = userGroupCodes;
  491. if(price != null)
  492. map['Price'] = price;
  493. if(courseVideoCodes != null)
  494. map['CourseVideoCodes'] = courseVideoCodes;
  495. if(bindExams != null)
  496. map['BindExams'] = bindExams;
  497. if(assistants != null)
  498. map['Assistants'] = assistants;
  499. if(experts != null)
  500. map['Experts'] = experts;
  501. map['IsAgentCourse'] = isAgentCourse;
  502. return map;
  503. }
  504. }
  505. class BaseCoursePageDTO {
  506. String? code;
  507. String? name;
  508. String? poster;
  509. DateTime? startTime;
  510. CourseStatusEnum status;
  511. String? teacherName;
  512. CourseTypeEnum courseType;
  513. CourseAudienceTypeEnum audienceType;
  514. int duration;
  515. Decimal? price;
  516. BaseCoursePageDTO({
  517. this.code,
  518. this.name,
  519. this.poster,
  520. this.startTime,
  521. this.status = CourseStatusEnum.Unknown,
  522. this.teacherName,
  523. this.courseType = CourseTypeEnum.Unknown,
  524. this.audienceType = CourseAudienceTypeEnum.Unknown,
  525. this.duration = 0,
  526. this.price,
  527. });
  528. factory BaseCoursePageDTO.fromJson(Map<String, dynamic> map) {
  529. return BaseCoursePageDTO(
  530. code: map['Code'],
  531. name: map['Name'],
  532. poster: map['Poster'],
  533. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  534. status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  535. teacherName: map['TeacherName'],
  536. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  537. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  538. duration: map['Duration'],
  539. price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null,
  540. );
  541. }
  542. Map<String, dynamic> toJson() {
  543. final map = Map<String, dynamic>();
  544. if(code != null)
  545. map['Code'] = code;
  546. if(name != null)
  547. map['Name'] = name;
  548. if(poster != null)
  549. map['Poster'] = poster;
  550. if(startTime != null)
  551. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  552. map['Status'] = status.index;
  553. if(teacherName != null)
  554. map['TeacherName'] = teacherName;
  555. map['CourseType'] = courseType.index;
  556. map['AudienceType'] = audienceType.index;
  557. map['Duration'] = duration;
  558. if(price != null)
  559. map['Price'] = price;
  560. return map;
  561. }
  562. }
  563. class CoursePageDTO extends BaseCoursePageDTO{
  564. CoursePageDTO({
  565. String? code,
  566. String? name,
  567. String? poster,
  568. DateTime? startTime,
  569. CourseStatusEnum status = CourseStatusEnum.Unknown,
  570. String? teacherName,
  571. CourseTypeEnum courseType = CourseTypeEnum.Unknown,
  572. CourseAudienceTypeEnum audienceType = CourseAudienceTypeEnum.Unknown,
  573. int duration = 0,
  574. Decimal? price,
  575. }) : super(
  576. code: code,
  577. name: name,
  578. poster: poster,
  579. startTime: startTime,
  580. status: status,
  581. teacherName: teacherName,
  582. courseType: courseType,
  583. audienceType: audienceType,
  584. duration: duration,
  585. price: price,
  586. );
  587. factory CoursePageDTO.fromJson(Map<String, dynamic> map) {
  588. return CoursePageDTO(
  589. code: map['Code'],
  590. name: map['Name'],
  591. poster: map['Poster'],
  592. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  593. status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  594. teacherName: map['TeacherName'],
  595. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  596. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  597. duration: map['Duration'],
  598. price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null,
  599. );
  600. }
  601. Map<String, dynamic> toJson() {
  602. final map = super.toJson();
  603. return map;
  604. }
  605. }
  606. class FindCoursePagesRequest extends PageRequest{
  607. String? keyword;
  608. List<String >? courseLabels;
  609. FindCoursePagesRequest({
  610. this.keyword,
  611. this.courseLabels,
  612. int pageIndex = 0,
  613. int pageSize = 0,
  614. String? token,
  615. }) : super(
  616. pageIndex: pageIndex,
  617. pageSize: pageSize,
  618. token: token,
  619. );
  620. factory FindCoursePagesRequest.fromJson(Map<String, dynamic> map) {
  621. return FindCoursePagesRequest(
  622. keyword: map['Keyword'],
  623. courseLabels: map['CourseLabels'] != null ? map['CourseLabels'].cast<String>().toList() : null,
  624. pageIndex: map['PageIndex'],
  625. pageSize: map['PageSize'],
  626. token: map['Token'],
  627. );
  628. }
  629. Map<String, dynamic> toJson() {
  630. final map = super.toJson();
  631. if(keyword != null)
  632. map['Keyword'] = keyword;
  633. if(courseLabels != null)
  634. map['CourseLabels'] = courseLabels;
  635. return map;
  636. }
  637. }
  638. class DeleteCourseByCodeRequest extends TokenRequest{
  639. String? code;
  640. DeleteCourseByCodeRequest({
  641. this.code,
  642. String? token,
  643. }) : super(
  644. token: token,
  645. );
  646. factory DeleteCourseByCodeRequest.fromJson(Map<String, dynamic> map) {
  647. return DeleteCourseByCodeRequest(
  648. code: map['Code'],
  649. token: map['Token'],
  650. );
  651. }
  652. Map<String, dynamic> toJson() {
  653. final map = super.toJson();
  654. if(code != null)
  655. map['Code'] = code;
  656. return map;
  657. }
  658. }
  659. class UpdateCourseRequest extends TokenRequest{
  660. String? code;
  661. String? name;
  662. String? courseIntro;
  663. String? teacherCode;
  664. String? poster;
  665. DateTime? startTime;
  666. int duration;
  667. CourseTypeEnum courseType;
  668. CourseAudienceTypeEnum audienceType;
  669. String? coursewareToken;
  670. List<String >? caseLabelCodes;
  671. List<String >? courseLabelCodes;
  672. List<String >? userGroupCodes;
  673. Decimal? price;
  674. List<String >? courseVideoCodes;
  675. List<CourseExaminationDTO >? bindExams;
  676. List<String >? assistants;
  677. List<String >? experts;
  678. bool isAgentCourse;
  679. UpdateCourseRequest({
  680. this.code,
  681. this.name,
  682. this.courseIntro,
  683. this.teacherCode,
  684. this.poster,
  685. this.startTime,
  686. this.duration = 0,
  687. this.courseType = CourseTypeEnum.Unknown,
  688. this.audienceType = CourseAudienceTypeEnum.Unknown,
  689. this.coursewareToken,
  690. this.caseLabelCodes,
  691. this.courseLabelCodes,
  692. this.userGroupCodes,
  693. this.price,
  694. this.courseVideoCodes,
  695. this.bindExams,
  696. this.assistants,
  697. this.experts,
  698. this.isAgentCourse = false,
  699. String? token,
  700. }) : super(
  701. token: token,
  702. );
  703. factory UpdateCourseRequest.fromJson(Map<String, dynamic> map) {
  704. return UpdateCourseRequest(
  705. code: map['Code'],
  706. name: map['Name'],
  707. courseIntro: map['CourseIntro'],
  708. teacherCode: map['TeacherCode'],
  709. poster: map['Poster'],
  710. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  711. duration: map['Duration'],
  712. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  713. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  714. coursewareToken: map['CoursewareToken'],
  715. caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast<String>().toList() : null,
  716. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  717. userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast<String>().toList() : null,
  718. price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null,
  719. courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast<String>().toList() : null,
  720. bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  721. assistants: map['Assistants'] != null ? map['Assistants'].cast<String>().toList() : null,
  722. experts: map['Experts'] != null ? map['Experts'].cast<String>().toList() : null,
  723. isAgentCourse: map['IsAgentCourse'],
  724. token: map['Token'],
  725. );
  726. }
  727. Map<String, dynamic> toJson() {
  728. final map = super.toJson();
  729. if(code != null)
  730. map['Code'] = code;
  731. if(name != null)
  732. map['Name'] = name;
  733. if(courseIntro != null)
  734. map['CourseIntro'] = courseIntro;
  735. if(teacherCode != null)
  736. map['TeacherCode'] = teacherCode;
  737. if(poster != null)
  738. map['Poster'] = poster;
  739. if(startTime != null)
  740. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  741. map['Duration'] = duration;
  742. map['CourseType'] = courseType.index;
  743. map['AudienceType'] = audienceType.index;
  744. if(coursewareToken != null)
  745. map['CoursewareToken'] = coursewareToken;
  746. if(caseLabelCodes != null)
  747. map['CaseLabelCodes'] = caseLabelCodes;
  748. if(courseLabelCodes != null)
  749. map['CourseLabelCodes'] = courseLabelCodes;
  750. if(userGroupCodes != null)
  751. map['UserGroupCodes'] = userGroupCodes;
  752. if(price != null)
  753. map['Price'] = price;
  754. if(courseVideoCodes != null)
  755. map['CourseVideoCodes'] = courseVideoCodes;
  756. if(bindExams != null)
  757. map['BindExams'] = bindExams;
  758. if(assistants != null)
  759. map['Assistants'] = assistants;
  760. if(experts != null)
  761. map['Experts'] = experts;
  762. map['IsAgentCourse'] = isAgentCourse;
  763. return map;
  764. }
  765. }
  766. enum CourseViewRangeEnum {
  767. All,
  768. Domestic,
  769. Overseas,
  770. }
  771. enum StudentCourseStatusEnum {
  772. All,
  773. SignUp,
  774. NoSignUp,
  775. Joined,
  776. Ended,
  777. }
  778. class StudentInfoDTO {
  779. String? code;
  780. String? name;
  781. String? phone;
  782. bool isPay;
  783. StudentCourseStatusEnum signCourseStatus;
  784. StudentInfoDTO({
  785. this.code,
  786. this.name,
  787. this.phone,
  788. this.isPay = false,
  789. this.signCourseStatus = StudentCourseStatusEnum.All,
  790. });
  791. factory StudentInfoDTO.fromJson(Map<String, dynamic> map) {
  792. return StudentInfoDTO(
  793. code: map['Code'],
  794. name: map['Name'],
  795. phone: map['Phone'],
  796. isPay: map['IsPay'],
  797. signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']),
  798. );
  799. }
  800. Map<String, dynamic> toJson() {
  801. final map = Map<String, dynamic>();
  802. if(code != null)
  803. map['Code'] = code;
  804. if(name != null)
  805. map['Name'] = name;
  806. if(phone != null)
  807. map['Phone'] = phone;
  808. map['IsPay'] = isPay;
  809. map['SignCourseStatus'] = signCourseStatus.index;
  810. return map;
  811. }
  812. }
  813. class BaseCourseInfoDTO {
  814. String? code;
  815. String? name;
  816. String? courseIntro;
  817. String? teacherCode;
  818. String? teacherName;
  819. String? poster;
  820. DateTime? startTime;
  821. int duration;
  822. CourseTypeEnum courseType;
  823. CourseAudienceTypeEnum audienceType;
  824. String? coursewareToken;
  825. CourseStatusEnum status;
  826. CourseViewRangeEnum viewRange;
  827. String? creatorCode;
  828. String? organizationCode;
  829. DateTime? createTime;
  830. Decimal? price;
  831. List<String >? courseLabelCodes;
  832. List<String >? caseLabelCodes;
  833. List<String >? userGroupCodes;
  834. List<String >? courseVideoCodes;
  835. List<CourseExaminationDTO >? bindExams;
  836. List<StudentInfoDTO >? assistants;
  837. List<StudentInfoDTO >? experts;
  838. bool isAgentCourse;
  839. BaseCourseInfoDTO({
  840. this.code,
  841. this.name,
  842. this.courseIntro,
  843. this.teacherCode,
  844. this.teacherName,
  845. this.poster,
  846. this.startTime,
  847. this.duration = 0,
  848. this.courseType = CourseTypeEnum.Unknown,
  849. this.audienceType = CourseAudienceTypeEnum.Unknown,
  850. this.coursewareToken,
  851. this.status = CourseStatusEnum.Unknown,
  852. this.viewRange = CourseViewRangeEnum.All,
  853. this.creatorCode,
  854. this.organizationCode,
  855. this.createTime,
  856. this.price,
  857. this.courseLabelCodes,
  858. this.caseLabelCodes,
  859. this.userGroupCodes,
  860. this.courseVideoCodes,
  861. this.bindExams,
  862. this.assistants,
  863. this.experts,
  864. this.isAgentCourse = false,
  865. });
  866. factory BaseCourseInfoDTO.fromJson(Map<String, dynamic> map) {
  867. return BaseCourseInfoDTO(
  868. code: map['Code'],
  869. name: map['Name'],
  870. courseIntro: map['CourseIntro'],
  871. teacherCode: map['TeacherCode'],
  872. teacherName: map['TeacherName'],
  873. poster: map['Poster'],
  874. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  875. duration: map['Duration'],
  876. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  877. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  878. coursewareToken: map['CoursewareToken'],
  879. status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  880. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  881. creatorCode: map['CreatorCode'],
  882. organizationCode: map['OrganizationCode'],
  883. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  884. price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null,
  885. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  886. caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast<String>().toList() : null,
  887. userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast<String>().toList() : null,
  888. courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast<String>().toList() : null,
  889. bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  890. assistants: map['Assistants'] != null ? (map['Assistants'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  891. experts: map['Experts'] != null ? (map['Experts'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  892. isAgentCourse: map['IsAgentCourse'],
  893. );
  894. }
  895. Map<String, dynamic> toJson() {
  896. final map = Map<String, dynamic>();
  897. if(code != null)
  898. map['Code'] = code;
  899. if(name != null)
  900. map['Name'] = name;
  901. if(courseIntro != null)
  902. map['CourseIntro'] = courseIntro;
  903. if(teacherCode != null)
  904. map['TeacherCode'] = teacherCode;
  905. if(teacherName != null)
  906. map['TeacherName'] = teacherName;
  907. if(poster != null)
  908. map['Poster'] = poster;
  909. if(startTime != null)
  910. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  911. map['Duration'] = duration;
  912. map['CourseType'] = courseType.index;
  913. map['AudienceType'] = audienceType.index;
  914. if(coursewareToken != null)
  915. map['CoursewareToken'] = coursewareToken;
  916. map['Status'] = status.index;
  917. map['ViewRange'] = viewRange.index;
  918. if(creatorCode != null)
  919. map['CreatorCode'] = creatorCode;
  920. if(organizationCode != null)
  921. map['OrganizationCode'] = organizationCode;
  922. if(createTime != null)
  923. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  924. if(price != null)
  925. map['Price'] = price;
  926. if(courseLabelCodes != null)
  927. map['CourseLabelCodes'] = courseLabelCodes;
  928. if(caseLabelCodes != null)
  929. map['CaseLabelCodes'] = caseLabelCodes;
  930. if(userGroupCodes != null)
  931. map['UserGroupCodes'] = userGroupCodes;
  932. if(courseVideoCodes != null)
  933. map['CourseVideoCodes'] = courseVideoCodes;
  934. if(bindExams != null)
  935. map['BindExams'] = bindExams;
  936. if(assistants != null)
  937. map['Assistants'] = assistants;
  938. if(experts != null)
  939. map['Experts'] = experts;
  940. map['IsAgentCourse'] = isAgentCourse;
  941. return map;
  942. }
  943. }
  944. class BaseUserGroupDTO extends BaseDTO{
  945. String? code;
  946. String? name;
  947. BaseUserGroupDTO({
  948. this.code,
  949. this.name,
  950. DateTime? createTime,
  951. DateTime? updateTime,
  952. }) : super(
  953. createTime: createTime,
  954. updateTime: updateTime,
  955. );
  956. factory BaseUserGroupDTO.fromJson(Map<String, dynamic> map) {
  957. return BaseUserGroupDTO(
  958. code: map['Code'],
  959. name: map['Name'],
  960. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  961. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  962. );
  963. }
  964. Map<String, dynamic> toJson() {
  965. final map = super.toJson();
  966. if(code != null)
  967. map['Code'] = code;
  968. if(name != null)
  969. map['Name'] = name;
  970. return map;
  971. }
  972. }
  973. class VideoInfoDTO {
  974. String? code;
  975. String? name;
  976. String? videoToken;
  977. String? poster;
  978. String? vodFileId;
  979. int duration;
  980. double videoSize;
  981. DateTime? createTime;
  982. VideoInfoDTO({
  983. this.code,
  984. this.name,
  985. this.videoToken,
  986. this.poster,
  987. this.vodFileId,
  988. this.duration = 0,
  989. this.videoSize = 0,
  990. this.createTime,
  991. });
  992. factory VideoInfoDTO.fromJson(Map<String, dynamic> map) {
  993. return VideoInfoDTO(
  994. code: map['Code'],
  995. name: map['Name'],
  996. videoToken: map['VideoToken'],
  997. poster: map['Poster'],
  998. vodFileId: map['VodFileId'],
  999. duration: map['Duration'],
  1000. videoSize: double.parse(map['VideoSize'].toString()),
  1001. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1002. );
  1003. }
  1004. Map<String, dynamic> toJson() {
  1005. final map = Map<String, dynamic>();
  1006. if(code != null)
  1007. map['Code'] = code;
  1008. if(name != null)
  1009. map['Name'] = name;
  1010. if(videoToken != null)
  1011. map['VideoToken'] = videoToken;
  1012. if(poster != null)
  1013. map['Poster'] = poster;
  1014. if(vodFileId != null)
  1015. map['VodFileId'] = vodFileId;
  1016. map['Duration'] = duration;
  1017. map['VideoSize'] = videoSize;
  1018. if(createTime != null)
  1019. map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
  1020. return map;
  1021. }
  1022. }
  1023. class CourseInfoDetailDTO extends BaseCourseInfoDTO{
  1024. List<StudentInfoDTO >? students;
  1025. List<BaseLabelInfoDTO >? caseLabels;
  1026. List<BaseLabelInfoDTO >? courseLabels;
  1027. List<BaseUserGroupDTO >? userGroups;
  1028. List<VideoInfoDTO >? courseVideos;
  1029. bool needPay;
  1030. StudentCourseStatusEnum signCourseStatus;
  1031. bool isPay;
  1032. CourseInfoDetailDTO({
  1033. this.students,
  1034. this.caseLabels,
  1035. this.courseLabels,
  1036. this.userGroups,
  1037. this.courseVideos,
  1038. this.needPay = false,
  1039. this.signCourseStatus = StudentCourseStatusEnum.All,
  1040. this.isPay = false,
  1041. String? code,
  1042. String? name,
  1043. String? courseIntro,
  1044. String? teacherCode,
  1045. String? teacherName,
  1046. String? poster,
  1047. DateTime? startTime,
  1048. int duration = 0,
  1049. CourseTypeEnum courseType = CourseTypeEnum.Unknown,
  1050. CourseAudienceTypeEnum audienceType = CourseAudienceTypeEnum.Unknown,
  1051. String? coursewareToken,
  1052. CourseStatusEnum status = CourseStatusEnum.Unknown,
  1053. CourseViewRangeEnum viewRange = CourseViewRangeEnum.All,
  1054. String? creatorCode,
  1055. String? organizationCode,
  1056. DateTime? createTime,
  1057. Decimal? price,
  1058. List<String >? courseLabelCodes,
  1059. List<String >? caseLabelCodes,
  1060. List<String >? userGroupCodes,
  1061. List<String >? courseVideoCodes,
  1062. List<CourseExaminationDTO >? bindExams,
  1063. List<StudentInfoDTO >? assistants,
  1064. List<StudentInfoDTO >? experts,
  1065. bool isAgentCourse = false,
  1066. }) : super(
  1067. code: code,
  1068. name: name,
  1069. courseIntro: courseIntro,
  1070. teacherCode: teacherCode,
  1071. teacherName: teacherName,
  1072. poster: poster,
  1073. startTime: startTime,
  1074. duration: duration,
  1075. courseType: courseType,
  1076. audienceType: audienceType,
  1077. coursewareToken: coursewareToken,
  1078. status: status,
  1079. viewRange: viewRange,
  1080. creatorCode: creatorCode,
  1081. organizationCode: organizationCode,
  1082. createTime: createTime,
  1083. price: price,
  1084. courseLabelCodes: courseLabelCodes,
  1085. caseLabelCodes: caseLabelCodes,
  1086. userGroupCodes: userGroupCodes,
  1087. courseVideoCodes: courseVideoCodes,
  1088. bindExams: bindExams,
  1089. assistants: assistants,
  1090. experts: experts,
  1091. isAgentCourse: isAgentCourse,
  1092. );
  1093. factory CourseInfoDetailDTO.fromJson(Map<String, dynamic> map) {
  1094. return CourseInfoDetailDTO(
  1095. students: map['Students'] != null ? (map['Students'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1096. caseLabels: map['CaseLabels'] != null ? (map['CaseLabels'] as List).map((e)=>BaseLabelInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1097. courseLabels: map['CourseLabels'] != null ? (map['CourseLabels'] as List).map((e)=>BaseLabelInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1098. userGroups: map['UserGroups'] != null ? (map['UserGroups'] as List).map((e)=>BaseUserGroupDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1099. courseVideos: map['CourseVideos'] != null ? (map['CourseVideos'] as List).map((e)=>VideoInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1100. needPay: map['NeedPay'],
  1101. signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']),
  1102. isPay: map['IsPay'],
  1103. code: map['Code'],
  1104. name: map['Name'],
  1105. courseIntro: map['CourseIntro'],
  1106. teacherCode: map['TeacherCode'],
  1107. teacherName: map['TeacherName'],
  1108. poster: map['Poster'],
  1109. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1110. duration: map['Duration'],
  1111. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  1112. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  1113. coursewareToken: map['CoursewareToken'],
  1114. status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  1115. viewRange: CourseViewRangeEnum.values.firstWhere((e) => e.index == map['ViewRange']),
  1116. creatorCode: map['CreatorCode'],
  1117. organizationCode: map['OrganizationCode'],
  1118. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1119. price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null,
  1120. courseLabelCodes: map['CourseLabelCodes'] != null ? map['CourseLabelCodes'].cast<String>().toList() : null,
  1121. caseLabelCodes: map['CaseLabelCodes'] != null ? map['CaseLabelCodes'].cast<String>().toList() : null,
  1122. userGroupCodes: map['UserGroupCodes'] != null ? map['UserGroupCodes'].cast<String>().toList() : null,
  1123. courseVideoCodes: map['CourseVideoCodes'] != null ? map['CourseVideoCodes'].cast<String>().toList() : null,
  1124. bindExams: map['BindExams'] != null ? (map['BindExams'] as List).map((e)=>CourseExaminationDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1125. assistants: map['Assistants'] != null ? (map['Assistants'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1126. experts: map['Experts'] != null ? (map['Experts'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1127. isAgentCourse: map['IsAgentCourse'],
  1128. );
  1129. }
  1130. Map<String, dynamic> toJson() {
  1131. final map = super.toJson();
  1132. if(students != null)
  1133. map['Students'] = students;
  1134. if(caseLabels != null)
  1135. map['CaseLabels'] = caseLabels;
  1136. if(courseLabels != null)
  1137. map['CourseLabels'] = courseLabels;
  1138. if(userGroups != null)
  1139. map['UserGroups'] = userGroups;
  1140. if(courseVideos != null)
  1141. map['CourseVideos'] = courseVideos;
  1142. map['NeedPay'] = needPay;
  1143. map['SignCourseStatus'] = signCourseStatus.index;
  1144. map['IsPay'] = isPay;
  1145. return map;
  1146. }
  1147. }
  1148. class FindCourseByCodeRequest extends TokenRequest{
  1149. String? code;
  1150. String? languageCode;
  1151. FindCourseByCodeRequest({
  1152. this.code,
  1153. this.languageCode,
  1154. String? token,
  1155. }) : super(
  1156. token: token,
  1157. );
  1158. factory FindCourseByCodeRequest.fromJson(Map<String, dynamic> map) {
  1159. return FindCourseByCodeRequest(
  1160. code: map['Code'],
  1161. languageCode: map['LanguageCode'],
  1162. token: map['Token'],
  1163. );
  1164. }
  1165. Map<String, dynamic> toJson() {
  1166. final map = super.toJson();
  1167. if(code != null)
  1168. map['Code'] = code;
  1169. if(languageCode != null)
  1170. map['LanguageCode'] = languageCode;
  1171. return map;
  1172. }
  1173. }
  1174. class StudentInCoursePageDTO extends BaseCoursePageDTO{
  1175. StudentCourseStatusEnum signCourseStatus;
  1176. bool isPay;
  1177. StudentInCoursePageDTO({
  1178. this.signCourseStatus = StudentCourseStatusEnum.All,
  1179. this.isPay = false,
  1180. String? code,
  1181. String? name,
  1182. String? poster,
  1183. DateTime? startTime,
  1184. CourseStatusEnum status = CourseStatusEnum.Unknown,
  1185. String? teacherName,
  1186. CourseTypeEnum courseType = CourseTypeEnum.Unknown,
  1187. CourseAudienceTypeEnum audienceType = CourseAudienceTypeEnum.Unknown,
  1188. int duration = 0,
  1189. Decimal? price,
  1190. }) : super(
  1191. code: code,
  1192. name: name,
  1193. poster: poster,
  1194. startTime: startTime,
  1195. status: status,
  1196. teacherName: teacherName,
  1197. courseType: courseType,
  1198. audienceType: audienceType,
  1199. duration: duration,
  1200. price: price,
  1201. );
  1202. factory StudentInCoursePageDTO.fromJson(Map<String, dynamic> map) {
  1203. return StudentInCoursePageDTO(
  1204. signCourseStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['SignCourseStatus']),
  1205. isPay: map['IsPay'],
  1206. code: map['Code'],
  1207. name: map['Name'],
  1208. poster: map['Poster'],
  1209. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1210. status: CourseStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  1211. teacherName: map['TeacherName'],
  1212. courseType: CourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  1213. audienceType: CourseAudienceTypeEnum.values.firstWhere((e) => e.index == map['AudienceType']),
  1214. duration: map['Duration'],
  1215. price: map['Price'] != null ? Decimal.fromJson(map['Price']) : null,
  1216. );
  1217. }
  1218. Map<String, dynamic> toJson() {
  1219. final map = super.toJson();
  1220. map['SignCourseStatus'] = signCourseStatus.index;
  1221. map['IsPay'] = isPay;
  1222. return map;
  1223. }
  1224. }
  1225. enum QueryCourseSortEnum {
  1226. StartTime,
  1227. Recommended,
  1228. }
  1229. enum QueryCourseTypeEnum {
  1230. All,
  1231. LiveCourse,
  1232. VideoCourse,
  1233. }
  1234. class FindStudentInCoursePagesRequest extends PageRequest{
  1235. String? keyword;
  1236. StudentCourseStatusEnum queryStatus;
  1237. DateTime? startTime;
  1238. QueryCourseSortEnum queryCourseSort;
  1239. QueryCourseTypeEnum courseType;
  1240. FindStudentInCoursePagesRequest({
  1241. this.keyword,
  1242. this.queryStatus = StudentCourseStatusEnum.All,
  1243. this.startTime,
  1244. this.queryCourseSort = QueryCourseSortEnum.StartTime,
  1245. this.courseType = QueryCourseTypeEnum.All,
  1246. int pageIndex = 0,
  1247. int pageSize = 0,
  1248. String? token,
  1249. }) : super(
  1250. pageIndex: pageIndex,
  1251. pageSize: pageSize,
  1252. token: token,
  1253. );
  1254. factory FindStudentInCoursePagesRequest.fromJson(Map<String, dynamic> map) {
  1255. return FindStudentInCoursePagesRequest(
  1256. keyword: map['Keyword'],
  1257. queryStatus: StudentCourseStatusEnum.values.firstWhere((e) => e.index == map['QueryStatus']),
  1258. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1259. queryCourseSort: QueryCourseSortEnum.values.firstWhere((e) => e.index == map['QueryCourseSort']),
  1260. courseType: QueryCourseTypeEnum.values.firstWhere((e) => e.index == map['CourseType']),
  1261. pageIndex: map['PageIndex'],
  1262. pageSize: map['PageSize'],
  1263. token: map['Token'],
  1264. );
  1265. }
  1266. Map<String, dynamic> toJson() {
  1267. final map = super.toJson();
  1268. if(keyword != null)
  1269. map['Keyword'] = keyword;
  1270. map['QueryStatus'] = queryStatus.index;
  1271. if(startTime != null)
  1272. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1273. map['QueryCourseSort'] = queryCourseSort.index;
  1274. map['CourseType'] = courseType.index;
  1275. return map;
  1276. }
  1277. }
  1278. class UserGroupDTO extends BaseUserGroupDTO{
  1279. int maxPeople;
  1280. String? creatorCode;
  1281. String? creatorName;
  1282. List<StudentInfoDTO >? students;
  1283. UserGroupDTO({
  1284. this.maxPeople = 0,
  1285. this.creatorCode,
  1286. this.creatorName,
  1287. this.students,
  1288. String? code,
  1289. String? name,
  1290. DateTime? createTime,
  1291. DateTime? updateTime,
  1292. }) : super(
  1293. code: code,
  1294. name: name,
  1295. createTime: createTime,
  1296. updateTime: updateTime,
  1297. );
  1298. factory UserGroupDTO.fromJson(Map<String, dynamic> map) {
  1299. return UserGroupDTO(
  1300. maxPeople: map['MaxPeople'],
  1301. creatorCode: map['CreatorCode'],
  1302. creatorName: map['CreatorName'],
  1303. students: map['Students'] != null ? (map['Students'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1304. code: map['Code'],
  1305. name: map['Name'],
  1306. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1307. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  1308. );
  1309. }
  1310. Map<String, dynamic> toJson() {
  1311. final map = super.toJson();
  1312. map['MaxPeople'] = maxPeople;
  1313. if(creatorCode != null)
  1314. map['CreatorCode'] = creatorCode;
  1315. if(creatorName != null)
  1316. map['CreatorName'] = creatorName;
  1317. if(students != null)
  1318. map['Students'] = students;
  1319. return map;
  1320. }
  1321. }
  1322. class UserGroupRequest extends TokenRequest{
  1323. String? code;
  1324. String? name;
  1325. int maxPeople;
  1326. String? creatorCode;
  1327. List<StudentInfoDTO >? students;
  1328. List<String >? removeStudentCodes;
  1329. UserGroupRequest({
  1330. this.code,
  1331. this.name,
  1332. this.maxPeople = 0,
  1333. this.creatorCode,
  1334. this.students,
  1335. this.removeStudentCodes,
  1336. String? token,
  1337. }) : super(
  1338. token: token,
  1339. );
  1340. factory UserGroupRequest.fromJson(Map<String, dynamic> map) {
  1341. return UserGroupRequest(
  1342. code: map['Code'],
  1343. name: map['Name'],
  1344. maxPeople: map['MaxPeople'],
  1345. creatorCode: map['CreatorCode'],
  1346. students: map['Students'] != null ? (map['Students'] as List).map((e)=>StudentInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1347. removeStudentCodes: map['RemoveStudentCodes'] != null ? map['RemoveStudentCodes'].cast<String>().toList() : null,
  1348. token: map['Token'],
  1349. );
  1350. }
  1351. Map<String, dynamic> toJson() {
  1352. final map = super.toJson();
  1353. if(code != null)
  1354. map['Code'] = code;
  1355. if(name != null)
  1356. map['Name'] = name;
  1357. map['MaxPeople'] = maxPeople;
  1358. if(creatorCode != null)
  1359. map['CreatorCode'] = creatorCode;
  1360. if(students != null)
  1361. map['Students'] = students;
  1362. if(removeStudentCodes != null)
  1363. map['RemoveStudentCodes'] = removeStudentCodes;
  1364. return map;
  1365. }
  1366. }
  1367. class QueryStudentByGroupCodePageRequest extends PageRequest{
  1368. String? keyword;
  1369. String? userGroupCode;
  1370. QueryStudentByGroupCodePageRequest({
  1371. this.keyword,
  1372. this.userGroupCode,
  1373. int pageIndex = 0,
  1374. int pageSize = 0,
  1375. String? token,
  1376. }) : super(
  1377. pageIndex: pageIndex,
  1378. pageSize: pageSize,
  1379. token: token,
  1380. );
  1381. factory QueryStudentByGroupCodePageRequest.fromJson(Map<String, dynamic> map) {
  1382. return QueryStudentByGroupCodePageRequest(
  1383. keyword: map['Keyword'],
  1384. userGroupCode: map['UserGroupCode'],
  1385. pageIndex: map['PageIndex'],
  1386. pageSize: map['PageSize'],
  1387. token: map['Token'],
  1388. );
  1389. }
  1390. Map<String, dynamic> toJson() {
  1391. final map = super.toJson();
  1392. if(keyword != null)
  1393. map['Keyword'] = keyword;
  1394. if(userGroupCode != null)
  1395. map['UserGroupCode'] = userGroupCode;
  1396. return map;
  1397. }
  1398. }
  1399. class UserGroupFilterRequest extends TokenRequest{
  1400. String? userGroupCode;
  1401. String? creatorCode;
  1402. String? keyword;
  1403. List<String >? studentCodes;
  1404. UserGroupFilterRequest({
  1405. this.userGroupCode,
  1406. this.creatorCode,
  1407. this.keyword,
  1408. this.studentCodes,
  1409. String? token,
  1410. }) : super(
  1411. token: token,
  1412. );
  1413. factory UserGroupFilterRequest.fromJson(Map<String, dynamic> map) {
  1414. return UserGroupFilterRequest(
  1415. userGroupCode: map['UserGroupCode'],
  1416. creatorCode: map['CreatorCode'],
  1417. keyword: map['Keyword'],
  1418. studentCodes: map['StudentCodes'] != null ? map['StudentCodes'].cast<String>().toList() : null,
  1419. token: map['Token'],
  1420. );
  1421. }
  1422. Map<String, dynamic> toJson() {
  1423. final map = super.toJson();
  1424. if(userGroupCode != null)
  1425. map['UserGroupCode'] = userGroupCode;
  1426. if(creatorCode != null)
  1427. map['CreatorCode'] = creatorCode;
  1428. if(keyword != null)
  1429. map['Keyword'] = keyword;
  1430. if(studentCodes != null)
  1431. map['StudentCodes'] = studentCodes;
  1432. return map;
  1433. }
  1434. }
  1435. class SaveVideoRequest extends TokenRequest{
  1436. String? courseCode;
  1437. String? code;
  1438. String? name;
  1439. String? videoToken;
  1440. String? vodFileId;
  1441. String? poster;
  1442. int duration;
  1443. double videoSize;
  1444. SaveVideoRequest({
  1445. this.courseCode,
  1446. this.code,
  1447. this.name,
  1448. this.videoToken,
  1449. this.vodFileId,
  1450. this.poster,
  1451. this.duration = 0,
  1452. this.videoSize = 0,
  1453. String? token,
  1454. }) : super(
  1455. token: token,
  1456. );
  1457. factory SaveVideoRequest.fromJson(Map<String, dynamic> map) {
  1458. return SaveVideoRequest(
  1459. courseCode: map['CourseCode'],
  1460. code: map['Code'],
  1461. name: map['Name'],
  1462. videoToken: map['VideoToken'],
  1463. vodFileId: map['VodFileId'],
  1464. poster: map['Poster'],
  1465. duration: map['Duration'],
  1466. videoSize: double.parse(map['VideoSize'].toString()),
  1467. token: map['Token'],
  1468. );
  1469. }
  1470. Map<String, dynamic> toJson() {
  1471. final map = super.toJson();
  1472. if(courseCode != null)
  1473. map['CourseCode'] = courseCode;
  1474. if(code != null)
  1475. map['Code'] = code;
  1476. if(name != null)
  1477. map['Name'] = name;
  1478. if(videoToken != null)
  1479. map['VideoToken'] = videoToken;
  1480. if(vodFileId != null)
  1481. map['VodFileId'] = vodFileId;
  1482. if(poster != null)
  1483. map['Poster'] = poster;
  1484. map['Duration'] = duration;
  1485. map['VideoSize'] = videoSize;
  1486. return map;
  1487. }
  1488. }
  1489. class FindVideoPagesRequest extends PageRequest{
  1490. String? keyword;
  1491. String? courseCode;
  1492. FindVideoPagesRequest({
  1493. this.keyword,
  1494. this.courseCode,
  1495. int pageIndex = 0,
  1496. int pageSize = 0,
  1497. String? token,
  1498. }) : super(
  1499. pageIndex: pageIndex,
  1500. pageSize: pageSize,
  1501. token: token,
  1502. );
  1503. factory FindVideoPagesRequest.fromJson(Map<String, dynamic> map) {
  1504. return FindVideoPagesRequest(
  1505. keyword: map['Keyword'],
  1506. courseCode: map['CourseCode'],
  1507. pageIndex: map['PageIndex'],
  1508. pageSize: map['PageSize'],
  1509. token: map['Token'],
  1510. );
  1511. }
  1512. Map<String, dynamic> toJson() {
  1513. final map = super.toJson();
  1514. if(keyword != null)
  1515. map['Keyword'] = keyword;
  1516. if(courseCode != null)
  1517. map['CourseCode'] = courseCode;
  1518. return map;
  1519. }
  1520. }
  1521. class DeleteVideoRequest extends TokenRequest{
  1522. String? code;
  1523. String? courseCode;
  1524. DeleteVideoRequest({
  1525. this.code,
  1526. this.courseCode,
  1527. String? token,
  1528. }) : super(
  1529. token: token,
  1530. );
  1531. factory DeleteVideoRequest.fromJson(Map<String, dynamic> map) {
  1532. return DeleteVideoRequest(
  1533. code: map['Code'],
  1534. courseCode: map['CourseCode'],
  1535. token: map['Token'],
  1536. );
  1537. }
  1538. Map<String, dynamic> toJson() {
  1539. final map = super.toJson();
  1540. if(code != null)
  1541. map['Code'] = code;
  1542. if(courseCode != null)
  1543. map['CourseCode'] = courseCode;
  1544. return map;
  1545. }
  1546. }
  1547. class BuyCourseResult {
  1548. String? courseCode;
  1549. String? paymentOrderCode;
  1550. String? orderTitle;
  1551. double orderAmount;
  1552. String? payUrl;
  1553. BuyCourseResult({
  1554. this.courseCode,
  1555. this.paymentOrderCode,
  1556. this.orderTitle,
  1557. this.orderAmount = 0,
  1558. this.payUrl,
  1559. });
  1560. factory BuyCourseResult.fromJson(Map<String, dynamic> map) {
  1561. return BuyCourseResult(
  1562. courseCode: map['CourseCode'],
  1563. paymentOrderCode: map['PaymentOrderCode'],
  1564. orderTitle: map['OrderTitle'],
  1565. orderAmount: double.parse(map['OrderAmount'].toString()),
  1566. payUrl: map['PayUrl'],
  1567. );
  1568. }
  1569. Map<String, dynamic> toJson() {
  1570. final map = Map<String, dynamic>();
  1571. if(courseCode != null)
  1572. map['CourseCode'] = courseCode;
  1573. if(paymentOrderCode != null)
  1574. map['PaymentOrderCode'] = paymentOrderCode;
  1575. if(orderTitle != null)
  1576. map['OrderTitle'] = orderTitle;
  1577. map['OrderAmount'] = orderAmount;
  1578. if(payUrl != null)
  1579. map['PayUrl'] = payUrl;
  1580. return map;
  1581. }
  1582. }
  1583. enum PayTypeEnum {
  1584. Alipay_PAGE,
  1585. Alipay_WAP,
  1586. WeChat_PAGE,
  1587. WeChat_WAP,
  1588. Paypal,
  1589. }
  1590. class BuyCourseRequest extends TokenRequest{
  1591. String? courseCode;
  1592. int quantity;
  1593. PayTypeEnum payType;
  1594. BuyCourseRequest({
  1595. this.courseCode,
  1596. this.quantity = 0,
  1597. this.payType = PayTypeEnum.Alipay_PAGE,
  1598. String? token,
  1599. }) : super(
  1600. token: token,
  1601. );
  1602. factory BuyCourseRequest.fromJson(Map<String, dynamic> map) {
  1603. return BuyCourseRequest(
  1604. courseCode: map['CourseCode'],
  1605. quantity: map['Quantity'],
  1606. payType: PayTypeEnum.values.firstWhere((e) => e.index == map['PayType']),
  1607. token: map['Token'],
  1608. );
  1609. }
  1610. Map<String, dynamic> toJson() {
  1611. final map = super.toJson();
  1612. if(courseCode != null)
  1613. map['CourseCode'] = courseCode;
  1614. map['Quantity'] = quantity;
  1615. map['PayType'] = payType.index;
  1616. return map;
  1617. }
  1618. }
  1619. enum PayStatusEnum {
  1620. NoPay,
  1621. InPayment,
  1622. Paid,
  1623. }
  1624. class PaymentCallbackRequest extends TokenRequest{
  1625. String? paymentOrderCode;
  1626. PayStatusEnum payStatus;
  1627. DateTime? payTime;
  1628. PaymentCallbackRequest({
  1629. this.paymentOrderCode,
  1630. this.payStatus = PayStatusEnum.NoPay,
  1631. this.payTime,
  1632. String? token,
  1633. }) : super(
  1634. token: token,
  1635. );
  1636. factory PaymentCallbackRequest.fromJson(Map<String, dynamic> map) {
  1637. return PaymentCallbackRequest(
  1638. paymentOrderCode: map['PaymentOrderCode'],
  1639. payStatus: PayStatusEnum.values.firstWhere((e) => e.index == map['PayStatus']),
  1640. payTime: map['PayTime'] != null ? DateTime.parse(map['PayTime']) : null,
  1641. token: map['Token'],
  1642. );
  1643. }
  1644. Map<String, dynamic> toJson() {
  1645. final map = super.toJson();
  1646. if(paymentOrderCode != null)
  1647. map['PaymentOrderCode'] = paymentOrderCode;
  1648. map['PayStatus'] = payStatus.index;
  1649. if(payTime != null)
  1650. map['PayTime'] = JsonRpcUtils.dateFormat(payTime!);
  1651. return map;
  1652. }
  1653. }
  1654. class SignUpCourseRequest extends TokenRequest{
  1655. String? courseCode;
  1656. SignUpCourseRequest({
  1657. this.courseCode,
  1658. String? token,
  1659. }) : super(
  1660. token: token,
  1661. );
  1662. factory SignUpCourseRequest.fromJson(Map<String, dynamic> map) {
  1663. return SignUpCourseRequest(
  1664. courseCode: map['CourseCode'],
  1665. token: map['Token'],
  1666. );
  1667. }
  1668. Map<String, dynamic> toJson() {
  1669. final map = super.toJson();
  1670. if(courseCode != null)
  1671. map['CourseCode'] = courseCode;
  1672. return map;
  1673. }
  1674. }
  1675. class CancelSignUpCourseRequest extends TokenRequest{
  1676. String? courseCode;
  1677. CancelSignUpCourseRequest({
  1678. this.courseCode,
  1679. String? token,
  1680. }) : super(
  1681. token: token,
  1682. );
  1683. factory CancelSignUpCourseRequest.fromJson(Map<String, dynamic> map) {
  1684. return CancelSignUpCourseRequest(
  1685. courseCode: map['CourseCode'],
  1686. token: map['Token'],
  1687. );
  1688. }
  1689. Map<String, dynamic> toJson() {
  1690. final map = super.toJson();
  1691. if(courseCode != null)
  1692. map['CourseCode'] = courseCode;
  1693. return map;
  1694. }
  1695. }
  1696. class PublishCourseExaminationPaperRequest extends TokenRequest{
  1697. String? code;
  1698. String? courseCode;
  1699. DateTime? startTime;
  1700. PublishCourseExaminationPaperRequest({
  1701. this.code,
  1702. this.courseCode,
  1703. this.startTime,
  1704. String? token,
  1705. }) : super(
  1706. token: token,
  1707. );
  1708. factory PublishCourseExaminationPaperRequest.fromJson(Map<String, dynamic> map) {
  1709. return PublishCourseExaminationPaperRequest(
  1710. code: map['Code'],
  1711. courseCode: map['CourseCode'],
  1712. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1713. token: map['Token'],
  1714. );
  1715. }
  1716. Map<String, dynamic> toJson() {
  1717. final map = super.toJson();
  1718. if(code != null)
  1719. map['Code'] = code;
  1720. if(courseCode != null)
  1721. map['CourseCode'] = courseCode;
  1722. if(startTime != null)
  1723. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1724. return map;
  1725. }
  1726. }
  1727. class FindCourseExaminationPapersRequest extends TokenRequest{
  1728. String? courseCode;
  1729. FindCourseExaminationPapersRequest({
  1730. this.courseCode,
  1731. String? token,
  1732. }) : super(
  1733. token: token,
  1734. );
  1735. factory FindCourseExaminationPapersRequest.fromJson(Map<String, dynamic> map) {
  1736. return FindCourseExaminationPapersRequest(
  1737. courseCode: map['CourseCode'],
  1738. token: map['Token'],
  1739. );
  1740. }
  1741. Map<String, dynamic> toJson() {
  1742. final map = super.toJson();
  1743. if(courseCode != null)
  1744. map['CourseCode'] = courseCode;
  1745. return map;
  1746. }
  1747. }
  1748. class FindCourseExaminationPaperByCodeRequest extends TokenRequest{
  1749. String? code;
  1750. String? courseCode;
  1751. FindCourseExaminationPaperByCodeRequest({
  1752. this.code,
  1753. this.courseCode,
  1754. String? token,
  1755. }) : super(
  1756. token: token,
  1757. );
  1758. factory FindCourseExaminationPaperByCodeRequest.fromJson(Map<String, dynamic> map) {
  1759. return FindCourseExaminationPaperByCodeRequest(
  1760. code: map['Code'],
  1761. courseCode: map['CourseCode'],
  1762. token: map['Token'],
  1763. );
  1764. }
  1765. Map<String, dynamic> toJson() {
  1766. final map = super.toJson();
  1767. if(code != null)
  1768. map['Code'] = code;
  1769. if(courseCode != null)
  1770. map['CourseCode'] = courseCode;
  1771. return map;
  1772. }
  1773. }
  1774. class StudentSetExaminationAnswerDTO {
  1775. String? questionCode;
  1776. String? answer;
  1777. List<String >? files;
  1778. List<String >? optionCodeList;
  1779. StudentSetExaminationAnswerDTO({
  1780. this.questionCode,
  1781. this.answer,
  1782. this.files,
  1783. this.optionCodeList,
  1784. });
  1785. factory StudentSetExaminationAnswerDTO.fromJson(Map<String, dynamic> map) {
  1786. return StudentSetExaminationAnswerDTO(
  1787. questionCode: map['QuestionCode'],
  1788. answer: map['Answer'],
  1789. files: map['Files'] != null ? map['Files'].cast<String>().toList() : null,
  1790. optionCodeList: map['OptionCodeList'] != null ? map['OptionCodeList'].cast<String>().toList() : null,
  1791. );
  1792. }
  1793. Map<String, dynamic> toJson() {
  1794. final map = Map<String, dynamic>();
  1795. if(questionCode != null)
  1796. map['QuestionCode'] = questionCode;
  1797. if(answer != null)
  1798. map['Answer'] = answer;
  1799. if(files != null)
  1800. map['Files'] = files;
  1801. if(optionCodeList != null)
  1802. map['OptionCodeList'] = optionCodeList;
  1803. return map;
  1804. }
  1805. }
  1806. class SubmitCourseExaminationPaperRequest extends TokenRequest{
  1807. String? courseCode;
  1808. String? code;
  1809. List<StudentSetExaminationAnswerDTO >? answers;
  1810. SubmitCourseExaminationPaperRequest({
  1811. this.courseCode,
  1812. this.code,
  1813. this.answers,
  1814. String? token,
  1815. }) : super(
  1816. token: token,
  1817. );
  1818. factory SubmitCourseExaminationPaperRequest.fromJson(Map<String, dynamic> map) {
  1819. return SubmitCourseExaminationPaperRequest(
  1820. courseCode: map['CourseCode'],
  1821. code: map['Code'],
  1822. answers: map['Answers'] != null ? (map['Answers'] as List).map((e)=>StudentSetExaminationAnswerDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1823. token: map['Token'],
  1824. );
  1825. }
  1826. Map<String, dynamic> toJson() {
  1827. final map = super.toJson();
  1828. if(courseCode != null)
  1829. map['CourseCode'] = courseCode;
  1830. if(code != null)
  1831. map['Code'] = code;
  1832. if(answers != null)
  1833. map['Answers'] = answers;
  1834. return map;
  1835. }
  1836. }
  1837. class BaseStudentExaminationDTO {
  1838. String? code;
  1839. String? examinationCode;
  1840. String? studentCode;
  1841. String? studentName;
  1842. double totalScore;
  1843. BaseStudentExaminationDTO({
  1844. this.code,
  1845. this.examinationCode,
  1846. this.studentCode,
  1847. this.studentName,
  1848. this.totalScore = 0,
  1849. });
  1850. factory BaseStudentExaminationDTO.fromJson(Map<String, dynamic> map) {
  1851. return BaseStudentExaminationDTO(
  1852. code: map['Code'],
  1853. examinationCode: map['ExaminationCode'],
  1854. studentCode: map['StudentCode'],
  1855. studentName: map['StudentName'],
  1856. totalScore: double.parse(map['TotalScore'].toString()),
  1857. );
  1858. }
  1859. Map<String, dynamic> toJson() {
  1860. final map = Map<String, dynamic>();
  1861. if(code != null)
  1862. map['Code'] = code;
  1863. if(examinationCode != null)
  1864. map['ExaminationCode'] = examinationCode;
  1865. if(studentCode != null)
  1866. map['StudentCode'] = studentCode;
  1867. if(studentName != null)
  1868. map['StudentName'] = studentName;
  1869. map['TotalScore'] = totalScore;
  1870. return map;
  1871. }
  1872. }
  1873. class FindCourseStudentExaminationPagesRequest extends PageRequest{
  1874. String? courseCode;
  1875. String? keyword;
  1876. FindCourseStudentExaminationPagesRequest({
  1877. this.courseCode,
  1878. this.keyword,
  1879. int pageIndex = 0,
  1880. int pageSize = 0,
  1881. String? token,
  1882. }) : super(
  1883. pageIndex: pageIndex,
  1884. pageSize: pageSize,
  1885. token: token,
  1886. );
  1887. factory FindCourseStudentExaminationPagesRequest.fromJson(Map<String, dynamic> map) {
  1888. return FindCourseStudentExaminationPagesRequest(
  1889. courseCode: map['CourseCode'],
  1890. keyword: map['Keyword'],
  1891. pageIndex: map['PageIndex'],
  1892. pageSize: map['PageSize'],
  1893. token: map['Token'],
  1894. );
  1895. }
  1896. Map<String, dynamic> toJson() {
  1897. final map = super.toJson();
  1898. if(courseCode != null)
  1899. map['CourseCode'] = courseCode;
  1900. if(keyword != null)
  1901. map['Keyword'] = keyword;
  1902. return map;
  1903. }
  1904. }
  1905. class ExaminationAnswerDTO {
  1906. String? questionCode;
  1907. QuestionTypeEnum questionType;
  1908. String? answer;
  1909. List<String >? files;
  1910. List<String >? optionCodeList;
  1911. bool isCorrect;
  1912. double score;
  1913. ExaminationAnswerDTO({
  1914. this.questionCode,
  1915. this.questionType = QuestionTypeEnum.Judge,
  1916. this.answer,
  1917. this.files,
  1918. this.optionCodeList,
  1919. this.isCorrect = false,
  1920. this.score = 0,
  1921. });
  1922. factory ExaminationAnswerDTO.fromJson(Map<String, dynamic> map) {
  1923. return ExaminationAnswerDTO(
  1924. questionCode: map['QuestionCode'],
  1925. questionType: QuestionTypeEnum.values.firstWhere((e) => e.index == map['QuestionType']),
  1926. answer: map['Answer'],
  1927. files: map['Files'] != null ? map['Files'].cast<String>().toList() : null,
  1928. optionCodeList: map['OptionCodeList'] != null ? map['OptionCodeList'].cast<String>().toList() : null,
  1929. isCorrect: map['IsCorrect'],
  1930. score: double.parse(map['Score'].toString()),
  1931. );
  1932. }
  1933. Map<String, dynamic> toJson() {
  1934. final map = Map<String, dynamic>();
  1935. if(questionCode != null)
  1936. map['QuestionCode'] = questionCode;
  1937. map['QuestionType'] = questionType.index;
  1938. if(answer != null)
  1939. map['Answer'] = answer;
  1940. if(files != null)
  1941. map['Files'] = files;
  1942. if(optionCodeList != null)
  1943. map['OptionCodeList'] = optionCodeList;
  1944. map['IsCorrect'] = isCorrect;
  1945. map['Score'] = score;
  1946. return map;
  1947. }
  1948. }
  1949. class StudentExaminationDetailDTO extends BaseStudentExaminationDTO{
  1950. CourseExaminationDTO? examination;
  1951. List<ExaminationAnswerDTO >? studentAnswers;
  1952. StudentExaminationDetailDTO({
  1953. this.examination,
  1954. this.studentAnswers,
  1955. String? code,
  1956. String? examinationCode,
  1957. String? studentCode,
  1958. String? studentName,
  1959. double totalScore = 0,
  1960. }) : super(
  1961. code: code,
  1962. examinationCode: examinationCode,
  1963. studentCode: studentCode,
  1964. studentName: studentName,
  1965. totalScore: totalScore,
  1966. );
  1967. factory StudentExaminationDetailDTO.fromJson(Map<String, dynamic> map) {
  1968. return StudentExaminationDetailDTO(
  1969. examination: map['Examination'] != null ? CourseExaminationDTO.fromJson(map['Examination']) : null,
  1970. studentAnswers: map['StudentAnswers'] != null ? (map['StudentAnswers'] as List).map((e)=>ExaminationAnswerDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1971. code: map['Code'],
  1972. examinationCode: map['ExaminationCode'],
  1973. studentCode: map['StudentCode'],
  1974. studentName: map['StudentName'],
  1975. totalScore: double.parse(map['TotalScore'].toString()),
  1976. );
  1977. }
  1978. Map<String, dynamic> toJson() {
  1979. final map = super.toJson();
  1980. if(examination != null)
  1981. map['Examination'] = examination;
  1982. if(studentAnswers != null)
  1983. map['StudentAnswers'] = studentAnswers;
  1984. return map;
  1985. }
  1986. }
  1987. class FindStudentExaminationByCodeRequest extends TokenRequest{
  1988. String? code;
  1989. FindStudentExaminationByCodeRequest({
  1990. this.code,
  1991. String? token,
  1992. }) : super(
  1993. token: token,
  1994. );
  1995. factory FindStudentExaminationByCodeRequest.fromJson(Map<String, dynamic> map) {
  1996. return FindStudentExaminationByCodeRequest(
  1997. code: map['Code'],
  1998. token: map['Token'],
  1999. );
  2000. }
  2001. Map<String, dynamic> toJson() {
  2002. final map = super.toJson();
  2003. if(code != null)
  2004. map['Code'] = code;
  2005. return map;
  2006. }
  2007. }
  2008. class TeacherSetExaminationAnswerDTO {
  2009. String? questionCode;
  2010. bool isCorrect;
  2011. double score;
  2012. TeacherSetExaminationAnswerDTO({
  2013. this.questionCode,
  2014. this.isCorrect = false,
  2015. this.score = 0,
  2016. });
  2017. factory TeacherSetExaminationAnswerDTO.fromJson(Map<String, dynamic> map) {
  2018. return TeacherSetExaminationAnswerDTO(
  2019. questionCode: map['QuestionCode'],
  2020. isCorrect: map['IsCorrect'],
  2021. score: double.parse(map['Score'].toString()),
  2022. );
  2023. }
  2024. Map<String, dynamic> toJson() {
  2025. final map = Map<String, dynamic>();
  2026. if(questionCode != null)
  2027. map['QuestionCode'] = questionCode;
  2028. map['IsCorrect'] = isCorrect;
  2029. map['Score'] = score;
  2030. return map;
  2031. }
  2032. }
  2033. class SubmitReviewStudentExaminationRequest extends TokenRequest{
  2034. String? code;
  2035. List<TeacherSetExaminationAnswerDTO >? answers;
  2036. SubmitReviewStudentExaminationRequest({
  2037. this.code,
  2038. this.answers,
  2039. String? token,
  2040. }) : super(
  2041. token: token,
  2042. );
  2043. factory SubmitReviewStudentExaminationRequest.fromJson(Map<String, dynamic> map) {
  2044. return SubmitReviewStudentExaminationRequest(
  2045. code: map['Code'],
  2046. answers: map['Answers'] != null ? (map['Answers'] as List).map((e)=>TeacherSetExaminationAnswerDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2047. token: map['Token'],
  2048. );
  2049. }
  2050. Map<String, dynamic> toJson() {
  2051. final map = super.toJson();
  2052. if(code != null)
  2053. map['Code'] = code;
  2054. if(answers != null)
  2055. map['Answers'] = answers;
  2056. return map;
  2057. }
  2058. }
  2059. class FindMyCourseStudentExaminationResultPagesRequest extends PageRequest{
  2060. String? courseCode;
  2061. String? keyword;
  2062. FindMyCourseStudentExaminationResultPagesRequest({
  2063. this.courseCode,
  2064. this.keyword,
  2065. int pageIndex = 0,
  2066. int pageSize = 0,
  2067. String? token,
  2068. }) : super(
  2069. pageIndex: pageIndex,
  2070. pageSize: pageSize,
  2071. token: token,
  2072. );
  2073. factory FindMyCourseStudentExaminationResultPagesRequest.fromJson(Map<String, dynamic> map) {
  2074. return FindMyCourseStudentExaminationResultPagesRequest(
  2075. courseCode: map['CourseCode'],
  2076. keyword: map['Keyword'],
  2077. pageIndex: map['PageIndex'],
  2078. pageSize: map['PageSize'],
  2079. token: map['Token'],
  2080. );
  2081. }
  2082. Map<String, dynamic> toJson() {
  2083. final map = super.toJson();
  2084. if(courseCode != null)
  2085. map['CourseCode'] = courseCode;
  2086. if(keyword != null)
  2087. map['Keyword'] = keyword;
  2088. return map;
  2089. }
  2090. }
  2091. class FindMyCourseStudentExaminationResultRequest extends TokenRequest{
  2092. String? code;
  2093. FindMyCourseStudentExaminationResultRequest({
  2094. this.code,
  2095. String? token,
  2096. }) : super(
  2097. token: token,
  2098. );
  2099. factory FindMyCourseStudentExaminationResultRequest.fromJson(Map<String, dynamic> map) {
  2100. return FindMyCourseStudentExaminationResultRequest(
  2101. code: map['Code'],
  2102. token: map['Token'],
  2103. );
  2104. }
  2105. Map<String, dynamic> toJson() {
  2106. final map = super.toJson();
  2107. if(code != null)
  2108. map['Code'] = code;
  2109. return map;
  2110. }
  2111. }
  2112. class LiveCourseBaseResult {
  2113. String? courseCode;
  2114. LiveCourseBaseResult({
  2115. this.courseCode,
  2116. });
  2117. factory LiveCourseBaseResult.fromJson(Map<String, dynamic> map) {
  2118. return LiveCourseBaseResult(
  2119. courseCode: map['CourseCode'],
  2120. );
  2121. }
  2122. Map<String, dynamic> toJson() {
  2123. final map = Map<String, dynamic>();
  2124. if(courseCode != null)
  2125. map['CourseCode'] = courseCode;
  2126. return map;
  2127. }
  2128. }
  2129. enum LiveMemberStatus {
  2130. Default,
  2131. Accepted,
  2132. Rejected,
  2133. Joined,
  2134. Left,
  2135. }
  2136. class LiveCourseMember {
  2137. String? id;
  2138. String? name;
  2139. LiveMemberEnum memberType;
  2140. String? headImageToken;
  2141. UserStatusEnum userStatusType;
  2142. bool mute;
  2143. bool videoOpend;
  2144. bool isTeacher;
  2145. bool isExpertUser;
  2146. bool isAssistantUser;
  2147. LiveMemberStatus status;
  2148. String? loginServerUrl;
  2149. LoginSource loginSource;
  2150. LiveDataDTO? liveData;
  2151. List<VideoDeviceOutputInfo >? videoDeviceInfos;
  2152. bool isControllingParameter;
  2153. bool mergedChannel;
  2154. int mergedVideoOutputWidth;
  2155. int mergedVideoOutputHeight;
  2156. LiveCourseMember({
  2157. this.id,
  2158. this.name,
  2159. this.memberType = LiveMemberEnum.User,
  2160. this.headImageToken,
  2161. this.userStatusType = UserStatusEnum.NotOnline,
  2162. this.mute = false,
  2163. this.videoOpend = false,
  2164. this.isTeacher = false,
  2165. this.isExpertUser = false,
  2166. this.isAssistantUser = false,
  2167. this.status = LiveMemberStatus.Default,
  2168. this.loginServerUrl,
  2169. this.loginSource = LoginSource.PC,
  2170. this.liveData,
  2171. this.videoDeviceInfos,
  2172. this.isControllingParameter = false,
  2173. this.mergedChannel = false,
  2174. this.mergedVideoOutputWidth = 0,
  2175. this.mergedVideoOutputHeight = 0,
  2176. });
  2177. factory LiveCourseMember.fromJson(Map<String, dynamic> map) {
  2178. return LiveCourseMember(
  2179. id: map['Id'],
  2180. name: map['Name'],
  2181. memberType: LiveMemberEnum.values.firstWhere((e) => e.index == map['MemberType']),
  2182. headImageToken: map['HeadImageToken'],
  2183. userStatusType: UserStatusEnum.values.firstWhere((e) => e.index == map['UserStatusType']),
  2184. mute: map['Mute'],
  2185. videoOpend: map['VideoOpend'],
  2186. isTeacher: map['IsTeacher'],
  2187. isExpertUser: map['IsExpertUser'],
  2188. isAssistantUser: map['IsAssistantUser'],
  2189. status: LiveMemberStatus.values.firstWhere((e) => e.index == map['Status']),
  2190. loginServerUrl: map['LoginServerUrl'],
  2191. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  2192. liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null,
  2193. videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceOutputInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  2194. isControllingParameter: map['IsControllingParameter'],
  2195. mergedChannel: map['MergedChannel'],
  2196. mergedVideoOutputWidth: map['MergedVideoOutputWidth'],
  2197. mergedVideoOutputHeight: map['MergedVideoOutputHeight'],
  2198. );
  2199. }
  2200. Map<String, dynamic> toJson() {
  2201. final map = Map<String, dynamic>();
  2202. if(id != null)
  2203. map['Id'] = id;
  2204. if(name != null)
  2205. map['Name'] = name;
  2206. map['MemberType'] = memberType.index;
  2207. if(headImageToken != null)
  2208. map['HeadImageToken'] = headImageToken;
  2209. map['UserStatusType'] = userStatusType.index;
  2210. map['Mute'] = mute;
  2211. map['VideoOpend'] = videoOpend;
  2212. map['IsTeacher'] = isTeacher;
  2213. map['IsExpertUser'] = isExpertUser;
  2214. map['IsAssistantUser'] = isAssistantUser;
  2215. map['Status'] = status.index;
  2216. if(loginServerUrl != null)
  2217. map['LoginServerUrl'] = loginServerUrl;
  2218. map['LoginSource'] = loginSource.index;
  2219. if(liveData != null)
  2220. map['LiveData'] = liveData;
  2221. if(videoDeviceInfos != null)
  2222. map['VideoDeviceInfos'] = videoDeviceInfos;
  2223. map['IsControllingParameter'] = isControllingParameter;
  2224. map['MergedChannel'] = mergedChannel;
  2225. map['MergedVideoOutputWidth'] = mergedVideoOutputWidth;
  2226. map['MergedVideoOutputHeight'] = mergedVideoOutputHeight;
  2227. return map;
  2228. }
  2229. }
  2230. class InitiateLiveCourseResult extends LiveCourseBaseResult{
  2231. String? initiatorCode;
  2232. int roomNo;
  2233. String? liveProtocol;
  2234. int appId;
  2235. String? userSign;
  2236. List<LiveCourseMember >? memberLiveDatas;
  2237. InitiateLiveCourseResult({
  2238. this.initiatorCode,
  2239. this.roomNo = 0,
  2240. this.liveProtocol,
  2241. this.appId = 0,
  2242. this.userSign,
  2243. this.memberLiveDatas,
  2244. String? courseCode,
  2245. }) : super(
  2246. courseCode: courseCode,
  2247. );
  2248. factory InitiateLiveCourseResult.fromJson(Map<String, dynamic> map) {
  2249. return InitiateLiveCourseResult(
  2250. initiatorCode: map['InitiatorCode'],
  2251. roomNo: map['RoomNo'],
  2252. liveProtocol: map['LiveProtocol'],
  2253. appId: map['AppId'],
  2254. userSign: map['UserSign'],
  2255. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveCourseMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  2256. courseCode: map['CourseCode'],
  2257. );
  2258. }
  2259. Map<String, dynamic> toJson() {
  2260. final map = super.toJson();
  2261. if(initiatorCode != null)
  2262. map['InitiatorCode'] = initiatorCode;
  2263. map['RoomNo'] = roomNo;
  2264. if(liveProtocol != null)
  2265. map['LiveProtocol'] = liveProtocol;
  2266. map['AppId'] = appId;
  2267. if(userSign != null)
  2268. map['UserSign'] = userSign;
  2269. if(memberLiveDatas != null)
  2270. map['MemberLiveDatas'] = memberLiveDatas;
  2271. return map;
  2272. }
  2273. }
  2274. class InitiateLiveCourseRequest extends TokenRequest{
  2275. String? courseCode;
  2276. InitiateLiveCourseRequest({
  2277. this.courseCode,
  2278. String? token,
  2279. }) : super(
  2280. token: token,
  2281. );
  2282. factory InitiateLiveCourseRequest.fromJson(Map<String, dynamic> map) {
  2283. return InitiateLiveCourseRequest(
  2284. courseCode: map['CourseCode'],
  2285. token: map['Token'],
  2286. );
  2287. }
  2288. Map<String, dynamic> toJson() {
  2289. final map = super.toJson();
  2290. if(courseCode != null)
  2291. map['CourseCode'] = courseCode;
  2292. return map;
  2293. }
  2294. }
  2295. class JoinLiveCourseResult extends LiveCourseBaseResult{
  2296. String? userCode;
  2297. int roomNo;
  2298. String? liveProtocol;
  2299. int appId;
  2300. String? userSign;
  2301. List<LiveCourseMember >? memberLiveDatas;
  2302. JoinLiveCourseResult({
  2303. this.userCode,
  2304. this.roomNo = 0,
  2305. this.liveProtocol,
  2306. this.appId = 0,
  2307. this.userSign,
  2308. this.memberLiveDatas,
  2309. String? courseCode,
  2310. }) : super(
  2311. courseCode: courseCode,
  2312. );
  2313. factory JoinLiveCourseResult.fromJson(Map<String, dynamic> map) {
  2314. return JoinLiveCourseResult(
  2315. userCode: map['UserCode'],
  2316. roomNo: map['RoomNo'],
  2317. liveProtocol: map['LiveProtocol'],
  2318. appId: map['AppId'],
  2319. userSign: map['UserSign'],
  2320. memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveCourseMember.fromJson(e as Map<String,dynamic>)).toList() : null,
  2321. courseCode: map['CourseCode'],
  2322. );
  2323. }
  2324. Map<String, dynamic> toJson() {
  2325. final map = super.toJson();
  2326. if(userCode != null)
  2327. map['UserCode'] = userCode;
  2328. map['RoomNo'] = roomNo;
  2329. if(liveProtocol != null)
  2330. map['LiveProtocol'] = liveProtocol;
  2331. map['AppId'] = appId;
  2332. if(userSign != null)
  2333. map['UserSign'] = userSign;
  2334. if(memberLiveDatas != null)
  2335. map['MemberLiveDatas'] = memberLiveDatas;
  2336. return map;
  2337. }
  2338. }
  2339. class JoinLiveCourseRequest extends InitiateLiveCourseRequest{
  2340. String? deviceCode;
  2341. JoinLiveCourseRequest({
  2342. this.deviceCode,
  2343. String? courseCode,
  2344. String? token,
  2345. }) : super(
  2346. courseCode: courseCode,
  2347. token: token,
  2348. );
  2349. factory JoinLiveCourseRequest.fromJson(Map<String, dynamic> map) {
  2350. return JoinLiveCourseRequest(
  2351. deviceCode: map['DeviceCode'],
  2352. courseCode: map['CourseCode'],
  2353. token: map['Token'],
  2354. );
  2355. }
  2356. Map<String, dynamic> toJson() {
  2357. final map = super.toJson();
  2358. if(deviceCode != null)
  2359. map['DeviceCode'] = deviceCode;
  2360. return map;
  2361. }
  2362. }
  2363. class LiveHeartRateResult {
  2364. String? liveCode;
  2365. LiveHeartRateResult({
  2366. this.liveCode,
  2367. });
  2368. factory LiveHeartRateResult.fromJson(Map<String, dynamic> map) {
  2369. return LiveHeartRateResult(
  2370. liveCode: map['LiveCode'],
  2371. );
  2372. }
  2373. Map<String, dynamic> toJson() {
  2374. final map = Map<String, dynamic>();
  2375. if(liveCode != null)
  2376. map['LiveCode'] = liveCode;
  2377. return map;
  2378. }
  2379. }
  2380. class LiveHeartRateRequest extends TokenRequest{
  2381. String? liveCode;
  2382. LiveHeartRateRequest({
  2383. this.liveCode,
  2384. String? token,
  2385. }) : super(
  2386. token: token,
  2387. );
  2388. factory LiveHeartRateRequest.fromJson(Map<String, dynamic> map) {
  2389. return LiveHeartRateRequest(
  2390. liveCode: map['LiveCode'],
  2391. token: map['Token'],
  2392. );
  2393. }
  2394. Map<String, dynamic> toJson() {
  2395. final map = super.toJson();
  2396. if(liveCode != null)
  2397. map['LiveCode'] = liveCode;
  2398. return map;
  2399. }
  2400. }
  2401. class SetMuteLiveCourseRequest extends InitiateLiveCourseRequest{
  2402. bool isMute;
  2403. SetMuteLiveCourseRequest({
  2404. this.isMute = false,
  2405. String? courseCode,
  2406. String? token,
  2407. }) : super(
  2408. courseCode: courseCode,
  2409. token: token,
  2410. );
  2411. factory SetMuteLiveCourseRequest.fromJson(Map<String, dynamic> map) {
  2412. return SetMuteLiveCourseRequest(
  2413. isMute: map['IsMute'],
  2414. courseCode: map['CourseCode'],
  2415. token: map['Token'],
  2416. );
  2417. }
  2418. Map<String, dynamic> toJson() {
  2419. final map = super.toJson();
  2420. map['IsMute'] = isMute;
  2421. return map;
  2422. }
  2423. }
  2424. class SetVideoLiveCourseRequest extends InitiateLiveCourseRequest{
  2425. bool isOpened;
  2426. SetVideoLiveCourseRequest({
  2427. this.isOpened = false,
  2428. String? courseCode,
  2429. String? token,
  2430. }) : super(
  2431. courseCode: courseCode,
  2432. token: token,
  2433. );
  2434. factory SetVideoLiveCourseRequest.fromJson(Map<String, dynamic> map) {
  2435. return SetVideoLiveCourseRequest(
  2436. isOpened: map['IsOpened'],
  2437. courseCode: map['CourseCode'],
  2438. token: map['Token'],
  2439. );
  2440. }
  2441. Map<String, dynamic> toJson() {
  2442. final map = super.toJson();
  2443. map['IsOpened'] = isOpened;
  2444. return map;
  2445. }
  2446. }
  2447. class ControlParameterInCourseRequest extends InitiateLiveCourseRequest{
  2448. List<AdditionParameterDTO >? parameters;
  2449. ControlDeviceParameterEnum controlType;
  2450. ControlParameterInCourseRequest({
  2451. this.parameters,
  2452. this.controlType = ControlDeviceParameterEnum.Start,
  2453. String? courseCode,
  2454. String? token,
  2455. }) : super(
  2456. courseCode: courseCode,
  2457. token: token,
  2458. );
  2459. factory ControlParameterInCourseRequest.fromJson(Map<String, dynamic> map) {
  2460. return ControlParameterInCourseRequest(
  2461. parameters: map['Parameters'] != null ? (map['Parameters'] as List).map((e)=>AdditionParameterDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  2462. controlType: ControlDeviceParameterEnum.values.firstWhere((e) => e.index == map['ControlType']),
  2463. courseCode: map['CourseCode'],
  2464. token: map['Token'],
  2465. );
  2466. }
  2467. Map<String, dynamic> toJson() {
  2468. final map = super.toJson();
  2469. if(parameters != null)
  2470. map['Parameters'] = parameters;
  2471. map['ControlType'] = controlType.index;
  2472. return map;
  2473. }
  2474. }
  2475. class UploadRemoteExamRequest extends TokenRequest{
  2476. String? deviceUniqueCode;
  2477. String? previewFileToken;
  2478. String? fileToken;
  2479. int fileSize;
  2480. String? coverImageToken;
  2481. String? applicationCategory;
  2482. String? application;
  2483. RemedicalFileDataTypeEnum fileDataType;
  2484. MeasuredResultsDTO? measuredResult;
  2485. ScanImageDTO? commentResult;
  2486. UploadRemoteExamRequest({
  2487. this.deviceUniqueCode,
  2488. this.previewFileToken,
  2489. this.fileToken,
  2490. this.fileSize = 0,
  2491. this.coverImageToken,
  2492. this.applicationCategory,
  2493. this.application,
  2494. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  2495. this.measuredResult,
  2496. this.commentResult,
  2497. String? token,
  2498. }) : super(
  2499. token: token,
  2500. );
  2501. factory UploadRemoteExamRequest.fromJson(Map<String, dynamic> map) {
  2502. return UploadRemoteExamRequest(
  2503. deviceUniqueCode: map['DeviceUniqueCode'],
  2504. previewFileToken: map['PreviewFileToken'],
  2505. fileToken: map['FileToken'],
  2506. fileSize: map['FileSize'],
  2507. coverImageToken: map['CoverImageToken'],
  2508. applicationCategory: map['ApplicationCategory'],
  2509. application: map['Application'],
  2510. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  2511. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  2512. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  2513. token: map['Token'],
  2514. );
  2515. }
  2516. Map<String, dynamic> toJson() {
  2517. final map = super.toJson();
  2518. if(deviceUniqueCode != null)
  2519. map['DeviceUniqueCode'] = deviceUniqueCode;
  2520. if(previewFileToken != null)
  2521. map['PreviewFileToken'] = previewFileToken;
  2522. if(fileToken != null)
  2523. map['FileToken'] = fileToken;
  2524. map['FileSize'] = fileSize;
  2525. if(coverImageToken != null)
  2526. map['CoverImageToken'] = coverImageToken;
  2527. if(applicationCategory != null)
  2528. map['ApplicationCategory'] = applicationCategory;
  2529. if(application != null)
  2530. map['Application'] = application;
  2531. map['FileDataType'] = fileDataType.index;
  2532. if(measuredResult != null)
  2533. map['MeasuredResult'] = measuredResult;
  2534. if(commentResult != null)
  2535. map['CommentResult'] = commentResult;
  2536. return map;
  2537. }
  2538. }
  2539. class RemoteExaminationDTO extends BaseDTO{
  2540. String? code;
  2541. String? deviceCode;
  2542. String? userCode;
  2543. String? application;
  2544. String? previewUrl;
  2545. String? imageUrl;
  2546. String? coverImageUrl;
  2547. String? originImageUrl;
  2548. int imageSize;
  2549. RemedicalFileDataTypeEnum fileDataType;
  2550. MeasuredResultsDTO? measuredResult;
  2551. ScanImageDTO? commentResult;
  2552. RemoteExaminationDTO({
  2553. this.code,
  2554. this.deviceCode,
  2555. this.userCode,
  2556. this.application,
  2557. this.previewUrl,
  2558. this.imageUrl,
  2559. this.coverImageUrl,
  2560. this.originImageUrl,
  2561. this.imageSize = 0,
  2562. this.fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  2563. this.measuredResult,
  2564. this.commentResult,
  2565. DateTime? createTime,
  2566. DateTime? updateTime,
  2567. }) : super(
  2568. createTime: createTime,
  2569. updateTime: updateTime,
  2570. );
  2571. factory RemoteExaminationDTO.fromJson(Map<String, dynamic> map) {
  2572. return RemoteExaminationDTO(
  2573. code: map['Code'],
  2574. deviceCode: map['DeviceCode'],
  2575. userCode: map['UserCode'],
  2576. application: map['Application'],
  2577. previewUrl: map['PreviewUrl'],
  2578. imageUrl: map['ImageUrl'],
  2579. coverImageUrl: map['CoverImageUrl'],
  2580. originImageUrl: map['OriginImageUrl'],
  2581. imageSize: map['ImageSize'],
  2582. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  2583. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  2584. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  2585. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2586. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2587. );
  2588. }
  2589. Map<String, dynamic> toJson() {
  2590. final map = super.toJson();
  2591. if(code != null)
  2592. map['Code'] = code;
  2593. if(deviceCode != null)
  2594. map['DeviceCode'] = deviceCode;
  2595. if(userCode != null)
  2596. map['UserCode'] = userCode;
  2597. if(application != null)
  2598. map['Application'] = application;
  2599. if(previewUrl != null)
  2600. map['PreviewUrl'] = previewUrl;
  2601. if(imageUrl != null)
  2602. map['ImageUrl'] = imageUrl;
  2603. if(coverImageUrl != null)
  2604. map['CoverImageUrl'] = coverImageUrl;
  2605. if(originImageUrl != null)
  2606. map['OriginImageUrl'] = originImageUrl;
  2607. map['ImageSize'] = imageSize;
  2608. map['FileDataType'] = fileDataType.index;
  2609. if(measuredResult != null)
  2610. map['MeasuredResult'] = measuredResult;
  2611. if(commentResult != null)
  2612. map['CommentResult'] = commentResult;
  2613. return map;
  2614. }
  2615. }
  2616. class RemoteExaminationPageDTO extends RemoteExaminationDTO{
  2617. String? deviceName;
  2618. RemoteExaminationPageDTO({
  2619. this.deviceName,
  2620. String? code,
  2621. String? deviceCode,
  2622. String? userCode,
  2623. String? application,
  2624. String? previewUrl,
  2625. String? imageUrl,
  2626. String? coverImageUrl,
  2627. String? originImageUrl,
  2628. int imageSize = 0,
  2629. RemedicalFileDataTypeEnum fileDataType = RemedicalFileDataTypeEnum.VinnoVidSingle,
  2630. MeasuredResultsDTO? measuredResult,
  2631. ScanImageDTO? commentResult,
  2632. DateTime? createTime,
  2633. DateTime? updateTime,
  2634. }) : super(
  2635. code: code,
  2636. deviceCode: deviceCode,
  2637. userCode: userCode,
  2638. application: application,
  2639. previewUrl: previewUrl,
  2640. imageUrl: imageUrl,
  2641. coverImageUrl: coverImageUrl,
  2642. originImageUrl: originImageUrl,
  2643. imageSize: imageSize,
  2644. fileDataType: fileDataType,
  2645. measuredResult: measuredResult,
  2646. commentResult: commentResult,
  2647. createTime: createTime,
  2648. updateTime: updateTime,
  2649. );
  2650. factory RemoteExaminationPageDTO.fromJson(Map<String, dynamic> map) {
  2651. return RemoteExaminationPageDTO(
  2652. deviceName: map['DeviceName'],
  2653. code: map['Code'],
  2654. deviceCode: map['DeviceCode'],
  2655. userCode: map['UserCode'],
  2656. application: map['Application'],
  2657. previewUrl: map['PreviewUrl'],
  2658. imageUrl: map['ImageUrl'],
  2659. coverImageUrl: map['CoverImageUrl'],
  2660. originImageUrl: map['OriginImageUrl'],
  2661. imageSize: map['ImageSize'],
  2662. fileDataType: RemedicalFileDataTypeEnum.values.firstWhere((e) => e.index == map['FileDataType']),
  2663. measuredResult: map['MeasuredResult'] != null ? MeasuredResultsDTO.fromJson(map['MeasuredResult']) : null,
  2664. commentResult: map['CommentResult'] != null ? ScanImageDTO.fromJson(map['CommentResult']) : null,
  2665. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  2666. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  2667. );
  2668. }
  2669. Map<String, dynamic> toJson() {
  2670. final map = super.toJson();
  2671. if(deviceName != null)
  2672. map['DeviceName'] = deviceName;
  2673. return map;
  2674. }
  2675. }
  2676. class AddStudentInCourseUserGroupRequest {
  2677. String? userGroupCode;
  2678. List<String >? studentCodes;
  2679. AddStudentInCourseUserGroupRequest({
  2680. this.userGroupCode,
  2681. this.studentCodes,
  2682. });
  2683. factory AddStudentInCourseUserGroupRequest.fromJson(Map<String, dynamic> map) {
  2684. return AddStudentInCourseUserGroupRequest(
  2685. userGroupCode: map['UserGroupCode'],
  2686. studentCodes: map['StudentCodes'] != null ? map['StudentCodes'].cast<String>().toList() : null,
  2687. );
  2688. }
  2689. Map<String, dynamic> toJson() {
  2690. final map = Map<String, dynamic>();
  2691. if(userGroupCode != null)
  2692. map['UserGroupCode'] = userGroupCode;
  2693. if(studentCodes != null)
  2694. map['StudentCodes'] = studentCodes;
  2695. return map;
  2696. }
  2697. }
  2698. class StudyCompletedRequest {
  2699. String? courseCode;
  2700. String? studentCode;
  2701. StudyCompletedRequest({
  2702. this.courseCode,
  2703. this.studentCode,
  2704. });
  2705. factory StudyCompletedRequest.fromJson(Map<String, dynamic> map) {
  2706. return StudyCompletedRequest(
  2707. courseCode: map['CourseCode'],
  2708. studentCode: map['StudentCode'],
  2709. );
  2710. }
  2711. Map<String, dynamic> toJson() {
  2712. final map = Map<String, dynamic>();
  2713. if(courseCode != null)
  2714. map['CourseCode'] = courseCode;
  2715. if(studentCode != null)
  2716. map['StudentCode'] = studentCode;
  2717. return map;
  2718. }
  2719. }