JointEvent.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. using System.Collections.Generic;
  2. namespace TEAMModelOS.SDK.Models
  3. {
  4. /// <summary>
  5. /// 統測活動主體 CosmosDB
  6. /// </summary>
  7. public class JointEvent : CosmosEntity
  8. {
  9. public string creatorId { get; set; }
  10. public string name { get; set; }
  11. public JointEventGeo geo { get; set; } = new JointEventGeo(); //可參加活動的國省市區限制
  12. public List<string> admin { get; set; } = new List<string>(); //管理者
  13. public List<JointEventGroup> groups { get; set; } = new List<JointEventGroup>(); //群組列表
  14. public List<JointEventSchedule> schedule { get; set; } = new List<JointEventSchedule>(); //進程列表
  15. public long createTime { get; set; }
  16. public long startTime { get; set; }
  17. public long endTime { get; set; }
  18. public string progress { get; set; } //進程 "pending" "going" "finish"
  19. public class JointEventGroup //活動群組
  20. {
  21. public string id { get; set; } //活動群組ID
  22. public string name { get; set; } //群組名稱
  23. public HashSet<string> assistants { get; set; } = new HashSet<string>(); //評審TMID列表
  24. }
  25. public class JointEventGeo //活動區域(國省市區)
  26. {
  27. public string countryId { get; set; } //國
  28. public string provinceId { get; set; } //省
  29. public string cityId { get; set; } //市
  30. public string distId { get; set; } //區
  31. }
  32. public class JointEventSchedule //活動進程
  33. {
  34. public string id { get; set; } //活動進程ID
  35. public string name { get; set; } //進程名稱
  36. public string type { get; set; } //"exam":評量 "join":報名 "other":其他
  37. public string examType { get; set; } //評量類型 "regular":一般競賽 "custom":挑戰賽
  38. public bool examOverwrite { get; set; } //評量可否重複作答 true:可 false:不可
  39. public List<JointEventScheduleBlob> blobs { get; set; } = null; //說明文件存放Blob
  40. public string location { get; set; } //地點
  41. public string description { get; set; } //說明
  42. public long startTime { get; set; }
  43. public long endTime { get; set; }
  44. public string progress { get; set; } //進行狀況 "pending" "going" "finish"
  45. public int orderby { get; set; } //排序
  46. }
  47. public class JointEventScheduleBlob
  48. {
  49. public string name { get; set; } //檔案名稱
  50. public string blob { get; set; } //檔案Blob路徑
  51. }
  52. }
  53. /// <summary>
  54. /// 統測活動老師報名課程 基底class
  55. /// </summary>
  56. public class JointEventGroupBase
  57. {
  58. public string scope { get; set; } //school:學校(選課班) private:個人
  59. public string creatorId { get; set; }
  60. public string creatorName { get; set; }
  61. public string creatorEmail { get; set; }
  62. public string schoolId { get; set; } //老師個人課程時為null
  63. public string periodId { get; set; } //老師個人課程時為null
  64. public List<JointEventGroupCourse> courseLists { get; set; } = new();
  65. public class JointEventGroupCourse
  66. {
  67. public string subjectId { get; set; } //老師個人課程時為null
  68. public string courseId { get; set; }
  69. public string courseName { get; set; }
  70. public List<JointEventGroupCourseGroup> groupLists { get; set; } = new();
  71. public string examId { get; set; } //對應生成的examId ※取得JointExam時用
  72. }
  73. /// <summary>
  74. /// 統測活動學校報名班級 基底class
  75. /// </summary>
  76. public class JointEventClassBase
  77. {
  78. }
  79. public class JointEventGroupCourseGroup
  80. {
  81. public string id { get; set; }
  82. public string name { get; set; }
  83. }
  84. }
  85. /// <summary>
  86. /// 統測活動老師報名課程 CosmosDB用 ※jointEventId、jointGroupId、creatorId 三個欄位合為主Key
  87. /// </summary>
  88. public class JointEventGroupDb : JointEventGroupBase
  89. {
  90. public string jointEventId { get; set; }
  91. public string jointGroupId { get; set; }
  92. public string id { get; set; }
  93. public string code { get; set; }
  94. public string pk { get; set; }
  95. public int? ttl { get; set; } = -1;
  96. public long? _ts { get; set; } = -1;
  97. }
  98. /// <summary>
  99. /// 統測活動學校報名班級 基底class
  100. /// </summary>
  101. public class JointEventClassBase
  102. {
  103. public string schoolId { get; set; }
  104. public string schoolName { get; set; }
  105. public List<JointEventClassSchoolClass> classLists { get; set; } = new();
  106. public class JointEventClassSchoolClass
  107. {
  108. public string subjectId { get; set; } //為了生成評量,只好請班級多帶科目ID
  109. public string classId { get; set; }
  110. public string className { get; set; }
  111. }
  112. }
  113. /// <summary>
  114. /// 統測活動學校報名班級 CosmosDB [待做]
  115. /// </summary>
  116. public class JointEventClassDb : JointEventClassBase
  117. {
  118. public string jointEventId { get; set; }
  119. public string jointGroupId { get; set; }
  120. public string id { get; set; }
  121. public string code { get; set; }
  122. public string pk { get; set; }
  123. public int? ttl { get; set; } = -1;
  124. public long? _ts { get; set; } = -1;
  125. }
  126. /// <summary>
  127. /// 統測評量信息 CosmosDB
  128. /// </summary>
  129. public class JointExam : CosmosEntity
  130. {
  131. public string jointEventId { get; set; }
  132. public string jointScheduleId { get; set; }
  133. public string jointGroupId { get; set; }
  134. public string creatorId { get; set; }
  135. public string name { get; set; }
  136. public string examType { get; set; } //評量類型 "regular":一般競賽 "custom":挑戰賽
  137. public bool examOverwrite { get; set; } //評量可否重複作答 true:可 false:不可
  138. public List<JointEventClassBase> classes { get; set; } = new(); //班級列表 ※examType="custom"才填入,其餘評量班級從報名班級(DB)取得
  139. public List<JointEventGroupBase> stuLists { get; set; } = new(); //個人課程列表 ※examType="custom"才填入,其餘評量班級從老師報名課程(DB)取得
  140. public List<PaperSimple> papers { get; set; } = new();
  141. public string progress { get; set; } //進行狀況 "pending" "going" "finish"
  142. public long createTime { get; set; }
  143. public long updateTime { get; set; }
  144. public long startTime { get; set; }
  145. public long endTime { get; set; }
  146. public string source { get; set; } //评测类型 0:'線上自主評量', 1:'智慧教室評量', 2:'卷卡合一評量'
  147. public string scope { get; set; }
  148. }
  149. }