CrazyIter_Bin 1 year ago
parent
commit
3e5fa55a62

+ 28 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/GroupList.cs

@@ -2,6 +2,7 @@ using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.Text;
+using TEAMModelOS.SDK.DI;
 
 namespace TEAMModelOS.SDK.Models
 {
@@ -347,6 +348,33 @@ namespace TEAMModelOS.SDK.Models
 
     public class GroupListDto
     {
+        public GroupListDto() { }
+        public GroupListDto(RGroupList groupList) {
+
+            this.id = groupList.id;
+            this.code = groupList.code;
+            this.periodId = groupList.periodId;
+            this.pk = groupList.pk;
+            this.name = groupList.name;
+            this.school = groupList.school;
+            this.creatorId = groupList.creatorId;
+            this.no = groupList.no;
+            this.scope = groupList.scope;
+            this.type = groupList.type;
+            this.scount = groupList.scount;
+            this.tcount = groupList.tcount;
+            this.leader = groupList.leader;
+            this.year = groupList.year;
+            this.expire = groupList.expire;
+            this.froms = groupList.froms;
+            this.joinLock = groupList.joinLock;
+            this.qrcodeExpire = groupList.qrcodeExpire;
+            this.qrcodeDays = groupList.qrcodeDays;
+            this.review=groupList.review;
+            this.limitCount = groupList.limitCount;
+            this.grades = groupList.grades;
+            this.graduate = groupList.graduate;
+        }
         public string pk { get; set; }
         public string id { get; set; }
        

+ 2 - 1
TEAMModelOS/Controllers/Both/CourseBaseController.cs

@@ -497,7 +497,8 @@ namespace TEAMModelOS.Controllers.Both
                                     }
                                 }else
                                 {
-                                    groups= await GroupListService.GetGroupListByListids(_azureCosmos.GetCosmosClient(), _dingDing, groupIds.ToList(), school);
+                                    var groupList =   await GroupListService.GetMemberByListids(_coreAPIHttpService,  _azureCosmos.GetCosmosClient(), _dingDing, groupIds.ToList(), school);
+                                    groups= groupList.groups.Select(z => new GroupListDto(z)).ToList();
                                     string teacherSQLBase = $"select     c.id,c.name,c.picture from c where  c.id   in ({string.Join(",", teacherIds.Select(z => $"'{z}'"))}) ";
                                     var resultBase = await client.GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetList<IdNameCode>(teacherSQLBase, $"Base");
                                     teachersBases = resultBase.list;

+ 16 - 0
TEAMModelOS/Controllers/Both/GroupListController.cs

@@ -1326,5 +1326,21 @@ namespace TEAMModelOS.Controllers
             }
             return Ok();
         }
+
+
+        /// <summary>
+        /// 教师任教的课程
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [AuthToken(Roles = "teacher,admin")]
+        [HttpPost("activity-grouplist")]
+#if !DEBUG
+        [Authorize(Roles = "IES")]
+#endif
+        public async Task<IActionResult> ActivityGrouplist(JsonElement request) {
+            return Ok();
+        }
     }
 }