CrazyIter_Bin 1 tahun lalu
induk
melakukan
be23b75a7d

+ 0 - 4
TEAMModelOS.SDK/Models/Cosmos/School/Debate.cs

@@ -109,10 +109,6 @@ namespace TEAMModelOS.SDK.Models
         /// 回复的时间
         /// </summary>
         public long time { get; set; }
-        /// <summary>
-        /// 点赞数
-        /// </summary>
-        public int likeCount { get; set; }
         public string atTmdid { get; set; }
         public string atTmdname { get; set; }
         public string atPicture { get; set; }

+ 10 - 4
TEAMModelOS/Controllers/School/DebateController.cs

@@ -86,12 +86,12 @@ namespace TEAMModelOS.Controllers
                 if (!request.TryGetProperty("debateId", out JsonElement _debateId)) { return BadRequest(); }
                 if (!request.TryGetProperty("debateCode", out JsonElement _debateCode)) { return BadRequest(); }
                 string debateCode = $"{_debateCode}".StartsWith("Debate-") ? $"{_debateCode}" : $"Debate-{_debateCode}";
-                await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").DeleteItemAsync<Debate>($"{_debateId}", new PartitionKey($"{debateCode}"));
+                await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{_debateId}", new PartitionKey($"{debateCode}"));
                 return Ok(new { status=200});
             }
             catch (Exception ex)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},DebateController,school/debate/delete\n{ex.Message}\n{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},DebateController,school/debate/delete\n{ex.Message}\n{ex.StackTrace}{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
         }
@@ -115,6 +115,8 @@ namespace TEAMModelOS.Controllers
                 List<dynamic> debates = new List<dynamic>();
                 request.TryGetProperty("source", out JsonElement _source);
                 request.TryGetProperty("tmdid", out JsonElement _tmdid);
+                request.TryGetProperty("userType", out JsonElement _userType);
+                request.TryGetProperty("keyWord", out JsonElement _keyWord);
                 request.TryGetProperty("comid", out JsonElement _comid);
                 if (request.TryGetProperty("code", out JsonElement code))
                 {
@@ -122,9 +124,13 @@ namespace TEAMModelOS.Controllers
                     if (!string.IsNullOrEmpty($"{_source}")) {
                         stringBuilder.Append($" and c.source='{_source}'");
                     }
-                    if (!string.IsNullOrEmpty($"{_tmdid}"))
+                    if (!string.IsNullOrEmpty($"{_tmdid}") && !string.IsNullOrWhiteSpace($"{_userType}"))
                     {
-                        stringBuilder.Append($" and c.tmdid='{_tmdid}'");
+                        stringBuilder.Append($" and c.tmdid='{_tmdid}' and c.userType='{_userType}'");
+                    }
+                    if (!string.IsNullOrEmpty($"{_keyWord}"))
+                    {
+                        stringBuilder.Append($" and contains(c.title,'{_keyWord}') ");
                     }
                     if (!string.IsNullOrEmpty($"{_comid}"))
                     {