|
@@ -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}"))
|
|
|
{
|