|
@@ -130,7 +130,7 @@ namespace TEAMModelOS.Controllers
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
foreach (Student stu in students)
|
|
|
{
|
|
|
- var response = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync(stu.id, new PartitionKey($"{stu.code}"));
|
|
|
+ var response = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync(stu.id, new PartitionKey($"Base-{stu.code}"));
|
|
|
if (response.Status == 200)
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(response.ContentStream);
|
|
@@ -140,19 +140,6 @@ namespace TEAMModelOS.Controllers
|
|
|
await client.GetContainer(Constant.TEAMModelOS, "Student").ReplaceItemAsync(stuInfo, stuInfo.id, new PartitionKey($"{stuInfo.code}"));
|
|
|
}
|
|
|
}
|
|
|
- /*Class classroom = new Class();
|
|
|
- if (!requert.TryGetProperty("classroom", out JsonElement room)) return BadRequest();
|
|
|
- //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
|
|
|
- classroom = room.ToObject<Class>();
|
|
|
-
|
|
|
- var sresponse = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(classroom.id, new PartitionKey($"{classroom.code}"));
|
|
|
- if (sresponse.Status == 200)
|
|
|
- {
|
|
|
- using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
|
|
|
- Class classroom1 = json.ToObject<Class>();
|
|
|
- //classroom1.students = classroom.students;
|
|
|
- var response = await client.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(classroom1, classroom1.id, new PartitionKey($"{classroom.code}"));
|
|
|
- }*/
|
|
|
return Ok(new { students });
|
|
|
}
|
|
|
catch (Exception ex)
|