|
@@ -143,6 +143,13 @@ namespace TEAMModelOS.SDK
|
|
{
|
|
{
|
|
location = "Global";
|
|
location = "Global";
|
|
}
|
|
}
|
|
|
|
+ replaceData.Add("notifyCode", notifyCode);
|
|
|
|
+ replaceData.Add("location", site);
|
|
|
|
+ if (replaceData.ContainsKey("schoolId"))
|
|
|
|
+ {
|
|
|
|
+ replaceData.Add("scope", "school");
|
|
|
|
+ }
|
|
|
|
+ else { replaceData.Add("scope", "private"); }
|
|
var token = CoreTokenExtensions.CreateAccessToken(clientID, clientSecret, location).Result;
|
|
var token = CoreTokenExtensions.CreateAccessToken(clientID, clientSecret, location).Result;
|
|
_httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {token.AccessToken}");
|
|
_httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {token.AccessToken}");
|
|
foreach (var group in groups)
|
|
foreach (var group in groups)
|
|
@@ -153,13 +160,7 @@ namespace TEAMModelOS.SDK
|
|
if (JsonDocument.TryParseValue(ref reader, out JsonDocument jsonDoc) && jsonDoc.RootElement.TryGetProperty(notifyCode, out JsonElement json))
|
|
if (JsonDocument.TryParseValue(ref reader, out JsonDocument jsonDoc) && jsonDoc.RootElement.TryGetProperty(notifyCode, out JsonElement json))
|
|
{
|
|
{
|
|
List<string> msgs = json.ToObject<List<string>>();
|
|
List<string> msgs = json.ToObject<List<string>>();
|
|
- replaceData.Add("notifyCode", notifyCode);
|
|
|
|
- replaceData.Add("location", site);
|
|
|
|
- if (replaceData.ContainsKey("schoolId"))
|
|
|
|
- {
|
|
|
|
- replaceData.Add("scope", "school");
|
|
|
|
- }
|
|
|
|
- else { replaceData.Add("scope", "private"); }
|
|
|
|
|
|
+
|
|
if (msgs.IsNotEmpty())
|
|
if (msgs.IsNotEmpty())
|
|
{
|
|
{
|
|
var tags = group.list.Select(x => $"{x.id}_{notifyType}");
|
|
var tags = group.list.Select(x => $"{x.id}_{notifyType}");
|