|
@@ -63,7 +63,6 @@ namespace TEAMModelOS.Controllers
|
|
|
try
|
|
|
{
|
|
|
if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
|
|
|
- if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
|
|
|
requert.TryGetProperty("ids", out JsonElement _stuids);
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
List<TchList> tchLists = new();
|
|
@@ -141,7 +140,7 @@ namespace TEAMModelOS.Controllers
|
|
|
tchList.code = $"TchList-{school}";
|
|
|
tchList.scope = "school";
|
|
|
tchList.ttl = -1;
|
|
|
- tchList = await upsertList(tchList, $"{school}");
|
|
|
+ tchList = await upsertList(tchList);
|
|
|
}
|
|
|
return Ok(new { tchList });
|
|
|
}
|
|
@@ -172,7 +171,7 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private async Task<TchList> upsertList(TchList tchList, string scope)
|
|
|
+ private async Task<TchList> upsertList(TchList tchList)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -181,7 +180,6 @@ namespace TEAMModelOS.Controllers
|
|
|
if (string.IsNullOrEmpty(tchList.no))
|
|
|
{
|
|
|
tchList.no = $"{Utils.CreatSaltString(6, "0123456789")}";
|
|
|
- //string table = $"{scope}" != "school" ? "Teacher" : "School";
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
{
|
|
|
var queryNo = $"SELECT c.no FROM c where c.no ='{tchList.no}'";
|
|
@@ -223,7 +221,7 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
type = tchList.type,
|
|
|
listid = tchList.id,
|
|
|
- scope = $"{scope}",
|
|
|
+ scope = "school",
|
|
|
originCode = tchList.school,
|
|
|
school = tchList.school,
|
|
|
creatorId = tchList.creatorId
|