JointEvent.cs 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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 string examLinkType { get; set; } = "no"; //評量連動類型 "no":未參加熱身賽也可以參加決賽 ※預設值 "one":熱身賽完成任一場就可以參加決賽 "all":熱身賽全完成才可以參加決賽
  16. public long createTime { get; set; }
  17. public long startTime { get; set; }
  18. public long endTime { get; set; }
  19. public string progress { get; set; } //進程 "pending" "going" "finish"
  20. public class JointEventGroup //活動群組
  21. {
  22. public string id { get; set; } //活動群組ID
  23. public string name { get; set; } //群組名稱
  24. public HashSet<string> assistants { get; set; } = new HashSet<string>(); //評審TMID列表
  25. }
  26. public class JointEventGeo //活動區域(國省市區)
  27. {
  28. public string countryId { get; set; } //國
  29. public string provinceId { get; set; } //省
  30. public string cityId { get; set; } //市
  31. public string distId { get; set; } //區
  32. }
  33. public class JointEventSchedule //活動進程
  34. {
  35. public string id { get; set; } //活動進程ID
  36. public string name { get; set; } //進程名稱
  37. public string type { get; set; } //"exam":評量 "join":報名 "other":其他
  38. public string examType { get; set; } //評量類型 "regular":一般競賽 "custom":決賽
  39. public bool examOverwrite { get; set; } //評量可否重複作答 true:可 false:不可
  40. public List<JointEventScheduleBlob> blobs { get; set; } = null; //說明文件存放Blob
  41. public string location { get; set; } //地點
  42. public string description { get; set; } //說明
  43. public long startTime { get; set; }
  44. public long endTime { get; set; }
  45. public string progress { get; set; } //進行狀況 "pending" "going" "finish"
  46. public int orderby { get; set; } //排序
  47. }
  48. public class JointEventScheduleBlob
  49. {
  50. public string name { get; set; } //檔案名稱
  51. public string blob { get; set; } //檔案Blob路徑
  52. }
  53. public List<string> loginType { get; set; } = new(); // 登入類型
  54. }
  55. /// <summary>
  56. /// 統測活動老師報名課程 基底class
  57. /// </summary>
  58. public class JointEventGroupBase
  59. {
  60. public string scope { get; set; } //school:學校(選課班) private:個人
  61. public string type { get; set; } //類型 "regular":報名名單 "custom":決賽用名單
  62. public string creatorId { get; set; }
  63. public string creatorName { get; set; }
  64. public string creatorEmail { get; set; }
  65. public string schoolId { get; set; } //老師教育雲綁定的學校ID
  66. public string schoolName { get; set; } //老師教育雲綁定的學校名稱
  67. public string periodId { get; set; } //老師個人課程時為null
  68. public string countryId { get; set; }
  69. public string countryName { get; set; }
  70. public string provinceId { get; set; }
  71. public string provinceName { get; set; }
  72. public string cityId { get; set; }
  73. public string cityName { get; set; }
  74. public List<JointEventGroupCourse> courseLists { get; set; } = new();
  75. public class JointEventGroupCourse
  76. {
  77. public string subjectId { get; set; } //老師個人課程時為null
  78. public string courseId { get; set; }
  79. public string courseName { get; set; }
  80. public List<JointEventGroupCourseGroup> groupLists { get; set; } = new();
  81. public string examId { get; set; } //對應生成的examId ※取得JointExam時用
  82. }
  83. /// <summary>
  84. /// 統測活動學校報名班級 基底class
  85. /// </summary>
  86. public class JointEventClassBase
  87. {
  88. }
  89. public class JointEventGroupCourseGroup
  90. {
  91. public string id { get; set; }
  92. public string name { get; set; }
  93. public string no { get; set; } //系統安排的流水號 ※各組(jointGroup)的班級從1開始++ 決賽才記入
  94. public int expStuNum { get; set; } //預估學生人數
  95. public List<JointEventGroupCourseGroupSchedule> schedule { get; set; } = new();
  96. public class JointEventGroupCourseGroupSchedule
  97. {
  98. public string id { get; set; }
  99. //進行狀況 undo:未開始、doing:進行中、complete:已完成、disqualify:無資格
  100. public string status { get; set; }
  101. public List<JointEventGroupCourseGroupScheduleSend> send { get; set; } = new();
  102. public class JointEventGroupCourseGroupScheduleSend
  103. {
  104. //代號 [例]start:這個階段開始(例如熱身賽開始)、end
  105. public string code { get; set; }
  106. //已發送的通知 notify:端外通知 sms:簡訊通知 email:EMail
  107. public List<string> type { get; set; } = new();
  108. }
  109. }
  110. }
  111. }
  112. /// <summary>
  113. /// 統測活動老師報名課程 CosmosDB用 ※jointEventId、jointGroupId、creatorId 三個欄位合為主Key
  114. /// </summary>
  115. public class JointEventGroupDb : JointEventGroupBase
  116. {
  117. public string jointEventId { get; set; }
  118. public string jointGroupId { get; set; }
  119. public string jointScheduleId { get; set; } //活動進程ID 決賽用名單才有值,其餘為null
  120. public string id { get; set; }
  121. public string code { get; set; }
  122. public string pk { get; set; }
  123. public long createTime { get; set; }
  124. public int? ttl { get; set; } = -1;
  125. public long? _ts { get; set; } = -1;
  126. }
  127. /// <summary>
  128. /// 統測活動學校報名班級 基底class
  129. /// </summary>
  130. public class JointEventClassBase
  131. {
  132. public string type { get; set; } //類型 "regular":報名名單 "custom":決賽用名單
  133. public string schoolId { get; set; }
  134. public string schoolName { get; set; }
  135. public string jointScheduleId { get; set; } //活動進程ID 決賽用名單才有值,其餘為null
  136. public List<JointEventClassSchoolClass> classLists { get; set; } = new();
  137. public class JointEventClassSchoolClass
  138. {
  139. public string subjectId { get; set; } //為了生成評量,只好請班級多帶科目ID
  140. public string classId { get; set; }
  141. public string className { get; set; }
  142. }
  143. }
  144. /// <summary>
  145. /// 統測活動學校報名班級 CosmosDB [待做]
  146. /// </summary>
  147. public class JointEventClassDb : JointEventClassBase
  148. {
  149. public string jointEventId { get; set; }
  150. public string jointGroupId { get; set; }
  151. public string id { get; set; }
  152. public string code { get; set; }
  153. public string pk { get; set; }
  154. public int? ttl { get; set; } = -1;
  155. public long? _ts { get; set; } = -1;
  156. }
  157. /// <summary>
  158. /// 統測評量信息 CosmosDB
  159. /// </summary>
  160. public class JointExam : CosmosEntity
  161. {
  162. public string jointEventId { get; set; }
  163. public string jointScheduleId { get; set; }
  164. public string jointGroupId { get; set; }
  165. public string creatorId { get; set; }
  166. public string name { get; set; }
  167. public string examType { get; set; } //評量類型 "regular":一般競賽 "custom":決賽
  168. public bool examOverwrite { get; set; } //評量可否重複作答 true:可 false:不可
  169. public List<JointEventClassBase> classes { get; set; } = new(); //[不使用] 評量班級從報名班級(DB)取得
  170. public List<JointEventGroupBase> stuLists { get; set; } = new(); //[不使用] 評量班級從老師報名課程(DB)取得
  171. public List<PaperSimple> papers { get; set; } = new();
  172. public string progress { get; set; } //進行狀況 "pending" "going" "finish"
  173. public long createTime { get; set; }
  174. public long updateTime { get; set; }
  175. public long startTime { get; set; }
  176. public long endTime { get; set; }
  177. public string source { get; set; } //评测类型 0:'線上自主評量', 1:'智慧教室評量', 2:'卷卡合一評量'
  178. public string scope { get; set; }
  179. }
  180. }