|
@@ -29,6 +29,7 @@ using Azure.Messaging.ServiceBus;
|
|
|
using TEAMModelOS.Models;
|
|
|
using TEAMModelOS.SDK.Models.Service;
|
|
|
using TEAMModelOS.SDK.Models.Cosmos.BI.BINormal;
|
|
|
+using TEAMModelOS.SDK.Models.Cosmos.Student;
|
|
|
|
|
|
namespace TEAMModelOS.Controllers
|
|
|
{
|
|
@@ -1330,7 +1331,6 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
knowledges.Add(new { item.periodId, item.subjectId, item.points, item.blocks, item.id });
|
|
|
}
|
|
|
-
|
|
|
|
|
|
if (knowledges.Any())
|
|
|
{
|
|
@@ -1349,7 +1349,52 @@ namespace TEAMModelOS.Controllers
|
|
|
return new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务器错误!" };
|
|
|
}
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 查询知识
|
|
|
+ /// [ApiToken(Auth = "1701", Name = "查询知识点",TName ="",EName ="", RWN = "R", Limit = false)]
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="_azureCosmos"></param>
|
|
|
+ /// <param name="_dingDing"></param>
|
|
|
+ /// <param name="json"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static async Task<ResponseData<dynamic>> UpsertStudentPortrait(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json) {
|
|
|
+ try {
|
|
|
+ ResponseData<dynamic> responseData = new();
|
|
|
+ var client = _azureCosmos.GetCosmosClient();
|
|
|
+ if (!json.TryGetProperty("schoolCode", out JsonElement schoolCode))
|
|
|
+ {
|
|
|
+ return responseData = new() { code = RespondCode.ParamsError, msg = "schoolCode为空!" };
|
|
|
+ }
|
|
|
+ if (!json.TryGetProperty("studentId", out JsonElement studentId)) {
|
|
|
+ return responseData = new() { code = RespondCode.ParamsError, msg = "studentId为空!" };
|
|
|
+ }
|
|
|
+ if (!json.TryGetProperty("name", out JsonElement name)) {
|
|
|
+ return responseData = new() { code = RespondCode.ParamsError, msg = "name为空!" };
|
|
|
+ }
|
|
|
+ if (!json.TryGetProperty("classId", out JsonElement classId)) {
|
|
|
+ return responseData = new() { code = RespondCode.ParamsError, msg = "classId为空!" };
|
|
|
+ }
|
|
|
+ if (!json.TryGetProperty("periodId", out JsonElement periodId)) {
|
|
|
+ return responseData = new() { code = RespondCode.ParamsError, msg = "periodId为空!" };
|
|
|
+ }
|
|
|
+ if (!json.TryGetProperty("subjectId", out JsonElement subjectId)) {
|
|
|
+ return responseData = new() { code = RespondCode.ParamsError, msg = "subjectId为空!" };
|
|
|
+ }
|
|
|
+ if (!json.TryGetProperty("semesterData", out JsonElement semesterData)) {
|
|
|
+ return responseData = new() { code = RespondCode.ParamsError, msg = "semesterData为空!" };
|
|
|
+ }
|
|
|
|
|
|
+ if(!$"{subjectId}".Equals("") && !$"{subjectId}".Equals("") && !$"{subjectId}".Equals("") && !$"{subjectId}".Equals(""))
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ List<SemesterData> semesterDatas = semesterData.ToObject<List<SemesterData>>();
|
|
|
+ return responseData = new() { code = RespondCode.Ok, msg = "成功" };
|
|
|
+ } catch (Exception ex) {
|
|
|
+ await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} OpenApiService/UpsertStudentPortrait() 参数:bizId:{bizId},school:{school},参数json:{json.ToJsonString()} \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
+ return new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务器错误!" };
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public static void GenApiTableRecord(AzureStorageFactory azureStorage)
|
|
|
{
|