CrazyIter_Bin 3 jaren geleden
bovenliggende
commit
455e05abf1

+ 46 - 44
TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs

@@ -961,9 +961,39 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                                 msgs.Add(update);
                                 break;
                             //更新 基础统计信息
-                            //case "up-base":
-                               
-                            //    break;
+                            case "up-base":
+                                //如果有更新 则去读取/{_lessonId}/IES/base.json
+                                try
+                                {
+                                    BlobDownloadResult baseblobDownload = await _azureStorage.GetBlobContainerClient(blobname).GetBlobClient($"/{_lessonId}/IES/base.json").DownloadContentAsync();
+                                    LessonBase lessonBase = baseblobDownload.Content.ToObjectFromJson<LessonBase>();
+                                    if (lessonBase != null)
+                                    {
+                                        lessonRecord.attendCount = lessonRecord.attendCount;
+                                        lessonRecord.clientCount = lessonRecord.clientCount;
+                                        lessonRecord.attendRate = lessonRecord.attendRate;
+                                        lessonRecord.groupCount = lessonRecord.groupCount;
+                                        lessonRecord.collateTaskCount = lessonRecord.collateTaskCount;
+                                        lessonRecord.collateCount = lessonRecord.collateCount;
+                                        lessonRecord.pushCount = lessonRecord.pushCount;
+                                        lessonRecord.totalPoint = lessonRecord.totalPoint;
+                                        lessonRecord.examQuizCount = lessonRecord.examQuizCount;
+                                        lessonRecord.interactionCount = lessonRecord.interactionCount;
+                                        lessonRecord.examPointRate = lessonRecord.examPointRate;
+                                        lessonRecord.clientInteractionCount = lessonRecord.clientInteractionCount;
+                                        lessonRecord.clientInteractionAverge = lessonRecord.clientInteractionAverge;
+                                    }
+                                    msgs.Add(update);
+                                }
+                                catch (RequestFailedException ex) when (ex.Status == 404)
+                                {
+                                    msgs.Add(new LessonUpdate { grant_type = "up-base-404" });
+                                }
+                                catch (Exception ex)
+                                {
+                                    await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}课程读取base.json,{_lessonId}\n{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
+                                }
+                                break;
 
                             //更新 时间线
                             case "up-TimeLine":
@@ -977,23 +1007,25 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                                 //var activityInfos = ActivityInfoblobDownload.Content.ToObjectFromJson<List<LessonActivityInfo>>();
                                 msgs.Add(update);
                                 break;
-                            //case "up-baseinfo":
-                            //    if (updates.Count > 1)
-                            //    {
-                            //        isReplace = true;
-                            //    }
-                            //    else {
-                            //        isReplace = false;
-                            //    }
-                            //    msgs.Add(update);
-                            //    break;
+                                ///更新基础信息,名称科目,年级,分类等。
+                            case "up-baseinfo":
+                                if (updates.Count > 1)
+                                {
+                                    isReplace = true;
+                                }
+                                else
+                                {
+                                    isReplace = false;
+                                }
+                                msgs.Add(update);
+                                break;
                             case "delete":
                                 try
                                 {
                                     await client.GetContainer(Constant.TEAMModelOS, tbname).DeleteItemAsync<LessonRecord>(lessonId, new PartitionKey(code));
                                     msgs.Add(update);
                                 }
-                                catch (CosmosException ex)
+                                catch (CosmosException)
                                 {
                                     msgs.Add(update);
                                 }
@@ -1092,36 +1124,6 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                     }
                     //如果被删除则不能再被更新
                     if (isReplace) {
-                        //如果有更新 则去读取/{_lessonId}/IES/base.json
-                        try
-                        {
-                            BlobDownloadResult baseblobDownload = await _azureStorage.GetBlobContainerClient(blobname).GetBlobClient($"/{_lessonId}/IES/base.json").DownloadContentAsync();
-                            LessonBase lessonBase = baseblobDownload.Content.ToObjectFromJson<LessonBase>();
-                            if (lessonBase != null)
-                            {
-                                lessonRecord.attendCount = lessonRecord.attendCount;
-                                lessonRecord.clientCount = lessonRecord.clientCount;
-                                lessonRecord.attendRate = lessonRecord.attendRate;
-                                lessonRecord.groupCount = lessonRecord.groupCount;
-                                lessonRecord.collateTaskCount = lessonRecord.collateTaskCount;
-                                lessonRecord.collateCount = lessonRecord.collateCount;
-                                lessonRecord.pushCount = lessonRecord.pushCount;
-                                lessonRecord.totalPoint = lessonRecord.totalPoint;
-                                lessonRecord.examQuizCount = lessonRecord.examQuizCount;
-                                lessonRecord.interactionCount = lessonRecord.interactionCount;
-                                lessonRecord.examPointRate = lessonRecord.examPointRate;
-                                lessonRecord.clientInteractionCount = lessonRecord.clientInteractionCount;
-                                lessonRecord.clientInteractionAverge = lessonRecord.clientInteractionAverge;
-                            }
-                            msgs.Add(new LessonUpdate { grant_type = "up-base" });
-                        }
-                        catch (RequestFailedException ex) when (ex.Status == 404)
-                        {
-                            msgs.Add(new LessonUpdate { grant_type = "up-base-404" });
-                        }
-                        catch (Exception ex) {
-                            await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}课程读取base.json,{_lessonId}\n{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
-                        }
                         await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).ReplaceItemAsync<LessonRecord>(lessonRecord, lessonId, new PartitionKey(code));
                     }
                     //计算课堂更新前后的差值

+ 75 - 164
TEAMModelOS.SDK/Models/Cosmos/Common/LessonRecord.cs

@@ -170,51 +170,12 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public int clientInteractionAverge { get; set; } = 0;
     }
-
-    public class LessonActivityInfo
-    {
-        /// <summary>
-        /// 时间点
-        /// </summary>
-        public List<LessonTC> count { get; set; } = new List<LessonTC>();
-        /// <summary>
-        /// 事件类型
-        /// </summary>
-        public string @event { get; set; }
-        /// <summary>
-        /// 页面id
-        /// </summary>
-        public string pgId { get; set; }
-    }
-    public class LessonStudent
-    {
-        public string id { get; set; }
-        public string name { get; set; }
-        public string type { get; set; }
-        public string code { get; set; }
-        public string picture { get; set; }
-        public string irs { get; set; }
-    }
     public class LessonTC
     {
         public string t { get; set; }
         public double c { get; set; }
     }
-    public class LessonTimeLine
-    {
-        /// <summary>
-        /// 时间点
-        /// </summary>
-        public double time { get; set; }
-        /// <summary>
-        /// 事件类型
-        /// </summary>
-        public string @event { get; set; }
-        /// <summary>
-        /// 页面id
-        /// </summary>
-        public string pgId { get; set; }
-    }
+    
     public class LessonUpdate
     {
         public string grant_type { get; set; }
@@ -290,66 +251,56 @@ namespace TEAMModelOS.SDK.Models
         /// 
         /// </summary>
         public string endTime { get; set; }
+         
+
         /// <summary>
-        /// 
-        /// </summary>
-        public int attendCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int clientCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public double attendRate { get; set; }
-        /// <summary>
-        /// 
+        /// 总人数
         /// </summary>
-        public int groupCount { get; set; }
+        public int clientCount { get; set; } = 0;
         /// <summary>
-        /// 
+        ///出席率
         /// </summary>
-        public double totalPoint { get; set; }
+        public double attendRate { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 小组数
         /// </summary>
-        public double totalInteractPoint { get; set; }
+        public int groupCount { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 任务总数,作品收集任务数
         /// </summary>
-        public int collateTaskCount { get; set; }
+        public int collateTaskCount { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 作品总数
         /// </summary>
-        public int collateCount { get; set; }
+        public int collateCount { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 推送总数(页面,资源,讯息,差异化)
         /// </summary>
-        public int pushCount { get; set; }
+        public int pushCount { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 总计分
         /// </summary>
-        public int examCount { get; set; }
+        public double totalPoint { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 测验总题数
         /// </summary>
-        public int examQuizCount { get; set; }
+        public int examQuizCount { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 互动题数
         /// </summary>
-        public double examPointRate { get; set; }
+        public int interactionCount { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 测验得分率
         /// </summary>
-        public int interactionCount { get; set; }
+        public double examPointRate { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 学生互动总数
         /// </summary>
-        public int clientInteractionCount { get; set; }
+        public int clientInteractionCount { get; set; } = 0;
         /// <summary>
-        /// 
+        /// 学生互动率
         /// </summary>
-        public double clientInteractionAverge { get; set; }
+        public int clientInteractionAverge { get; set; } = 0;
     }
 
     public class QuizSummaryList
@@ -434,100 +385,17 @@ namespace TEAMModelOS.SDK.Models
         /// 
         /// </summary>
         public List<ClientSummaryList> clientSummaryList { get; set; }
-        /// <summary>
-        /// 测试新版名单222-罗老师 小课堂
-        /// </summary>
-        public string activityName { get; set; }
-        /// <summary>
-        /// 罗老师
-        /// </summary>
-        public string hostName { get; set; }
-        /// <summary>
-        /// 全客观题
-        /// </summary>
-        public string meterialName { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public string date { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public string startTime { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public string endTime { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int attendCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int clientCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public double attendRate { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int groupCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public double totalPoint { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public double totalInteractPoint { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int collateTaskCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int collateCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int pushCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int examCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int examQuizCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public double examPointRate { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int interactionCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public int clientInteractionCount { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public double clientInteractionAverge { get; set; }
+        
     }
 
     public class StudentItem
     {
         /// <summary>
-        /// 
+        /// 学生id
         /// </summary>
         public string id { get; set; }
         /// <summary>
-        /// 
+        /// 座号
         /// </summary>
         public int seatID { get; set; }
         /// <summary>
@@ -535,10 +403,53 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public string name { get; set; }
         /// <summary>
-        /// 
+        /// 学生类型
         /// </summary>
         public int type { get; set; }
+        /// <summary>
+        /// 头像
+        /// </summary>
+        public string picture { get; set; }
     }
 
-     
+    //public class LessonActivityInfo
+    //{
+    //    /// <summary>
+    //    /// 时间点
+    //    /// </summary>
+    //    public List<LessonTC> count { get; set; } = new List<LessonTC>();
+    //    /// <summary>
+    //    /// 事件类型
+    //    /// </summary>
+    //    public string @event { get; set; }
+    //    /// <summary>
+    //    /// 页面id
+    //    /// </summary>
+    //    public string pgId { get; set; }
+    //}
+    //public class LessonStudent
+    //{
+    //    public string id { get; set; }
+    //    public string name { get; set; }
+    //    public string type { get; set; }
+    //    public string code { get; set; }
+    //    public string picture { get; set; }
+    //    public string irs { get; set; }
+    //}
+
+    //public class LessonTimeLine
+    //{
+    //    /// <summary>
+    //    /// 时间点
+    //    /// </summary>
+    //    public double time { get; set; }
+    //    /// <summary>
+    //    /// 事件类型
+    //    /// </summary>
+    //    public string @event { get; set; }
+    //    /// <summary>
+    //    /// 页面id
+    //    /// </summary>
+    //    public string pgId { get; set; }
+    //}
 }

+ 10 - 12
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -83,7 +83,7 @@ namespace TEAMModelOS.Controllers.Client
             if (!request.TryGetProperty("tmdid", out JsonElement _tmdid)) return BadRequest();
             request.TryGetProperty("school", out JsonElement _school);
             if (!request.TryGetProperty("scope", out JsonElement _scope)) return BadRequest();
-            if (!request.TryGetProperty("grant_types", out JsonElement _grant_types)) return BadRequest();
+            request.TryGetProperty("grant_types", out JsonElement _grant_types);
             string tbname ;
             string code ;
 
@@ -104,24 +104,22 @@ namespace TEAMModelOS.Controllers.Client
             try
             {
                 LessonRecord lessonRecord = await client.GetContainer(Constant.TEAMModelOS, tbname).ReadItemAsync<LessonRecord>($"{_lessonId}", new PartitionKey(code));
+                List<LessonUpdate> updates = _grant_types.ToObject<List<LessonUpdate>>();
                 if (_grant_types.ValueKind.Equals(JsonValueKind.Array))
                 {
-                    List<LessonUpdate> updates = _grant_types.ToObject<List<LessonUpdate>>();
-                    if (updates.IsNotEmpty())
+                    if (updates.IsEmpty())
                     {
-                        var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
-                        var messageChange = new ServiceBusMessage(request.ToJsonString());
-                        messageChange.ApplicationProperties.Add("name", "LessonRecordEvent");
-                        await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageChange);
-                        return Ok(new { status = 200});
-                    }
-                    else {
-                        return BadRequest();
+                        updates.Add(new LessonUpdate { grant_type = "up-base" });
                     }
                 }
                 else {
-                    return BadRequest();
+                    updates.Add(new LessonUpdate { grant_type = "up-base" });
                 }
+                var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
+                var messageChange = new ServiceBusMessage(request.ToJsonString());
+                messageChange.ApplicationProperties.Add("name", "LessonRecordEvent");
+                await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageChange);
+                return Ok(new { status = 200 });
             }
             catch (CosmosException ex) when (ex.Status==404 ) {
                 return BadRequest("课堂记录不存在");

+ 67 - 3
TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs

@@ -62,7 +62,7 @@ namespace TEAMModelOS.Controllers
                     stulist.Add(x.stulist);
                 }
             });
-            List<string> types = new List<string> { "Exam", "Survey", "Vote" };
+            List<string> types = new List<string> { "Exam", "Survey", "Vote","Homework" };
             List<MQActivity> datas = new List<MQActivity>();
             List<KeyValuePair<string, int>> count = new List<KeyValuePair<string, int>>();
             foreach (var type in types)
@@ -139,11 +139,75 @@ namespace TEAMModelOS.Controllers
                 KeyValuePair<string, int> valuePair = new KeyValuePair<string, int>(type, acount);
                 count.Add(valuePair);
             }
-            return Ok(new { totalCount = count, goingDatas = datas });
-        }
+            //课程统计 个人和学校  分别对应的教学的班级有多少
+            List<CourseCount> privateCourse = new List<CourseCount>();
+            string courseSql = $" SELECT a.teacherId,a.classId,  a.stulist,c.id,c.name FROM c  join a in c.schedule where a.teacherId='{id}'  ";
+            await foreach(var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<CourseCount>(courseSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{id}") })){
+                privateCourse.Add(item);
+            }
+            List<CourseCount> schoolCourse = new List<CourseCount>();
+            if (!string.IsNullOrEmpty(school)) {
+                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<CourseCount>(courseSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school}") }))
+                {   
+                    schoolCourse.Add(item);
+                }
+            }
+            //涉及的课程清单数量(去重),与排课无关,排课涉及周期问题,暂不进行统计
+            int privateCourseCount= privateCourse.Select(x => x.id).ToHashSet().Count();
+            int schoolCourseCount = schoolCourse.Select(x => x.id).ToHashSet().Count();
+            //行政班教学数量,去重。
+            HashSet<string> classIds = new HashSet<string>();
+            HashSet<string> teachIds = new HashSet<string>();
+            HashSet<string> stulists = new HashSet<string>();
+            privateCourse.ForEach(x => {
+                if (!string.IsNullOrWhiteSpace(x.classId))
+                {
+                    classIds.Add(x.classId);
+                }
+                if (!string.IsNullOrWhiteSpace(x.stulist))
+                {
+                    stulists.Add(x.stulist);
+                }
+            });
+            schoolCourse.ForEach(x => {
+                if (!string.IsNullOrWhiteSpace(x.classId))
+                {
+                    classIds.Add(x.classId);
+                }
+                if (!string.IsNullOrWhiteSpace(x.stulist))
+                {
+                    teachIds.Add(x.stulist);
+                }
+            });
 
+            string countItemPaperSql = $" SELECT value(count(1)) FROM c   ";
+            int privateItemCount = 0;
+            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<int>(countItemPaperSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{id}") }))
+            {
+                privateItemCount=item;
+            }
+            int privatePaperCount = 0;
+            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<int>(countItemPaperSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{id}") }))
+            {
+                privatePaperCount = item;
+            }
 
+            int privateSyllabusCount = 0;
+            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<int>(countItemPaperSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Syllabus-{id}") }))
+            {
+                privateSyllabusCount = item;
+            }
+            return Ok(new { totalCount = count, goingDatas = datas, privateCourseCount, schoolCourseCount , classIdsCount= classIds.Count(), teachIdsCount= teachIds.Count(),   stulistsCount = stulists.Count(), privateItemCount , privatePaperCount, privateSyllabusCount });
+        }
 
+
+        public class CourseCount{
+            public string id { get; set; }
+            public string teacherId { get; set; }
+            public string classId { get; set; }
+            public string stulist { get; set; }
+            public string name { get; set; }
+        }
         /// <summary>
         /// 教师端,查询活动所有活动类型的列表,班主任,任课教师等
         /// 执教班级

+ 3 - 1
TEAMModelOS/Controllers/Third/Sc/ScDataInitController.cs

@@ -233,6 +233,7 @@ namespace TEAMModelOS.Controllers.Third
                         x.Email = tt.Email;
                         x.areaId = $"{areaId}";
                         x.PartitionKey = "ScTeacher";
+                        x.tmdid = null;
                         var school = ScSchools.Find(s => s.schoolid == x.SchoolID);
                         x.schoolCode = school?.schoolCode;
                     }
@@ -280,6 +281,7 @@ namespace TEAMModelOS.Controllers.Third
                         x.Email = tt.Email;
                         x.areaId = $"{areaId}";
                         x.PartitionKey = "ScTeacher";
+                        x.tmdid = null;
                         var school = ScSchools.Find(s => s.schoolid == x.SchoolID);
                         x.schoolCode = school?.schoolCode;
                     }
@@ -344,7 +346,7 @@ namespace TEAMModelOS.Controllers.Third
             {
                 await table.SaveOrUpdateAll(updateTch);
             }
-            return Ok(new { update = updateTch.Select(x => new { x.areaId, x.PXID, x.TID, x.TeacherName, x.tmdid, x.SchoolName, x.DisName }), ScTeachers });
+            return Ok(new { addTeachers, update = updateTch.Select(x => new { x.areaId, x.PXID, x.TID, x.TeacherName, x.tmdid, x.SchoolName, x.DisName }), ScTeachers });
         }
         /// <summary>
         ///1. 检查学校是否有同名的

+ 13 - 3
TEAMModelOS/Controllers/XTest/TestController.cs

@@ -1,3 +1,4 @@
+using Azure;
 using Azure.Cosmos;
 using Azure.Messaging.ServiceBus;
 using Azure.Storage.Blobs.Models;
@@ -653,18 +654,27 @@ namespace TEAMModelOS.Controllers
         [HttpPost("get-ip")]
         public async Task<IActionResult> GetIp(JsonElement request)
         {
-            LessonBase lessonBases = request.ToObject< LessonBase>();
+
+
+            try {
+                BlobDownloadResult baseblobDownload = await _azureStorage.GetBlobContainerClient("hbcn").GetBlobClient($"/111/IES/base.json").DownloadContentAsync();
+                LessonBase lessonBase = baseblobDownload.Content.ToObjectFromJson<LessonBase>();
+            
+            } catch (RequestFailedException ex)when(ex.Status==404) {
+                return BadRequest("文件不存在!");
+            }
+            LessonBase lessonBases = request.ToObject<LessonBase>();
 
             //List<TmdInfo> tmds= request.ToObject<List<TmdInfo>>();
             //var content = new StringContent(tmds.Select(x=>x.id).ToJsonString(), Encoding.UTF8, "application/json");
             //string json = await _coreAPIHttpService.GetUserInfos(content);
 
-           
+
             //string _researchKey = Regex.Replace($"{request.GetProperty("key")}", "[ \\[ \\] \\^ \\-|()【】/' {}_*×――(^)$%~!@#$…&%¥—+=<>《》!!???::•`·、。,;,.;\"‘’“”-]", " ");
             //string[] mm = Regex.Split(_researchKey, "\\s+", RegexOptions.IgnoreCase);
             //var token = await CoreTokenExtensions.CreateAccessToken("c7317f88-7cea-4e48-ac57-a16071f7b884", "kguxh:V.PLmxBdaI@jnrTrDSth]A3346", "China");
             //string ip = await _searcher.SearchIpAsync($"{request.GetProperty("ip")}");
-           // return Ok(new { activity, ip, token.AccessToken,token.TokenType,token.IdToken, mm });
+            // return Ok(new { activity, ip, token.AccessToken,token.TokenType,token.IdToken, mm });
             return Ok(lessonBases);
         }