JointEvent.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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 type { get; set; } //類型 "regular":報名名單 "custom":決賽用名單
  60. public string creatorId { get; set; }
  61. public string creatorName { get; set; }
  62. public string creatorEmail { get; set; }
  63. public string schoolId { get; set; } //老師教育雲綁定的學校ID
  64. public string schoolName { get; set; } //老師教育雲綁定的學校名稱
  65. public string periodId { get; set; } //老師個人課程時為null
  66. public string countryId { get; set; }
  67. public string countryName { get; set; }
  68. public string provinceId { get; set; }
  69. public string provinceName { get; set; }
  70. public string cityId { get; set; }
  71. public string cityName { get; set; }
  72. public List<JointEventGroupCourse> courseLists { get; set; } = new();
  73. public class JointEventGroupCourse
  74. {
  75. public string subjectId { get; set; } //老師個人課程時為null
  76. public string courseId { get; set; }
  77. public string courseName { get; set; }
  78. public List<JointEventGroupCourseGroup> groupLists { get; set; } = new();
  79. public string examId { get; set; } //對應生成的examId ※取得JointExam時用
  80. }
  81. /// <summary>
  82. /// 統測活動學校報名班級 基底class
  83. /// </summary>
  84. public class JointEventClassBase
  85. {
  86. }
  87. public class JointEventGroupCourseGroup
  88. {
  89. public string id { get; set; }
  90. public string name { get; set; }
  91. public string no { get; set; } //系統安排的流水號 ※各組(jointGroup)的班級從1開始++ 決賽才記入
  92. public List<JointEventGroupCourseGroupSchedule> schedule { get; set; } = new();
  93. public class JointEventGroupCourseGroupSchedule
  94. {
  95. public string id { get; set; }
  96. //進行狀況 undo:未開始、doing:進行中、complete:已完成、disqualify:無資格
  97. public string status { get; set; }
  98. public List<JointEventGroupCourseGroupScheduleSend> send { get; set; } = new();
  99. public class JointEventGroupCourseGroupScheduleSend
  100. {
  101. //代號 [例]start:這個階段開始(例如熱身賽開始)、end
  102. public string code { get; set; }
  103. //已發送的通知 notify:端外通知 sms:簡訊通知 email:EMail
  104. public List<string> type { get; set; } = new();
  105. }
  106. }
  107. }
  108. }
  109. /// <summary>
  110. /// 統測活動老師報名課程 CosmosDB用 ※jointEventId、jointGroupId、creatorId 三個欄位合為主Key
  111. /// </summary>
  112. public class JointEventGroupDb : JointEventGroupBase
  113. {
  114. public string jointEventId { get; set; }
  115. public string jointGroupId { get; set; }
  116. public string jointScheduleId { get; set; } //活動進程ID 決賽用名單才有值,其餘為null
  117. public string id { get; set; }
  118. public string code { get; set; }
  119. public string pk { get; set; }
  120. public long createTime { get; set; }
  121. public int? ttl { get; set; } = -1;
  122. public long? _ts { get; set; } = -1;
  123. }
  124. /// <summary>
  125. /// 統測活動學校報名班級 基底class
  126. /// </summary>
  127. public class JointEventClassBase
  128. {
  129. public string type { get; set; } //類型 "regular":報名名單 "custom":決賽用名單
  130. public string schoolId { get; set; }
  131. public string schoolName { get; set; }
  132. public string jointScheduleId { get; set; } //活動進程ID 決賽用名單才有值,其餘為null
  133. public List<JointEventClassSchoolClass> classLists { get; set; } = new();
  134. public class JointEventClassSchoolClass
  135. {
  136. public string subjectId { get; set; } //為了生成評量,只好請班級多帶科目ID
  137. public string classId { get; set; }
  138. public string className { get; set; }
  139. }
  140. }
  141. /// <summary>
  142. /// 統測活動學校報名班級 CosmosDB [待做]
  143. /// </summary>
  144. public class JointEventClassDb : JointEventClassBase
  145. {
  146. public string jointEventId { get; set; }
  147. public string jointGroupId { get; set; }
  148. public string id { get; set; }
  149. public string code { get; set; }
  150. public string pk { get; set; }
  151. public int? ttl { get; set; } = -1;
  152. public long? _ts { get; set; } = -1;
  153. }
  154. /// <summary>
  155. /// 統測評量信息 CosmosDB
  156. /// </summary>
  157. public class JointExam : CosmosEntity
  158. {
  159. public string jointEventId { get; set; }
  160. public string jointScheduleId { get; set; }
  161. public string jointGroupId { get; set; }
  162. public string creatorId { get; set; }
  163. public string name { get; set; }
  164. public string examType { get; set; } //評量類型 "regular":一般競賽 "custom":決賽
  165. public bool examOverwrite { get; set; } //評量可否重複作答 true:可 false:不可
  166. public List<JointEventClassBase> classes { get; set; } = new(); //[不使用] 評量班級從報名班級(DB)取得
  167. public List<JointEventGroupBase> stuLists { get; set; } = new(); //[不使用] 評量班級從老師報名課程(DB)取得
  168. public List<PaperSimple> papers { get; set; } = new();
  169. public string progress { get; set; } //進行狀況 "pending" "going" "finish"
  170. public long createTime { get; set; }
  171. public long updateTime { get; set; }
  172. public long startTime { get; set; }
  173. public long endTime { get; set; }
  174. public string source { get; set; } //评测类型 0:'線上自主評量', 1:'智慧教室評量', 2:'卷卡合一評量'
  175. public string scope { get; set; }
  176. }
  177. }