|
@@ -28,6 +28,7 @@ using Azure;
|
|
using Microsoft.Extensions.Options;
|
|
using Microsoft.Extensions.Options;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Configuration;
|
|
using TEAMModelOS.Models;
|
|
using TEAMModelOS.Models;
|
|
|
|
+using System.Text.RegularExpressions;
|
|
|
|
|
|
namespace TEAMModelOS.Controllers
|
|
namespace TEAMModelOS.Controllers
|
|
{
|
|
{
|
|
@@ -54,16 +55,18 @@ namespace TEAMModelOS.Controllers
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// 测试blob多线程写入同一个文件
|
|
|
|
|
|
+ /// 批量导入自动加入学校
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[ProducesDefaultResponseType]
|
|
[ProducesDefaultResponseType]
|
|
[HttpPost("fix-joinschool")]
|
|
[HttpPost("fix-joinschool")]
|
|
public async Task<IActionResult> GenerateSchoolCodes(JsonElement json)
|
|
public async Task<IActionResult> GenerateSchoolCodes(JsonElement json)
|
|
{
|
|
{
|
|
|
|
+
|
|
JsonElement _teachers =json.GetProperty("teachers");
|
|
JsonElement _teachers =json.GetProperty("teachers");
|
|
-
|
|
|
|
- List<JoinSchool> joins= _teachers.ToObject<List<JoinSchool>>();
|
|
|
|
|
|
+ string jsons = _teachers.ToJsonString();
|
|
|
|
+ jsons = Regex.Replace(jsons, @"\s", "");
|
|
|
|
+ List<JoinSchool> joins= jsons.ToObject<List<JoinSchool>>();
|
|
string url = _configuration.GetValue<string>("HaBookAuth:CoreId:userinfo");
|
|
string url = _configuration.GetValue<string>("HaBookAuth:CoreId:userinfo");
|
|
HttpClient client = new HttpClient();
|
|
HttpClient client = new HttpClient();
|
|
var tmdids= joins.Select(x => x.tmdid).ToList();
|
|
var tmdids= joins.Select(x => x.tmdid).ToList();
|