education.m.dart 78 KB

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