CrazyIter_Bin 1 year ago
parent
commit
c3becf881f

+ 2 - 1
TEAMModelOS/Controllers/Client/HiTAControlller.cs

@@ -241,6 +241,7 @@ namespace TEAMModelOS.Controllers.Client
                 auth_token = JwtAuthExtension.CreateAuthToken(_option.HostName, id_token.Payload.Sub, $"{name}",$"{picture}", _option.JwtSecretKey, Website: "IES", scope: Constant.ScopeTeacher, schoolID: join.school, areaId: school.areaId, standard: school.standard, roles: schoolTeacher.roles.ToArray(), permissions:schoolTeacher.permissions.ToArray(), expire: 1);
 
             }
+            await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate { client="hita", count=1, id=school.id, key="teacher_login", name="醍摩豆账号登录", scope="school", target=school.id });
             return Ok(new { periodSubjects,auth_token });
         }
 
@@ -606,7 +607,7 @@ namespace TEAMModelOS.Controllers.Client
                         _ = _httpTrigger.RequestHttpTrigger(new { school = defaultschool, scope = $"{Constant.ScopeTeacher}", id = $"{id}", ip = $"{ip}", expire = 1 }, _option.Location, "online-record");
                     }
                     catch { }
-
+                    await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate { client="hita", count=1, id="ies", key="tmd_login", name="醍摩豆账号登录", scope="ies", target="ies" });
                     return Ok(new { schools, defaultschool, courses, size, resCount, itemCount, paperCount, activityCount });
                 }
                 else //無此老師

+ 2 - 1
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -1886,7 +1886,7 @@ namespace TEAMModelOS.Controllers.Client
                 var (blob_uri, blob_sas) = _azureStorage.GetBlobContainerSAS(id, BlobContainerSasPermissions.Write | BlobContainerSasPermissions.Read | BlobContainerSasPermissions.List | BlobContainerSasPermissions.Delete);
                 var (blob_uri_read, blob_sas_read) = _azureStorage.GetBlobContainerSAS(id, BlobContainerSasPermissions.Read);
                 var (blob_uri_write, blob_sas_write) = _azureStorage.GetBlobContainerSAS(id, BlobContainerSasPermissions.Write);
-
+                await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate { client="hiteach", count=1, id="ies", key="tmd_login", name="醍摩豆账号登录", scope="ies", target="ies" });
                 return Ok(new { blob_uri, blob_sas, blob_sas_read, blob_sas_write, schools, defaultschool, courses, exams });
 
             }
@@ -2460,6 +2460,7 @@ namespace TEAMModelOS.Controllers.Client
                 var (blob_uri, blob_sas) = _azureStorage.GetBlobContainerSAS(school_code_blob, BlobContainerSasPermissions.Read | BlobContainerSasPermissions.List | BlobContainerSasPermissions.Write); //讀列
                 var (blob_uri_read, blob_sas_read) = _azureStorage.GetBlobContainerSAS(school_code_blob, BlobContainerSasPermissions.Read); //讀
                 var (blob_uri_write, blob_sas_write) = _azureStorage.GetBlobContainerSAS(school_code_blob, BlobContainerSasPermissions.Write); //寫 
+                await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate { client="hiteach", count=1, id=school_base.id, key="teacher_login", name="醍摩豆账号登录", scope="school", target=school_base.id });
                 return Ok(new { blob_uri, blob_sas, blob_sas_read, blob_sas_write, periods, grades, subjects, courses, examTypes, exams });
             }
             catch (Exception ex)

+ 2 - 1
TEAMModelOS/Controllers/Client/HiTeachccControlller.cs

@@ -22,6 +22,7 @@ using TEAMModelOS.SDK;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
+using TEAMModelOS.SDK.Models.Service;
 using TEAMModelOS.SDK.Services;
 
 namespace TEAMModelOS.Controllers.Client
@@ -365,7 +366,7 @@ namespace TEAMModelOS.Controllers.Client
                 await container.CreateIfNotExistsAsync(PublicAccessType.None); //嘗試創建Teacher私有容器,如存在則不做任何事,保障容器一定存在
                 var (blob_uri, blob_sas_read) = _azureStorage.GetBlobContainerSAS(id, BlobContainerSasPermissions.Read);
                 var (blob_uri_write, blob_sas_write) = _azureStorage.GetBlobContainerSAS(id, BlobContainerSasPermissions.Write);
-
+                await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate { client="hiteachcc", count=1, id="ies", key="tmd_login", name="醍摩豆账号登录", scope="ies", target="ies" });
                 return Ok(new { blob_uri, blob_sas_read, blob_sas_write });
             }
             catch (Exception ex)

+ 2 - 1
TEAMModelOS/Controllers/Teacher/InitController.cs

@@ -538,6 +538,7 @@ namespace TEAMModelOS.Controllers
                 //返回剩余空间
                 (long usedSize, long teach, long total, long surplus, Dictionary<string, double?> catalog) space =
                     await BlobService.GetSurplusSpace(teacherInfo.teacher.id, "private", _option.Location, _azureCosmos, _azureRedis, _azureStorage, _dingDing, _httpTrigger);
+                await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate {  client="web", count=1, id="ies", key="tmd_login", name="醍摩豆账号登录", scope="ies", target="ies"});
                 if (string.IsNullOrWhiteSpace(lang))
                 {
                     if (_option.Location.Contains("China"))
@@ -960,7 +961,7 @@ namespace TEAMModelOS.Controllers
                 //返回剩余空间
                 (long usedSize, long teach, long total, long surplus, Dictionary<string, double?> catalog) space =
                     await BlobService.GetSurplusSpace(school_base.id, "school", _option.Location, _azureCosmos, _azureRedis, _azureStorage, _dingDing, _httpTrigger);
-
+                await SystemService.RecordAccumulateData(_azureRedis, _dingDing, new SDK.Models.Dtos.Accumulate { client="web", count=1, id=school_code, key="teacher_login", name="醍摩豆账号登录", scope="school", target=school_code});
                 return Ok(new
                 {
                     privateShows = shows?.FindAll(x => x.Scope.Equals("private")).Select(x => new { x.Type, x.Status, x.Scope, x.Code }),