|
@@ -13,14 +13,14 @@ using Azure.Cosmos;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
using System.IO;
|
|
|
-using System.Dynamic;
|
|
|
-using TEAMModelOS.SDK.Context.Configuration;
|
|
|
+using System.Dynamic;
|
|
|
using System.Net.Http;
|
|
|
using System.Net;
|
|
|
using Newtonsoft.Json;
|
|
|
using System.Linq;
|
|
|
using StackExchange.Redis;
|
|
|
using static TEAMModelOS.SDK.Models.Teacher;
|
|
|
+using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
namespace TEAMModelOS.Controllers
|
|
|
{
|
|
@@ -40,14 +40,15 @@ namespace TEAMModelOS.Controllers
|
|
|
int baseSpaceSize = 1; //學校保底空間大小(1G)
|
|
|
private readonly double bytes = 1073741824;
|
|
|
private readonly int redisAclassoneDbNum = 8; //AclassOne Redis DB號
|
|
|
-
|
|
|
- public SchoolController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option)
|
|
|
+ private readonly IConfiguration _configuration;
|
|
|
+ public SchoolController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option, IConfiguration configuration)
|
|
|
{
|
|
|
_azureCosmos = azureCosmos;
|
|
|
_azureStorage = azureStorage;
|
|
|
_azureRedis = azureRedis;
|
|
|
_dingDing = dingDing;
|
|
|
_option = option?.Value;
|
|
|
+ _configuration = configuration;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 保存或更新学校
|
|
@@ -474,7 +475,7 @@ namespace TEAMModelOS.Controllers
|
|
|
List<deviceFromCoreService> result = new List<deviceFromCoreService>();
|
|
|
try
|
|
|
{
|
|
|
- string url = BaseConfigModel.Configuration["HaBookAuth:CoreService:deviceinfo"];
|
|
|
+ string url = _configuration.GetValue<string>("HaBookAuth:CoreService:deviceinfo");
|
|
|
HttpClient client = new HttpClient();
|
|
|
var content = new StringContent(JsonConvert.SerializeObject(uuidList), Encoding.UTF8, "application/json");
|
|
|
HttpResponseMessage responseMessage = await client.PostAsync(url, content);
|