Quellcode durchsuchen

开放平台课纲列表、册别列表、学校知识点列表

Li vor 2 Jahren
Ursprung
Commit
881a1d2d44

+ 21 - 0
TEAMModelOS.SDK/Models/Cosmos/OpenEntity/OSyllabus.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TEAMModelOS.SDK.Models
+{
+    public class OSyllabus: CosmosEntity
+    {
+        /// <summary>
+        /// 册别编码
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public List<OTnode> children { get; set; }
+        public string volumeId { get; set; }
+        public string codeval { get; set; }
+        public string scope { get; set; }
+    }
+}

+ 41 - 0
TEAMModelOS.SDK/Models/Cosmos/OpenEntity/OSyllabusTree.cs

@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TEAMModelOS.SDK.Models.Cosmos.Common;
+
+namespace TEAMModelOS.SDK.Models
+{
+    public class OSyllabusTree : OTnode
+    {
+        public OSyllabusTree()
+        {
+            children = new List<OSyllabusTree>();
+        }
+        public List<OSyllabusTree> children { get; set; }
+    }
+
+
+    public class OSyllabusTreeNode 
+    {
+        public OSyllabusTreeNode()
+        {
+            trees = new List<OSyllabusTree>();
+        }
+        /// <summary>
+        /// 课纲章节id
+        /// </summary>
+        public string id { get; set; }
+        /// <summary>
+        /// 册别的id
+        /// </summary>
+        public string volumeId { get; set; }
+        /// <summary>
+        /// 校本课纲时传入 学校编码,私人课纲时传入醍摩豆ID
+        /// </summary>
+        public string codeval { get; set; }
+        public string scope { get; set; }
+        public List<OSyllabusTree> trees { get; set; }
+    }
+}

+ 79 - 0
TEAMModelOS.SDK/Models/Cosmos/OpenEntity/OTnode.cs

@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TEAMModelOS.SDK.Models
+{
+    /// <summary>
+    /// 课纲节点父类
+    /// </summary>
+    public class OSnode
+    {
+
+        public string title { get; set; }
+
+    }
+
+    /// <summary>
+    /// 课纲节点父类
+    /// </summary>
+    public class OTnode:OSnode
+    {
+        [Required(ErrorMessage = "{0} 必须填写")]
+
+        public string id { get; set; } 
+        /// <summary>
+        /// 父级
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+
+        public string pid { get; set; }
+        /// <summary>
+        /// 排序
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+
+        public int order { get; set; }
+        //public List<string> points { get; set; } = new List<string> { "" };
+        public List<ORnode> rnodes { get; set; } = new List<ORnode>();
+        public List<string> cids { get; set; } = new List<string>();
+        /// <summary>
+        /// 谁创建的该节点
+        /// </summary>
+        public string creatorId { get; set; }
+        public string creatorName { get; set; }
+        public long updateTime { get; set; }
+    }
+
+    /// <summary>
+    /// 资源节点
+    /// </summary>
+    public class ORnode : OSnode
+    {
+        /// <summary>
+        /// item 试题 paper试卷 link外部链接 audio 音频,video 视频 ,doc文档,image图片,other 其他,res教材,thum缩略图
+        /// </summary>
+        public string type { get; set; }
+        public string id { get; set; }
+        public string code { get; set; }
+        public string scope { get; set; }
+        /// <summary>
+        /// blob 容器名
+        /// </summary>
+        public string cntr { get; set; }
+        /// <summary>
+        /// 存放地址 外部链接是绝对地址有http   blob是相对地址
+        /// </summary>
+        public string link { get; set; }
+        public string hash { get; set; }
+        public double duration { get; set; }
+        public long? size { get; set; }
+    }
+
+
+
+
+}

+ 59 - 0
TEAMModelOS.SDK/Models/Cosmos/OpenEntity/OVolume.cs

@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TEAMModelOS.SDK.Models
+{
+    public class OVolume: CosmosEntity
+    {
+        /// <summary>
+        /// 学段
+        /// </summary>
+        public string periodId { get; set; }
+
+        /// <summary>
+        /// 学科
+        /// </summary>
+
+        public string subjectId { get; set; }
+
+        /// <summary>
+        /// 年级
+        /// </summary>
+        public int gradeId { get; set; }
+
+        /// <summary>
+        /// 学期code
+        /// </summary>
+        public string semesterId { get; set; }
+
+        /// <summary>
+        /// 状态
+        /// </summary>
+
+        public int status { get; set; } = 1;
+
+        /// <summary>
+        /// 册别name
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string name { get; set; }
+
+        /// <summary>
+        /// 学校编码
+        /// </summary>
+        // [Required(ErrorMessage = "school 必须设置")]
+        public string school { get; set; }
+        /// <summary>
+        /// school|private
+        /// </summary>
+        [Required(ErrorMessage = "scope 必须设置")]
+        public string scope { get; set; }
+        public List<string> syllabusIds { get; set; } = new List<string>();
+        public int order { get; set; }
+        public long createTime { get; set; }
+    }
+}

+ 41 - 0
TEAMModelOS.SDK/Models/Service/Common/SyllabusService.cs

@@ -95,6 +95,7 @@ namespace TEAMModelOS.SDK.Services
             return GetChild(list, blockDict);
         }
 
+
         private static List<SyllabusTree> GetChild(List<SyllabusTree> list, Dictionary<string, SyllabusTree> dict)
         {
             //  list = list.OrderBy(m => m.Order).ToList();
@@ -114,5 +115,45 @@ namespace TEAMModelOS.SDK.Services
             }
             return trees;
         }
+
+
+        #region 开放平台使用
+
+
+
+        public static List<OSyllabusTree> OListToTree(List<OTnode> noes)
+        {
+            List<OSyllabusTree> list = noes.ToJsonString().ToObject<List<OSyllabusTree>>();
+            //var lookup = list.ToDictionary(n => n.RowKey, n => n);
+
+            var res = from r in list group r by r.id into g select g;
+            Dictionary<string, OSyllabusTree> blockDict = new Dictionary<string, OSyllabusTree>();
+            foreach (var s in res)
+            {
+                blockDict.TryAdd(s.First().id, s.First());
+            }
+            return GetChildO(list, blockDict);
+        }
+
+        private static List<OSyllabusTree> GetChildO(List<OSyllabusTree> list, Dictionary<string, OSyllabusTree> dict)
+        {
+            //  list = list.OrderBy(m => m.Order).ToList();
+            List<OSyllabusTree> trees = new List<OSyllabusTree>();
+            trees = trees.OrderBy(x => x.order).ToList();
+            foreach (OSyllabusTree node in list)
+            {
+                bool flag = dict.TryGetValue(node.pid, out OSyllabusTree syllabus);
+                if (flag && syllabus != null)
+                {
+                    syllabus.children.Add(node);
+                }
+                else
+                {
+                    trees.Add(node);
+                }
+            }
+            return trees;
+        }
+        #endregion
     }
 }

+ 61 - 0
TEAMModelOS/Controllers/OpenApi/Business/BizKnowledgeController.cs

@@ -0,0 +1,61 @@
+using Azure.Cosmos;
+using Google.Protobuf.WellKnownTypes;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Options;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.Filter;
+using TEAMModelOS.SDK;
+using TEAMModelOS.SDK.Context.Constant;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Models;
+using TEAMModelOS.SDK.Models.Dtos;
+
+namespace TEAMModelOS.Controllers
+{
+    [Route("business")]
+    [ApiController]
+    public class BizKnowledgeController : ControllerBase
+    {
+        public AzureCosmosFactory _azureCosmos;
+        private readonly AzureStorageFactory _azureStorage;
+        private readonly AzureRedisFactory _azureRedis;
+        private readonly DingDing _dingDing;
+        private readonly Option _option;
+        private readonly IConfiguration _configuration;
+        private readonly CoreAPIHttpService _coreAPIHttpService;
+        private readonly AzureServiceBusFactory _serviceBus;
+
+        public BizKnowledgeController(CoreAPIHttpService coreAPIHttpService, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option, IConfiguration configuration, AzureServiceBusFactory serviceBus)
+        {
+            _azureCosmos = azureCosmos;
+            _azureStorage = azureStorage;
+            _azureRedis = azureRedis;
+            _dingDing = dingDing;
+            _option = option?.Value;
+            _configuration = configuration;
+            _coreAPIHttpService = coreAPIHttpService;
+            _serviceBus = serviceBus;
+        }
+
+        /// <summary>
+        /// 查询知识点列表
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-knowledges")]
+        [ApiToken(Auth = "1701", Name = "获取知识点列表", RWN = "R", Limit = false)]
+        public async Task<IActionResult> GetKnowledges(JsonElement jsonElement)
+        {
+            var (id, school) = HttpContext.GetApiTokenInfo();
+            var responseDate = await OpenApiService.GetKnowledges(_azureCosmos, _dingDing, id, school, jsonElement);
+            return Ok(new { responseDate });
+        }
+    }
+}

+ 80 - 0
TEAMModelOS/Controllers/OpenApi/Business/BizSyllabusController.cs

@@ -0,0 +1,80 @@
+using Azure.Cosmos;
+using Google.Protobuf.WellKnownTypes;
+using HTEXLib.COMM.Helpers;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Options;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.Filter;
+using TEAMModelOS.SDK;
+using TEAMModelOS.SDK.Context.Constant;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Models;
+using TEAMModelOS.SDK.Models.Cosmos.Common;
+using TEAMModelOS.SDK.Models.Dtos;
+using TEAMModelOS.SDK.Services;
+
+namespace TEAMModelOS.Controllers
+{
+    [Route("business")]
+    [ApiController]
+    public class BizSyllabusController : ControllerBase
+    {
+        public AzureCosmosFactory _azureCosmos;
+        private readonly AzureStorageFactory _azureStorage;
+        private readonly AzureRedisFactory _azureRedis;
+        private readonly DingDing _dingDing;
+        private readonly Option _option;
+        private readonly IConfiguration _configuration;
+        private readonly CoreAPIHttpService _coreAPIHttpService;
+        private readonly AzureServiceBusFactory _serviceBus;
+        public BizSyllabusController(CoreAPIHttpService coreAPIHttpService, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option, IConfiguration configuration, AzureServiceBusFactory serviceBus)
+        {
+            _azureCosmos = azureCosmos;
+            _azureStorage = azureStorage;
+            _azureRedis = azureRedis;
+            _dingDing = dingDing;
+            _option = option?.Value;
+            _configuration = configuration;
+            _coreAPIHttpService = coreAPIHttpService;
+            _serviceBus = serviceBus;
+        }
+
+
+        /// <summary>
+        /// 查询课纲目
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-syllabus")]
+        [ApiToken(Auth = "1601", Name = "获取课纲列表", RWN = "R", Limit = false)]
+        public async Task<IActionResult> GetSyllabus(JsonElement jsonElement) 
+        {
+            var (id, school) = HttpContext.GetApiTokenInfo();
+            var responseDate = await OpenApiService.GetSyllabus(_azureCosmos, _dingDing, id, school, jsonElement);
+            return Ok(new { responseDate });
+        }
+
+        /// <summary>
+        /// 查询册别列表
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-volumes")]
+        [ApiToken(Auth = "1602", Name = "获取册别列表", RWN = "R", Limit = false)]
+        public async Task<IActionResult> GetVolumes(JsonElement jsonElement) 
+        {
+            var (id, school) = HttpContext.GetApiTokenInfo();
+            var responseDate = await OpenApiService.GetVolumes(_azureCosmos, _dingDing, id, school, jsonElement);
+            return Ok(new { responseDate });
+        }
+
+    }
+}

+ 167 - 0
TEAMModelOS/Controllers/OpenApi/OpenApiService.cs

@@ -22,6 +22,7 @@ using TEAMModelOS.SDK.Models.Table;
 using TEAMModelOS.SDK.Helper.Common.ReflectorExtensions;
 using TEAMModelOS.SDK.Context.Constant;
 using TEAMModelOS.SDK.Models.Dtos;
+using TEAMModelOS.SDK.Services;
 
 namespace TEAMModelOS.Controllers
 {
@@ -827,6 +828,172 @@ namespace TEAMModelOS.Controllers
                 return new ResponseData<List<OTeachers>>() { code = RespondCode.Error, msg = "服务器错误" };
             }
         }
+
+        /// <summary>
+        /// 查找课纲
+        /// [ApiToken(Auth = "1601", Name = "查询课纲", RWN = "R", Limit = false)]
+        /// </summary>
+        /// <param name="_azureCosmos"></param>
+        /// <param name="json"></param>
+        /// <returns></returns>
+        public static async Task<ResponseData<List<OSyllabusTreeNode>>> GetSyllabus(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json)
+        {
+            try
+            {
+                if (!json.TryGetProperty("volumeId", out JsonElement volumeId)) return new ResponseData<List<OSyllabusTreeNode>>() { code = RespondCode.ParamsError, msg = "参数错误" };
+                //if (!json.TryGetProperty("volumeCode", out JsonElement volumeCode)) return new ResponseData<List<OSyllabusTreeNode>>() { code = RespondCode.ParamsError, msg = "参数错误" };
+                if (!json.TryGetProperty("scope", out JsonElement scope)) return new ResponseData<List<OSyllabusTreeNode>>() { code = RespondCode.ParamsError, msg = "参数错误" };
+
+                var client = _azureCosmos.GetCosmosClient();
+
+                OVolume volume = null;
+                List<OSyllabusTreeNode> treeNodes = new();
+                List<OSyllabusTreeNode> redt = new();
+                if ($"{scope}".Equals("school"))
+                {
+                    List<OSyllabus> delSyllabus = new();
+                    volume = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<OVolume>($"{volumeId}", new PartitionKey($"Volume-{school}"));
+                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<OSyllabus>(queryText: $"select value(c) from c where c.volumeId='{volumeId}'",
+                        requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Syllabus-{volume.school}") }))
+                    {
+                        if (item.children.IsEmpty())
+                        {
+                            delSyllabus.Add(item);
+                        }
+                        else
+                        {
+                            List<OSyllabusTree> trees = SyllabusService.OListToTree(item.children);
+                            OSyllabusTreeNode otree = new() { id = item.id, scope = item.scope, trees = trees, volumeId = item.volumeId, codeval = volume.school };
+                            treeNodes.Add(otree);
+                        }
+                    }
+                    if (delSyllabus.IsNotEmpty())
+                    {
+                        await client.GetContainer(Constant.TEAMModelOS, "School").DeleteItemsAsync<OSyllabus>(delSyllabus.Select(x => x.id).ToList(), $"Syllabus-{volume.school}");
+                    }
+                }
+                else
+                    return new ResponseData<List<OSyllabusTreeNode>>() { code = RespondCode.ParamsError, msg = "参数错误" };
+
+                ResponseData<List<OSyllabusTreeNode>> responseData = new();
+                //对课纲树形结构排序
+                if (volume.syllabusIds.IsNotEmpty())
+                {
+                    volume.syllabusIds.ForEach(x =>
+                    {
+                        for (int index = 0; index < treeNodes.Count; index++)
+                        {
+                            if (treeNodes[index].id == x)
+                            {
+                                redt.Add(treeNodes[index]);
+                                treeNodes.RemoveAt(index);
+                            }
+                        }
+                    });
+                    redt.AddRange(treeNodes);
+                    responseData = new ResponseData<List<OSyllabusTreeNode>>() { code = RespondCode.Ok, msg = "成功", data = redt };
+                }
+                else
+                {
+                    responseData = new ResponseData<List<OSyllabusTreeNode>>() { code = RespondCode.Ok, msg = "成功", data = treeNodes };
+                }
+                return responseData;
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} OpenApiService/GetSyllabus()  参数:bizId:{bizId},school:{school},参数json:{json.ToJsonString()} \n  {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
+                return new ResponseData<List<OSyllabusTreeNode>>() { code = RespondCode.Error, msg = "服务器错误!" };
+            }
+        }
+
+        /// <summary>
+        /// 查询册别清单
+        /// [ApiToken(Auth = "1602", Name = "查询册别", RWN = "R", Limit = false)]
+        /// </summary>
+        /// <param name="_azureCosmos"></param>
+        /// <param name="_dingDing"></param>
+        /// <param name="json"></param>
+        /// <returns></returns>
+        public static async Task<ResponseData<List<OVolume>>> GetVolumes(AzureCosmosFactory _azureCosmos,DingDing _dingDing, string bizId, string school, JsonElement json)
+        {
+            try
+            {
+                ResponseData<List<OVolume>> responseData = new();
+
+                List<OVolume> ovolumes = new List<OVolume>();
+                json.TryGetProperty("periodId", out JsonElement periodCode);
+                json.TryGetProperty("subjectId", out JsonElement subjectCode);
+                json.TryGetProperty("status", out JsonElement status);
+                json.TryGetProperty("scope", out JsonElement scope);
+                if (scope.GetString().Equals("school"))
+                {
+                    await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<OVolume>(queryText: $"select value(c) from c where c.status = {status} and c.periodId = '{periodCode}' and c.subjectId = '{subjectCode}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Volume-{school}") }))
+                    {
+                        ovolumes.Add(item);
+                    }
+                }
+                else { return new ResponseData<List<OVolume>>() { code = RespondCode.ParamsError, msg = "参数错误" }; };
+
+                if (ovolumes.Count > 0)
+                {
+                    responseData = new ResponseData<List<OVolume>>() { code = RespondCode.Ok, msg = "成功", data = ovolumes };
+                }
+                else
+                    responseData = new ResponseData<List<OVolume>>() { code = RespondCode.NotFound, msg = "未找到参数相关的数据" };
+                return responseData;
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} OpenApiService/GetVolumes()  参数:bizId:{bizId},school:{school},参数json:{json.ToJsonString()} \n  {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
+                return new ResponseData<List<OVolume>>() { code = RespondCode.Error, msg = "服务器错误!" };
+            }
+        }
+
+        /// <summary>
+        /// 查询知识
+        /// [ApiToken(Auth = "1701", Name = "查询知识点", RWN = "R", Limit = false)]
+        /// </summary>
+        /// <param name="_azureCosmos"></param>
+        /// <param name="_dingDing"></param>
+        /// <param name="json"></param>
+        /// <returns></returns>
+        public static async Task<ResponseData<List<Knowledge>>> GetKnowledges(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json) 
+        {
+            try
+            {
+                ResponseData<List<Knowledge>> responseData = new();
+                var client = _azureCosmos.GetCosmosClient();
+
+                json.TryGetProperty("periodId", out JsonElement periodId);
+                if (!json.TryGetProperty("subjectId", out JsonElement subjectId)) return new ResponseData<List<Knowledge>>() { code = RespondCode.ParamsError, msg = "参数错误" };
+                //if (!json.TryGetProperty("school_code", out JsonElement school_code)) return new ResponseData<List<Knowledge>>() { code = RespondCode.ParamsError, msg = "参数错误" };
+                string code = $"Knowledge-{school}-{subjectId}";
+                StringBuilder sql = new($"select value(c) from c");
+                if (periodId.ValueKind.Equals(JsonValueKind.String))
+                {
+                    sql.Append($" where c.periodId = '{periodId}'");
+                }
+                List<Knowledge> knowledges = new();
+
+                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Knowledge>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                {
+                    knowledges.Add(item);
+                }
+                if (knowledges.Count > 0)
+                    responseData = new() { code = RespondCode.Ok, msg = "成功", data = knowledges };
+                else
+                    responseData = new() { code = RespondCode.NotFound, msg = "未找到相关" };
+
+                return responseData;
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} OpenApiService/GetKnowledges()  参数:bizId:{bizId},school:{school},参数json:{json.ToJsonString()} \n  {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
+                return new ResponseData<List<Knowledge>>() { code = RespondCode.Error, msg = "服务器错误!" };
+            }
+        }
+
+
         public static void GenApiTableRecord(AzureStorageFactory azureStorage)
         {
 

+ 56 - 0
TEAMModelOS/Controllers/OpenApi/OpenSchool/ScKnowledgeController.cs

@@ -0,0 +1,56 @@
+using Google.Protobuf.WellKnownTypes;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Options;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.Filter;
+using TEAMModelOS.SDK;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+
+namespace TEAMModelOS.Controllers
+{
+    [Route("school")]
+    [ApiController]
+    public class ScKnowledgeController : ControllerBase
+    {
+        public AzureCosmosFactory _azureCosmos;
+        private readonly AzureStorageFactory _azureStorage;
+        private readonly AzureRedisFactory _azureRedis;
+        private readonly DingDing _dingDing;
+        private readonly Option _option;
+        private readonly IConfiguration _configuration;
+        private readonly CoreAPIHttpService _coreAPIHttpService;
+        private readonly AzureServiceBusFactory _serviceBus;
+
+        public ScKnowledgeController(CoreAPIHttpService coreAPIHttpService, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option, IConfiguration configuration, AzureServiceBusFactory serviceBus)
+        {
+            _azureCosmos = azureCosmos;
+            _azureStorage = azureStorage;
+            _azureRedis = azureRedis;
+            _dingDing = dingDing;
+            _option = option?.Value;
+            _configuration = configuration;
+            _coreAPIHttpService = coreAPIHttpService;
+            _serviceBus = serviceBus;
+        }
+
+        /// <summary>
+        /// 查询知识点列表
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-knowledges")]
+        [ApiToken(Auth = "1701", Name = "获取知识点列表", RWN = "R", Limit = false)]
+        public async Task<IActionResult> GetKnowledges(JsonElement jsonElement)
+        {
+            var (id, school) = HttpContext.GetApiTokenInfo();
+            var responseDate = await OpenApiService.GetKnowledges(_azureCosmos, _dingDing, id, school, jsonElement);
+            return Ok(new { responseDate });
+        }
+
+    }
+}

+ 70 - 0
TEAMModelOS/Controllers/OpenApi/OpenSchool/ScSyllabusController.cs

@@ -0,0 +1,70 @@
+using Google.Protobuf.WellKnownTypes;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Options;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.Filter;
+using TEAMModelOS.SDK;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+
+namespace TEAMModelOS.Controllers
+{
+    [Route("school")]
+    [ApiController]
+    public class ScSyllabusController : ControllerBase
+    {
+        public AzureCosmosFactory _azureCosmos;
+        private readonly AzureStorageFactory _azureStorage;
+        private readonly AzureRedisFactory _azureRedis;
+        private readonly DingDing _dingDing;
+        private readonly Option _option;
+        private readonly IConfiguration _configuration;
+        private readonly CoreAPIHttpService _coreAPIHttpService;
+        private readonly AzureServiceBusFactory _serviceBus;
+
+        public ScSyllabusController(CoreAPIHttpService coreAPIHttpService, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option, IConfiguration configuration, AzureServiceBusFactory serviceBus)
+        {
+            _azureCosmos = azureCosmos;
+            _azureStorage = azureStorage;
+            _azureRedis = azureRedis;
+            _dingDing = dingDing;
+            _option = option?.Value;
+            _configuration = configuration;
+            _coreAPIHttpService = coreAPIHttpService;
+            _serviceBus = serviceBus;
+        }
+
+        /// <summary>
+        /// 查询课纲目
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-syllabus")]
+        [ApiToken(Auth = "1601", Name = "获取课纲列表", RWN = "R", Limit = false)]
+        public async Task<IActionResult> GetSyllabus(JsonElement jsonElement)
+        {
+            var (id, school) = HttpContext.GetApiTokenInfo();
+            var responseDate = await OpenApiService.GetSyllabus(_azureCosmos, _dingDing, id, school, jsonElement);
+            return Ok(new { responseDate });
+        }
+
+        /// <summary>
+        /// 查询册别清单
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-volumes")]
+        [ApiToken(Auth = "1602", Name = "获取册别列表", RWN = "R", Limit = false)]
+        public async Task<IActionResult> GetVolumes(JsonElement jsonElement)
+        {
+            var (id, school) = HttpContext.GetApiTokenInfo();
+            var responseDate = await OpenApiService.GetVolumes(_azureCosmos, _dingDing, id, school, jsonElement);
+            return Ok(new { responseDate });
+        }
+    }
+}