JointEvent.cs 7.6 KB

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