This commit is contained in:
owenchen 2026-05-22 11:45:04 +08:00
parent 30c22a3d0c
commit 0c79fb3519
11 changed files with 296 additions and 40 deletions

View File

@ -63,8 +63,6 @@ namespace CloudBuilder.AI.Gui
tabPage2 = new TabPage();
tableLayoutPanel2 = new TableLayoutPanel();
statusCombo = new Krypton.Toolkit.KryptonComboBox();
processBut = new Krypton.Toolkit.KryptonButton();
uploadBut = new Krypton.Toolkit.KryptonButton();
guidLabel = new Krypton.Toolkit.KryptonLabel();
bookTypeLabel = new Krypton.Toolkit.KryptonLabel();
guidTxt = new Krypton.Toolkit.KryptonTextBox();
@ -78,6 +76,10 @@ namespace CloudBuilder.AI.Gui
filePathTxt = new Krypton.Toolkit.KryptonTextBox();
statusLabel = new Krypton.Toolkit.KryptonLabel();
bookTypeTxt = new Krypton.Toolkit.KryptonTextBox();
processPanel = new TableLayoutPanel();
processBut = new Krypton.Toolkit.KryptonButton();
extractNamesBut = new Krypton.Toolkit.KryptonButton();
uploadBut = new Krypton.Toolkit.KryptonButton();
kryptonPanel2 = new Krypton.Toolkit.KryptonPanel();
mainPanel = new TableLayoutPanel();
topPanel = new TableLayoutPanel();
@ -96,6 +98,9 @@ namespace CloudBuilder.AI.Gui
operationPanel = new TableLayoutPanel();
deleteBut = new Krypton.Toolkit.KryptonButton();
amendBut = new Krypton.Toolkit.KryptonButton();
tableLayoutPanel7 = new TableLayoutPanel();
kryptonDataGridView1 = new Krypton.Toolkit.KryptonDataGridView();
kryptonDataGridView2 = new Krypton.Toolkit.KryptonDataGridView();
contentPanel.SuspendLayout();
tableLayoutPanel3.SuspendLayout();
tableLayoutPanel4.SuspendLayout();
@ -106,8 +111,10 @@ namespace CloudBuilder.AI.Gui
tableLayoutPanel6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)sentenceGv).BeginInit();
((System.ComponentModel.ISupportInitialize)dataGv).BeginInit();
tabPage2.SuspendLayout();
tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)statusCombo).BeginInit();
processPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)kryptonPanel2).BeginInit();
mainPanel.SuspendLayout();
topPanel.SuspendLayout();
@ -116,6 +123,9 @@ namespace CloudBuilder.AI.Gui
bottomPanel.SuspendLayout();
savePanel.SuspendLayout();
operationPanel.SuspendLayout();
tableLayoutPanel7.SuspendLayout();
((System.ComponentModel.ISupportInitialize)kryptonDataGridView1).BeginInit();
((System.ComponentModel.ISupportInitialize)kryptonDataGridView2).BeginInit();
SuspendLayout();
//
// contentPanel
@ -400,12 +410,13 @@ namespace CloudBuilder.AI.Gui
//
// tabPage2
//
tabPage2.Controls.Add(tableLayoutPanel7);
tabPage2.Location = new Point(4, 24);
tabPage2.Name = "tabPage2";
tabPage2.Padding = new Padding(3);
tabPage2.Size = new Size(1004, 398);
tabPage2.TabIndex = 1;
tabPage2.Text = "段落";
tabPage2.Text = "人物角色表";
tabPage2.UseVisualStyleBackColor = true;
//
// tableLayoutPanel2
@ -419,8 +430,6 @@ namespace CloudBuilder.AI.Gui
tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle());
tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20F));
tableLayoutPanel2.Controls.Add(statusCombo, 3, 0);
tableLayoutPanel2.Controls.Add(processBut, 3, 3);
tableLayoutPanel2.Controls.Add(uploadBut, 2, 3);
tableLayoutPanel2.Controls.Add(guidLabel, 0, 0);
tableLayoutPanel2.Controls.Add(bookTypeLabel, 0, 4);
tableLayoutPanel2.Controls.Add(guidTxt, 1, 0);
@ -434,6 +443,7 @@ namespace CloudBuilder.AI.Gui
tableLayoutPanel2.Controls.Add(filePathTxt, 1, 3);
tableLayoutPanel2.Controls.Add(statusLabel, 2, 0);
tableLayoutPanel2.Controls.Add(bookTypeTxt, 1, 4);
tableLayoutPanel2.Controls.Add(processPanel, 2, 3);
tableLayoutPanel2.Dock = DockStyle.Fill;
tableLayoutPanel2.Location = new Point(3, 3);
tableLayoutPanel2.Name = "tableLayoutPanel2";
@ -443,6 +453,7 @@ namespace CloudBuilder.AI.Gui
tableLayoutPanel2.RowStyles.Add(new RowStyle());
tableLayoutPanel2.RowStyles.Add(new RowStyle());
tableLayoutPanel2.RowStyles.Add(new RowStyle());
tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F));
tableLayoutPanel2.Size = new Size(1018, 187);
tableLayoutPanel2.TabIndex = 0;
//
@ -452,32 +463,12 @@ namespace CloudBuilder.AI.Gui
statusCombo.DropDownStyle = ComboBoxStyle.DropDownList;
statusCombo.DropDownWidth = 300;
statusCombo.IntegralHeight = false;
statusCombo.Location = new Point(472, 3);
statusCombo.Location = new Point(446, 3);
statusCombo.Name = "statusCombo";
statusCombo.Size = new Size(300, 22);
statusCombo.Size = new Size(326, 22);
statusCombo.StateCommon.ComboBox.Content.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
statusCombo.TabIndex = 5;
//
// processBut
//
processBut.Location = new Point(472, 130);
processBut.Name = "processBut";
processBut.Size = new Size(86, 25);
processBut.TabIndex = 2;
processBut.Values.Image = Properties.Resources.MoveNext;
processBut.Values.Text = "拆分章节";
processBut.Click += processBut_Click;
//
// uploadBut
//
uploadBut.Location = new Point(380, 130);
uploadBut.Name = "uploadBut";
uploadBut.Size = new Size(86, 25);
uploadBut.TabIndex = 2;
uploadBut.Values.Image = Properties.Resources.page_white_get;
uploadBut.Values.Text = "上传";
uploadBut.Click += uploadBut_Click;
//
// guidLabel
//
guidLabel.Location = new Point(3, 3);
@ -559,10 +550,10 @@ namespace CloudBuilder.AI.Gui
// authorTxt
//
authorTxt.Dock = DockStyle.Fill;
authorTxt.Location = new Point(472, 32);
authorTxt.Location = new Point(446, 32);
authorTxt.MaxLength = 500;
authorTxt.Name = "authorTxt";
authorTxt.Size = new Size(300, 23);
authorTxt.Size = new Size(326, 23);
authorTxt.TabIndex = 3;
//
// filePathTxt
@ -590,6 +581,57 @@ namespace CloudBuilder.AI.Gui
bookTypeTxt.Size = new Size(300, 23);
bookTypeTxt.TabIndex = 3;
//
// processPanel
//
processPanel.AutoSize = true;
processPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
processPanel.ColumnCount = 4;
tableLayoutPanel2.SetColumnSpan(processPanel, 2);
processPanel.ColumnStyles.Add(new ColumnStyle());
processPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
processPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
processPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 80F));
processPanel.Controls.Add(processBut, 1, 0);
processPanel.Controls.Add(extractNamesBut, 2, 0);
processPanel.Controls.Add(uploadBut, 0, 0);
processPanel.Location = new Point(377, 127);
processPanel.Margin = new Padding(0);
processPanel.Name = "processPanel";
processPanel.RowCount = 1;
processPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
processPanel.Size = new Size(356, 31);
processPanel.TabIndex = 6;
//
// processBut
//
processBut.Location = new Point(95, 3);
processBut.Name = "processBut";
processBut.Size = new Size(86, 25);
processBut.TabIndex = 2;
processBut.Values.Image = Properties.Resources.MoveNext;
processBut.Values.Text = "拆分章节";
processBut.Click += processBut_Click;
//
// extractNamesBut
//
extractNamesBut.Location = new Point(187, 3);
extractNamesBut.Name = "extractNamesBut";
extractNamesBut.Size = new Size(86, 25);
extractNamesBut.TabIndex = 2;
extractNamesBut.Values.Image = Properties.Resources.MoveNext;
extractNamesBut.Values.Text = "识别人名";
extractNamesBut.Click += extractNamesBut_Click;
//
// uploadBut
//
uploadBut.Location = new Point(3, 3);
uploadBut.Name = "uploadBut";
uploadBut.Size = new Size(86, 25);
uploadBut.TabIndex = 2;
uploadBut.Values.Image = Properties.Resources.page_white_get;
uploadBut.Values.Text = "上传";
uploadBut.Click += uploadBut_Click;
//
// kryptonPanel2
//
kryptonPanel2.Dock = DockStyle.Fill;
@ -805,6 +847,37 @@ namespace CloudBuilder.AI.Gui
amendBut.Values.Text = "修改(&M)";
amendBut.Click += amendBut_Click;
//
// tableLayoutPanel7
//
tableLayoutPanel7.ColumnCount = 2;
tableLayoutPanel7.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableLayoutPanel7.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableLayoutPanel7.Controls.Add(kryptonDataGridView1, 0, 0);
tableLayoutPanel7.Controls.Add(kryptonDataGridView2, 1, 0);
tableLayoutPanel7.Location = new Point(76, 31);
tableLayoutPanel7.Name = "tableLayoutPanel7";
tableLayoutPanel7.RowCount = 2;
tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Percent, 69.93671F));
tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Percent, 30.0632915F));
tableLayoutPanel7.Size = new Size(622, 316);
tableLayoutPanel7.TabIndex = 0;
//
// kryptonDataGridView1
//
kryptonDataGridView1.BorderStyle = BorderStyle.None;
kryptonDataGridView1.Location = new Point(3, 3);
kryptonDataGridView1.Name = "kryptonDataGridView1";
kryptonDataGridView1.Size = new Size(209, 173);
kryptonDataGridView1.TabIndex = 0;
//
// kryptonDataGridView2
//
kryptonDataGridView2.BorderStyle = BorderStyle.None;
kryptonDataGridView2.Location = new Point(314, 3);
kryptonDataGridView2.Name = "kryptonDataGridView2";
kryptonDataGridView2.Size = new Size(209, 173);
kryptonDataGridView2.TabIndex = 0;
//
// AiBookOperationPage
//
AutoScaleDimensions = new SizeF(7F, 15F);
@ -824,9 +897,11 @@ namespace CloudBuilder.AI.Gui
tableLayoutPanel6.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)sentenceGv).EndInit();
((System.ComponentModel.ISupportInitialize)dataGv).EndInit();
tabPage2.ResumeLayout(false);
tableLayoutPanel2.ResumeLayout(false);
tableLayoutPanel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)statusCombo).EndInit();
processPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)kryptonPanel2).EndInit();
mainPanel.ResumeLayout(false);
mainPanel.PerformLayout();
@ -838,6 +913,9 @@ namespace CloudBuilder.AI.Gui
bottomPanel.PerformLayout();
savePanel.ResumeLayout(false);
operationPanel.ResumeLayout(false);
tableLayoutPanel7.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)kryptonDataGridView1).EndInit();
((System.ComponentModel.ISupportInitialize)kryptonDataGridView2).EndInit();
ResumeLayout(false);
}
@ -904,5 +982,10 @@ namespace CloudBuilder.AI.Gui
private Krypton.Toolkit.KryptonDataGridViewTextBoxColumn genderCol;
private Krypton.Toolkit.KryptonDataGridViewTextBoxColumn sentimentCol;
private Krypton.Toolkit.KryptonDataGridViewComboBoxColumn sentenceStatusCol;
private TableLayoutPanel processPanel;
private Krypton.Toolkit.KryptonButton extractNamesBut;
private TableLayoutPanel tableLayoutPanel7;
private Krypton.Toolkit.KryptonDataGridView kryptonDataGridView1;
private Krypton.Toolkit.KryptonDataGridView kryptonDataGridView2;
}
}

View File

@ -260,16 +260,16 @@ namespace CloudBuilder.AI.Gui
guiOperateHelper.EnableControls(false, contentPanel);
//查詢有記錄時,修改等控件有效
if (aiBookEntity != null)
guiOperateHelper.EnableControls(true, bottomPanel, uploadBut, processBut, gridViewPagination);
guiOperateHelper.EnableControls(true, bottomPanel, processPanel,gridViewPagination);
else
guiOperateHelper.EnableControls(false, bottomPanel, uploadBut, processBut, gridViewPagination);
guiOperateHelper.EnableControls(false, bottomPanel, processPanel, gridViewPagination);
}
else if (this.DisplayMode == GuiDisplayMode.Amend || this.DisplayMode == GuiDisplayMode.Create)
{
savePanel.Visible = true;
operationPanel.Visible = false;
guiOperateHelper.EnableControls(false, topPanel, uploadBut, processBut, gridViewPagination);
guiOperateHelper.EnableControls(false, topPanel, processPanel, gridViewPagination);
guiOperateHelper.EnableControls(true, bottomPanel, contentPanel);
if (this.DisplayMode == GuiDisplayMode.Amend) guiOperateHelper.EnableControls(false, guidTxt);
@ -347,6 +347,7 @@ namespace CloudBuilder.AI.Gui
filter.Value = data.AiBook.Guid;
filters.Add(filter);
searchCriteria.Filter = filters.ToArray();
return searchCriteria;
}
@ -760,5 +761,37 @@ namespace CloudBuilder.AI.Gui
ShowMessageBox.ShowError(ex.Message);
}
}
private void extractNamesBut_Click(object sender, EventArgs e)
{
try
{
if (dataGv.RowCount <= 0 || dataGv.SelectedCells.Count <= 0)
{
ShowMessageBox.ShowInfo(securityMessagePolicy.ComposeMessage(SecurityMessagePolicy.GUI_WS_RECORD_NOT_FOUND));
return;
}
AiChapterEntity chapter = dataGv.GetRowData<AiChapterEntity>(dataGv.SelectedCells[0].RowIndex);
aiBookRequest.ExtractNamesByChapterGuid(data.AiBook.Guid, chapter.Guid);
AiSentenceViewEntity[] aiSentences = aiSentenceRequest.FindByChapterGuid(chapter.Guid);
sentenceGv.SetDataSource(aiSentences);
}
catch (ValidatedException ex)
{
ShowMessageBox.ShowInfo(ex.Message);
}
catch (ServiceErrorException ex)
{
ShowMessageBox.ShowError(ex.Message);
}
catch (Exception ex)
{
ShowMessageBox.ShowError(ex.Message);
}
}
}
}

View File

@ -12,6 +12,7 @@ using CloudBuilder.Security.Policy;
using CloudBuilder.Security.Service;
using CloudBuilder.Security.Utility;
using DocumentFormat.OpenXml.ExtendedProperties;
using DocumentFormat.OpenXml.Presentation;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics.Contracts;
@ -24,6 +25,8 @@ namespace CloudBuilder.AI.Service
private readonly IApplicationService service;
private IRepository<AiBookEntity> repository;
private ChineseNameExtractor chineseNameExtractor;
public AiBookService(IApplicationService service)
{
this.service = service;
@ -252,5 +255,54 @@ namespace CloudBuilder.AI.Service
return FindByKey(key);
}
[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Update)]
[UnitOfWork]
public void ExtractNames(string bookGuid)
{
ExtractNamesByChapterGuid(bookGuid, null);
}
[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Update)]
[UnitOfWork]
public void ExtractNamesByChapterGuid(string bookGuid, string chapterGuid)
{
if (chineseNameExtractor == null) chineseNameExtractor = new ChineseNameExtractor(service);
IRepository<AiChapterPersonEntity> repositoryAiChapterPersonEntity = repository.GetRepository<IRepository<AiChapterPersonEntity>>();
IRepository<AiParagraphViewEntity> repositoryAiParagraphEntity = repository.GetRepository<IRepository<AiParagraphViewEntity>>();
AiParagraphViewEntity[] paragraphs = repositoryAiParagraphEntity.DetachedEntities.Where(x => x.BookGuid == bookGuid && (string.IsNullOrEmpty(chapterGuid) || x.ChapterGuid == chapterGuid)).ToArray();
if (paragraphs == null || paragraphs.Length == 0) return;
List<string> names = new List<string>();
List<AiChapterPersonEntity> aiChapterPersonEntities = new List<AiChapterPersonEntity>();
AiChapterPersonEntity entity;
int orderIndex = 0;
foreach (var paragraph in paragraphs)
{
names = chineseNameExtractor.ExtractNames(paragraph.Content);
if (names == null || names.Count() == 0) continue;
orderIndex = 1;
foreach (var name in names)
{
entity = new AiChapterPersonEntity();
entity.Guid= Guid.NewGuid().ToString();
entity.ChapterGuid = paragraph.ChapterGuid;
entity.ParagraphGuid = paragraph.Guid;
entity.ParagraphIndex = paragraph.ParagraphIndex;
entity.OrderIndex = orderIndex++;
entity.PersonName = name;
aiChapterPersonEntities.Add(entity);
}
}
if (aiChapterPersonEntities != null && aiChapterPersonEntities.Count() > 0)
repositoryAiChapterPersonEntity.InsertNow(aiChapterPersonEntities);
}
}
}

View File

@ -21,6 +21,9 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
<PackageReference Include="Microsoft.ML" Version="5.0.0" />
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.26.0" />
<PackageReference Include="Microsoft.ML.OnnxTransformer" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -26,6 +26,12 @@ namespace CloudBuilder.AI.Entity
public string Guid { get; set; }
[Column("chapter_guid")]
public string ChapterGuid { get; set; }
[Column("paragraph_guid")]
public string ParagraphGuid { get; set; }
[Column("paragraph_index")]
public int ParagraphIndex { get; set; }
[Column("order_index")]
public int OrderIndex { get; set; }
[Column("person_name")]
public string PersonName { get; set; }
[Column("person_mapping")]
@ -37,11 +43,14 @@ namespace CloudBuilder.AI.Entity
public const string UPDATED_BY = "UpdatedBy";
public const string GUID = "Guid";
public const string CHAPTER_GUID = "ChapterGuid";
public const string PARAGRAPH_GUID = "ParagraphGuid";
public const string PARAGRAPH_INDEX = "ParagraphIndex";
public const string ORDER_INDEX = "OrderIndex";
public const string PERSON_NAME = "PersonName";
public const string PERSON_MAPPING = "PersonMapping";
public const string DB_NAME_AI_CHAPTER_PERSON = "ai_chapter_person";
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,chapter_guid,person_name,person_mapping";
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,chapter_guid,paragraph_guid,paragraph_index,order_index,person_name,person_mapping";
public const string DB_CREATED_DATETIME = "created_datetime";
public const string DB_CREATED_BY = "created_by";
@ -49,6 +58,9 @@ namespace CloudBuilder.AI.Entity
public const string DB_UPDATED_BY = "updated_by";
public const string DB_GUID = "guid";
public const string DB_CHAPTER_GUID = "chapter_guid";
public const string DB_PARAGRAPH_GUID = "paragraph_guid";
public const string DB_PARAGRAPH_INDEX = "paragraph_index";
public const string DB_ORDER_INDEX = "order_index";
public const string DB_PERSON_NAME = "person_name";
public const string DB_PERSON_MAPPING = "person_mapping";
@ -76,6 +88,9 @@ namespace CloudBuilder.AI.Entity
this.UpdatedBy = source.UpdatedBy;
this.Guid = source.Guid;
this.ChapterGuid = source.ChapterGuid;
this.ParagraphGuid = source.ParagraphGuid;
this.ParagraphIndex = source.ParagraphIndex;
this.OrderIndex = source.OrderIndex;
this.PersonName = source.PersonName;
this.PersonMapping = source.PersonMapping;

View File

@ -40,6 +40,7 @@ namespace CloudBuilder.AI.Entity
builder.Entity<BookDmsFileViewEntity>(eb => { eb.HasNoKey(); });
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
builder.Entity<AiParagraphViewEntity>(eb => { eb.HasNoKey(); });
//***END***
}
}

View File

@ -19,5 +19,9 @@ namespace CloudBuilder.AI.Service
AiBookData Update(AiBookData data);
AiBookData ProcessBook(string key, string encoding, string pattern);
void ExtractNames(string bookGuid);
void ExtractNamesByChapterGuid(string bookGuid, string chapterGuid);
}
}

View File

@ -61,6 +61,20 @@ return Task.Run(() => serviceRequest.PostAsJsonAsync<AiBookData,AiBookData>("/
{
var compositionData = new ProcessBookCompositionData3{ key = key, encoding = encoding, pattern = pattern }; return Task.Run(() => serviceRequest.PostAsJsonAsync<ProcessBookCompositionData3, AiBookData>("/AiBook/ProcessBook", compositionData)).GetAwaiter().GetResult(); }
public void ExtractNames(string bookGuid)
{
Task.Run(() => serviceRequest.PostAsync("/AiBook/ExtractNames?bookGuid=" + bookGuid.ToString())).GetAwaiter().GetResult(); }
public class ExtractNamesByChapterGuidCompositionData2 {
public string bookGuid { get; set; }
public string chapterGuid { get; set; }
}
public void ExtractNamesByChapterGuid(string bookGuid, string chapterGuid)
{
var compositionData = new ExtractNamesByChapterGuidCompositionData2{ bookGuid = bookGuid, chapterGuid = chapterGuid }; Task.Run(() => serviceRequest.PostAsJsonAsync<ExtractNamesByChapterGuidCompositionData2, dynamic>("/AiBook/ExtractNamesByChapterGuid", compositionData)).GetAwaiter().GetResult(); }
}
}

View File

@ -25,6 +25,9 @@
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="8.0.0" />
<PackageReference Include="ClosedXML" Version="0.102.1" />
<PackageReference Include="System.Drawing.Common" Version="8.0.2" />
<PackageReference Include="Microsoft.ML" Version="5.0.0" />
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.26.0" />
<PackageReference Include="Microsoft.ML.OnnxTransformer" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -199,6 +199,53 @@ this.aiBookService= aiBookService;
}
}
[PermissionOperate(name: "AiBook", operate: "Update")]
[HttpPost]
[UnitOfWork]
public dynamic ExtractNames(string bookGuid){
try
{
aiBookService.ExtractNames(bookGuid);
return string.Empty;
}
catch (ValidatedException vex)
{
return vex;
}
catch (Exception ex)
{
return new ServiceErrorException(ex);
}
}
public class ExtractNamesByChapterGuidCompositionData
{
public string bookGuid { get; set; }
public string chapterGuid { get; set; }
}
[PermissionOperate(name: "AiBook", operate: "Update")]
[HttpPost]
[UnitOfWork]
public dynamic ExtractNamesByChapterGuid(ExtractNamesByChapterGuidCompositionData compositionData){
try
{
aiBookService.ExtractNamesByChapterGuid(compositionData.bookGuid,compositionData.chapterGuid);
return string.Empty;
}
catch (ValidatedException vex)
{
return vex;
}
catch (Exception ex)
{
return new ServiceErrorException(ex);
}
}
}
}

View File

@ -53,7 +53,8 @@
"UploadDmsFileDirectory": "D:\\Net8\\FileServer\\Upload\\DmsFile", //使
"BackupDmsFileDirectory": "D:\\Net8\\FileServer\\Backup\\DmsFile", //
"ScaleDmsFileDirectory": "D:\\Net8\\FileServer\\Scale\\DmsFile", //
"ExcelOutputDirectory": "D:\\Net8\\FileServer\\Output"
"ExcelOutputDirectory": "D:\\Net8\\FileServer\\Output",
"OnnxDirectory": "D:\\Net8\\FileServer\\model" //
},
"Ffmpeg": {
"Path": "D:\\NET8\\Exe\\ffmpeg\\bin\\ffmpeg.exe", //