|
@@ -39,7 +39,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
|
|
|
// azureBlobDBRepository = _azureBlobDBRepository;
|
|
|
// // htmlAnalyzeService = _htmlAnalyzeService;
|
|
|
//}
|
|
|
- public static async Task<Htex> AnalyzeHtmlToHtex(this AzureStorageFactory azureBlobDBRepository, string htmlString, string Lang, HtmlAnalyzeService htmlAnalyzeService)
|
|
|
+ public static async Task<Htex> AnalyzeHtmlToHtex(this AzureStorageFactory azureStorage, string htmlString, string Lang, HtmlAnalyzeService htmlAnalyzeService)
|
|
|
{
|
|
|
|
|
|
|
|
@@ -52,20 +52,20 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
|
|
|
{
|
|
|
Slide slide = new Slide { exercise = item, index = index, source = 2, flag = 2 };
|
|
|
index++;
|
|
|
- AzureBlobModel model = await azureBlobDBRepository.UploadFileByContainer("teammodelos", slide.ToJsonString(), "htex/"+sha, index+".json",false);
|
|
|
+ AzureBlobModel model = await azureStorage.UploadFileByContainer("teammodelos", slide.ToJsonString(), "htex/"+sha, index+".json",false);
|
|
|
htex.slides.Add(model.BlobUrl);
|
|
|
}
|
|
|
htex.page = items.Count;
|
|
|
return htex;
|
|
|
}
|
|
|
- public static async Task<Dictionary<string, object>> LoadDoc(this AzureStorageFactory azureBlobDBRepository, IFormFile file)
|
|
|
+ public static async Task<Dictionary<string, object>> LoadDoc(this AzureStorageFactory azureStorage, IFormFile file)
|
|
|
{
|
|
|
Dictionary<string, object> resdict = new Dictionary<string, object>();
|
|
|
|
|
|
if (FileType.GetExtention(file.FileName).ToLower().Equals("pptx"))
|
|
|
{
|
|
|
|
|
|
- return await ConvertPPTX(azureBlobDBRepository, file, resdict);
|
|
|
+ return await ConvertPPTX(azureStorage, file, resdict);
|
|
|
}
|
|
|
else if (FileType.GetExtention(file.FileName).ToLower().Equals("pdf"))
|
|
|
{
|
|
@@ -85,7 +85,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
|
|
|
sr.Close();
|
|
|
xmlDocument.LoadXml(builder.ToString());
|
|
|
string shaCode = fileShaCode = ShaHashHelper.GetSHA1(file.OpenReadStream());
|
|
|
- var rslt_ary = await ProcessPPTX(azureBlobDBRepository, xmlDocument, shaCode);
|
|
|
+ var rslt_ary = await ProcessPPTX(azureStorage, xmlDocument, shaCode);
|
|
|
//TODO
|
|
|
Dictionary<string, object> data = new Dictionary<string, object> { { "htexl", rslt_ary } };
|
|
|
return data;
|
|
@@ -96,7 +96,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static async Task<Dictionary<string, object>> ConvertPPTX(this AzureStorageFactory azureBlobDBRepository, IFormFile file, Dictionary<string, object> resdict)
|
|
|
+ public static async Task<Dictionary<string, object>> ConvertPPTX(this AzureStorageFactory azureStorage, IFormFile file, Dictionary<string, object> resdict)
|
|
|
{
|
|
|
string shaCode = fileShaCode = ShaHashHelper.GetSHA1(file.OpenReadStream());
|
|
|
|
|
@@ -110,7 +110,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
|
|
|
XmlDocument xmlDocument = new XmlDocument();
|
|
|
xmlDocument.LoadXml(xdoc.ToString());
|
|
|
|
|
|
- var rslt_ary = await ProcessPPTX(azureBlobDBRepository, xmlDocument, shaCode);
|
|
|
+ var rslt_ary = await ProcessPPTX(azureStorage, xmlDocument, shaCode);
|
|
|
//TODO
|
|
|
Dictionary<string, object> data = new Dictionary<string, object> { { "pptx",rslt_ary} };
|
|
|
return data;
|
|
@@ -122,7 +122,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
|
|
|
/// <param name="xdoc"></param>
|
|
|
/// <param name="shaCode"></param>
|
|
|
/// <returns></returns>
|
|
|
- public static async Task<Htex> ProcessPPTX(this AzureStorageFactory azureBlobDBRepository, XmlDocument xdoc, string shaCode)
|
|
|
+ public static async Task<Htex> ProcessPPTX(this AzureStorageFactory azureStorage, XmlDocument xdoc, string shaCode)
|
|
|
{
|
|
|
Htex pptx = new Htex();
|
|
|
// List<Dictionary<string, object>> post_ary = new List<Dictionary<string, object>>();
|
|
@@ -157,7 +157,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
|
|
|
|
|
|
slide.source = 1;
|
|
|
slide.flag = 1;
|
|
|
- AzureBlobModel model = await azureBlobDBRepository.UploadFileByContainer("teammodelos", slide.ToJsonString(), "htex/" + shaCode, (i + 1) + ".json", false);
|
|
|
+ AzureBlobModel model = await azureStorage.UploadFileByContainer("teammodelos", slide.ToJsonString(), "htex/" + shaCode, (i + 1) + ".json", false);
|
|
|
pptx.slides.Add(model.BlobUrl);
|
|
|
slides.Add(slide);
|
|
|
// post_ary.Add(new Dictionary<string, object> { { "slide", slideHtml } });
|