JointEvent.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. }
  93. }
  94. /// <summary>
  95. /// 統測活動老師報名課程 CosmosDB用 ※jointEventId、jointGroupId、creatorId 三個欄位合為主Key
  96. /// </summary>
  97. public class JointEventGroupDb : JointEventGroupBase
  98. {
  99. public string jointEventId { get; set; }
  100. public string jointGroupId { get; set; }
  101. public string jointScheduleId { get; set; } //活動進程ID 決賽用名單才有值,其餘為null
  102. public string id { get; set; }
  103. public string code { get; set; }
  104. public string pk { get; set; }
  105. public long createTime { get; set; }
  106. public int? ttl { get; set; } = -1;
  107. public long? _ts { get; set; } = -1;
  108. }
  109. /// <summary>
  110. /// 統測活動學校報名班級 基底class
  111. /// </summary>
  112. public class JointEventClassBase
  113. {
  114. public string type { get; set; } //類型 "regular":報名名單 "custom":決賽用名單
  115. public string schoolId { get; set; }
  116. public string schoolName { get; set; }
  117. public string jointScheduleId { get; set; } //活動進程ID 決賽用名單才有值,其餘為null
  118. public List<JointEventClassSchoolClass> classLists { get; set; } = new();
  119. public class JointEventClassSchoolClass
  120. {
  121. public string subjectId { get; set; } //為了生成評量,只好請班級多帶科目ID
  122. public string classId { get; set; }
  123. public string className { get; set; }
  124. }
  125. }
  126. /// <summary>
  127. /// 統測活動學校報名班級 CosmosDB [待做]
  128. /// </summary>
  129. public class JointEventClassDb : JointEventClassBase
  130. {
  131. public string jointEventId { get; set; }
  132. public string jointGroupId { get; set; }
  133. public string id { get; set; }
  134. public string code { get; set; }
  135. public string pk { get; set; }
  136. public int? ttl { get; set; } = -1;
  137. public long? _ts { get; set; } = -1;
  138. }
  139. /// <summary>
  140. /// 統測評量信息 CosmosDB
  141. /// </summary>
  142. public class JointExam : CosmosEntity
  143. {
  144. public string jointEventId { get; set; }
  145. public string jointScheduleId { get; set; }
  146. public string jointGroupId { get; set; }
  147. public string creatorId { get; set; }
  148. public string name { get; set; }
  149. public string examType { get; set; } //評量類型 "regular":一般競賽 "custom":決賽
  150. public bool examOverwrite { get; set; } //評量可否重複作答 true:可 false:不可
  151. public List<JointEventClassBase> classes { get; set; } = new(); //班級列表 ※examType="custom"才填入,其餘評量班級從報名班級(DB)取得
  152. public List<JointEventGroupBase> stuLists { get; set; } = new(); //個人課程列表 ※examType="custom"才填入,其餘評量班級從老師報名課程(DB)取得
  153. public List<PaperSimple> papers { get; set; } = new();
  154. public string progress { get; set; } //進行狀況 "pending" "going" "finish"
  155. public long createTime { get; set; }
  156. public long updateTime { get; set; }
  157. public long startTime { get; set; }
  158. public long endTime { get; set; }
  159. public string source { get; set; } //评测类型 0:'線上自主評量', 1:'智慧教室評量', 2:'卷卡合一評量'
  160. public string scope { get; set; }
  161. }
  162. }