CrazyIter_Bin 4 years ago
parent
commit
fa0231014e

+ 24 - 24
TEAMModelOS.SDK/Models/Cosmos/Common/Survey.cs

@@ -49,22 +49,6 @@ namespace TEAMModelOS.SDK.Models
 
         public List<string> tmdids { get; set; }
         public List<string> classes { get; set; }
-        // public List<string> targetClassIds { get; set; }
-        //  public int stuCount { get; set; }
-        /// <summary>
-        /// 问卷状态(100:待发布 200:已发布 300:已结束)
-        /// </summary>
-        public int status { get; set; }
-        /// <summary>
-        /// 发布对象
-        /// </summary>
-        //[ProtoMember(4)]
-        //public List<Target> target { get; set; }
-
-        /// <summary>
-        /// 发布模式 0 立即发布 1 定时
-        /// </summary>
-        //public string publishModel { get; set; }
 
         /// <summary>
         /// 开始时间
@@ -76,29 +60,45 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public long endTime { get; set; }
         public long createTime { get; set; } // 问卷发布时间
-
         /// <summary>
         /// 更新时间
         /// </summary>
         public long updateTime { get; set; }
-        //public long sequenceNumber { get; set; }
-
+        //将问题放入Blob  hbcn/survey/问卷调查id.json  存放内容 Question的数组
         public string blobUrl { get; set; }
-        //将问题放入Blob
-        //public List<Question> questions { get; set; }
+        
+       // public List<Question> questions { get; set; }
 
     }
 
     /// <summary>
-    ///
+    ///问卷题目
     /// </summary>
     public class Question {
+        /// <summary>
+        /// 题目id
+        /// </summary>
         public string qid { get; set; }
+        /// <summary>
+        /// 问卷题目
+        /// </summary>
         public string question { get; set; }
+        /// <summary>
+        /// 问卷题目的描述
+        /// </summary>
+        public string description { get; set; }
+        /// <summary>
+        /// 问卷选项
+        /// </summary>
         public List<OptionSurvey> options { get; set; }
+        /// <summary>
+        /// 判断judge  多选multiple 单选single
+        /// </summary>
         public string type { get; set; }
-        //public QuestionResult result { get; set; }
-
+        /// <summary>
+        /// 是否必需作答
+        /// </summary>
+        public bool required { get; set; }
     }
 
     public class OptionSurvey{

+ 2 - 2
TEAMModelOS/Controllers/Common/SurveyController.cs

@@ -160,9 +160,9 @@ namespace TEAMModelOS.Controllers
                 };
                 List<object> surveys = new List<object>();
                 var client = _azureCosmos.GetCosmosClient();
-                var query = $"select c.id,c.name,c.code,c.startTime,c.endTime,c.progress from c where c.createTime >= {stimestamp} and c.createTime <= {etimestamp}  {progresssql } ";
+                var query = $"select c.id,c.name,c.code,c.startTime,c.endTime,c.progress from c where  c.createTime >= {stimestamp} and c.createTime <= {etimestamp}  {progresssql } ";
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query,
-                    requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"Vote-{code}") }))
+                    requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"Survey-{code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)