Browse Source

将研修平台Function函数换成方法。

Li 2 years ago
parent
commit
d3ddd6dd32

File diff suppressed because it is too large
+ 1030 - 0
TEAMModelOS.SDK/DI/StudyAPI/ScsStudyApisService.cs


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

@@ -31,6 +31,7 @@ using static TEAMModelOS.SDK.SchoolService;
 using Microsoft.AspNetCore.Hosting;
 using static TEAMModelOS.Controllers.ScController;
 using OpenXmlPowerTools;
+using TEAMModelOS.SDK.DI.StudyAPI;
 
 namespace TEAMModelOS.Controllers.Third
 {
@@ -54,6 +55,7 @@ namespace TEAMModelOS.Controllers.Third
         private readonly AzureServiceBusFactory _serviceBus;
         private readonly AzureRedisFactory _azureRedis;
         private readonly CoreAPIHttpService _coreAPIHttpService;
+        private readonly ScsStudyApisService _scsStudyApisService;
         private readonly ThirdApisService _scsApisService;
         public readonly string type = "scsyxpt";
         private readonly HttpTrigger _httpTrigger;
@@ -61,7 +63,7 @@ namespace TEAMModelOS.Controllers.Third
         private readonly ThirdApisService _thirdApisService;
         public IConfiguration _configuration { get; set; }
         public ScDataInitController(ThirdApisService thirdApisService, IWebHostEnvironment environment, AzureCosmosFactory azureCosmos, SnowflakeId snowflakeId, DingDing dingDing, IOptionsSnapshot<Option> option, AzureStorageFactory azureStorage,
-          AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus, IConfiguration configuration, CoreAPIHttpService coreAPIHttpService, ThirdApisService scsApisService, HttpTrigger httpTrigger)
+          AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus, IConfiguration configuration, CoreAPIHttpService coreAPIHttpService, ScsStudyApisService scsStudyApis, ThirdApisService scsApisService, HttpTrigger httpTrigger)
         {
             _azureCosmos = azureCosmos;
             _snowflakeId = snowflakeId;
@@ -72,6 +74,7 @@ namespace TEAMModelOS.Controllers.Third
             _configuration = configuration;
             _azureRedis = azureRedis;
             _coreAPIHttpService = coreAPIHttpService;
+            _scsStudyApisService = scsStudyApis;
             _scsApisService = scsApisService;
             _httpTrigger = httpTrigger;
             _environment = environment;
@@ -610,6 +613,8 @@ namespace TEAMModelOS.Controllers.Third
             int status = -1; string json = null;
             //5.3.1.1获取项目列表
             (status, json) = await _httpTrigger.RequestHttpTrigger(dict, _option.Location, "GetProjectInfoByTrainComID");
+            //新的方式  5.3.1.1获取项目列表
+            //(status, json) = await _scsStudyApisService.GetProjectInfoByTrainComID($"{areaId}", $"{accessConfig}"); 
             List<ScProject> projects = null;
             List<ScSchool> saveschools = null;
             List<ScSchool> schools = null;

+ 2 - 0
TEAMModelOS/Startup.cs

@@ -34,6 +34,7 @@ using TEAMModelOS.SDK;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.DI.CoreAPI;
+using TEAMModelOS.SDK.DI.StudyAPI;
 using TEAMModelOS.SDK.Extension;
 using VueCliMiddleware;
 
@@ -111,6 +112,7 @@ namespace TEAMModelOS
             services.AddHttpClient<DingDing>();
             services.AddHttpClient<NotificationService>();
             services.AddCoreAPIHttpService(Configuration);
+            services.AddScsStudyApisService(Configuration);//
            // services.AddHttpClient<CoreAPIHttpService>();
             services.AddHttpClient<ThirdApisService>();
             services.AddHttpClient<HttpTrigger>();