|
@@ -22,6 +22,7 @@ using HTEXLib.COMM.Helpers;
|
|
|
using TEAMModelOS.SDK.Models.Service;
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
using System.Net.Http;
|
|
|
+using TEAMModelOS.SDK;
|
|
|
|
|
|
namespace TEAMModelOS.Controllers
|
|
|
{
|
|
@@ -135,7 +136,6 @@ namespace TEAMModelOS.Controllers
|
|
|
schoolExtobj.status =sc.status;
|
|
|
schoolExtobj.time = sc.time;
|
|
|
schoolExtobj.picture = school.RootElement.GetProperty("picture");
|
|
|
-
|
|
|
var sctch = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(id, new PartitionKey($"Teacher-{sc.schoolId}"));
|
|
|
if (sctch.Status == 200)
|
|
|
{
|
|
@@ -154,6 +154,9 @@ namespace TEAMModelOS.Controllers
|
|
|
else {
|
|
|
schoolExtobj.size=0;
|
|
|
}
|
|
|
+ if (statusNow.Equals("join")) {
|
|
|
+ await TmdUserService.JoinSchool(client, teacher.id, teacher.picture, teacher.name, sc.schoolId, sc.name);
|
|
|
+ }
|
|
|
schools.Add(schoolExtobj);
|
|
|
}
|
|
|
}
|
|
@@ -610,6 +613,7 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, id, new PartitionKey("Base"));
|
|
|
var sresponse = await client.GetContainer(Constant.TEAMModelOS, "School").DeleteItemStreamAsync(id, new PartitionKey($"Teacher-{school_code}"));
|
|
|
+ //await TmdUserService.LeaveSchool(client, teacher.id, school.schoolId);
|
|
|
return Ok(new { stauts = 1 });
|
|
|
}
|
|
|
else {
|
|
@@ -639,6 +643,8 @@ namespace TEAMModelOS.Controllers
|
|
|
else {
|
|
|
steacher.permissions = dft;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
var response = await client.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(steacher, id, new PartitionKey($"Teacher-{school_code}"));
|
|
|
}
|
|
@@ -659,6 +665,9 @@ namespace TEAMModelOS.Controllers
|
|
|
};
|
|
|
var response = await client.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync(st, new PartitionKey($"Teacher-{school_code}"));
|
|
|
}
|
|
|
+ if (grant_type.ToString().Equals("join")) {
|
|
|
+ await TmdUserService.JoinSchool(client, teacher.id, teacher.picture, teacher.name, school.schoolId, school.name);
|
|
|
+ }
|
|
|
Notification notification = null;
|
|
|
|
|
|
List<SchoolTeacher> teachers = new List<SchoolTeacher>();
|