ow
This commit is contained in:
parent
90f26d0dfc
commit
d795476b1f
5
.gitignore
vendored
5
.gitignore
vendored
@ -15,3 +15,8 @@
|
||||
/CloudBuilderLauncher/bin
|
||||
/CloudBuilderLauncher/obj
|
||||
/.vs
|
||||
/CloudBuilder.AI/.vs
|
||||
/CloudBuilder.AI/bin
|
||||
/CloudBuilder.AI/obj
|
||||
/CloudBuilder.AI.Service/bin
|
||||
/CloudBuilder.AI.Service/obj
|
||||
|
||||
61
CloudBuilder.AI.Service/AiBookPersonService.auto.cs
Normal file
61
CloudBuilder.AI.Service/AiBookPersonService.auto.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.Policy;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public class AiBookPersonService : IAiBookPersonService
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
|
||||
private IRepository<AiBookPersonEntity> repository;
|
||||
public AiBookPersonService(IApplicationService service)
|
||||
{
|
||||
this.service = service;
|
||||
repository = service.GetRepository<IRepository<AiBookPersonEntity>>();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBookPerson, operate: Operate.Find)]
|
||||
public AiBookPersonEntity FindByKey(string key)
|
||||
{
|
||||
return repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiBookPerson, operate: Operate.Find)]
|
||||
public dynamic FindBySearchCriteria(AiBookPersonSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiBookPerson, operate: Operate.Print)]
|
||||
public dynamic PrintBySearchCriteria(AiBookPersonSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBookPerson, operate: Operate.Insert)]
|
||||
[UnitOfWork]
|
||||
public AiBookPersonEntity Insert(AiBookPersonEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBookPerson, operate: Operate.Update)]
|
||||
[UnitOfWork]
|
||||
public AiBookPersonEntity Update(AiBookPersonEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBookPerson, operate: Operate.Delete)]
|
||||
[UnitOfWork]
|
||||
public void Delete(string key)
|
||||
{
|
||||
var ent= repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
if (ent != null) { repository.DeleteNow(ent); }
|
||||
}
|
||||
}
|
||||
}
|
||||
87
CloudBuilder.AI.Service/AiBookService.auto.cs
Normal file
87
CloudBuilder.AI.Service/AiBookService.auto.cs
Normal file
@ -0,0 +1,87 @@
|
||||
using CloudBuilder.AI.Data;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.Policy;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public class AiBookService : IAiBookService
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
|
||||
private IRepository<AiBookEntity> repository;
|
||||
public AiBookService(IApplicationService service)
|
||||
{
|
||||
this.service = service;
|
||||
repository = service.GetRepository<IRepository<AiBookEntity>>();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Find)]
|
||||
public AiBookEntity FindByKey(string key)
|
||||
{
|
||||
return repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
}
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Find)]
|
||||
public AiBookEntity FindByTitle(string title)
|
||||
{
|
||||
return repository.DetachedEntities.Where(x => x.Title == title).FirstOrDefault()!;
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Find)]
|
||||
public dynamic FindBySearchCriteria(AiBookSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Print)]
|
||||
public dynamic PrintBySearchCriteria(AiBookSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Insert)]
|
||||
[UnitOfWork]
|
||||
public AiBookEntity Insert(AiBookEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Insert)]
|
||||
[UnitOfWork]
|
||||
public void Insert(AiBookData data)
|
||||
{
|
||||
AiBookEntity entity = repository.DetachedEntities.Where(x => x.Title == data.AiBook.Title).FirstOrDefault();
|
||||
if (entity != null)
|
||||
{
|
||||
throw new ValidatedException("记录已存在.");
|
||||
}
|
||||
|
||||
repository.InsertNow(data.AiBook);
|
||||
|
||||
IRepository<AiChapterEntity> repositoryAiChapterEntity = repository.GetRepository<IRepository<AiChapterEntity>>();
|
||||
repositoryAiChapterEntity.InsertNow(data.AiChapters);
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Update)]
|
||||
[UnitOfWork]
|
||||
public AiBookEntity Update(AiBookEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Delete)]
|
||||
[UnitOfWork]
|
||||
public void Delete(string key)
|
||||
{
|
||||
var ent = repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
if (ent != null) { repository.DeleteNow(ent); }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
61
CloudBuilder.AI.Service/AiChapterPersonService.auto.cs
Normal file
61
CloudBuilder.AI.Service/AiChapterPersonService.auto.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.Policy;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public class AiChapterPersonService : IAiChapterPersonService
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
|
||||
private IRepository<AiChapterPersonEntity> repository;
|
||||
public AiChapterPersonService(IApplicationService service)
|
||||
{
|
||||
this.service = service;
|
||||
repository = service.GetRepository<IRepository<AiChapterPersonEntity>>();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiChapterPerson, operate: Operate.Find)]
|
||||
public AiChapterPersonEntity FindByKey(string key)
|
||||
{
|
||||
return repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiChapterPerson, operate: Operate.Find)]
|
||||
public dynamic FindBySearchCriteria(AiChapterPersonSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiChapterPerson, operate: Operate.Print)]
|
||||
public dynamic PrintBySearchCriteria(AiChapterPersonSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiChapterPerson, operate: Operate.Insert)]
|
||||
[UnitOfWork]
|
||||
public AiChapterPersonEntity Insert(AiChapterPersonEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiChapterPerson, operate: Operate.Update)]
|
||||
[UnitOfWork]
|
||||
public AiChapterPersonEntity Update(AiChapterPersonEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiChapterPerson, operate: Operate.Delete)]
|
||||
[UnitOfWork]
|
||||
public void Delete(string key)
|
||||
{
|
||||
var ent= repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
if (ent != null) { repository.DeleteNow(ent); }
|
||||
}
|
||||
}
|
||||
}
|
||||
72
CloudBuilder.AI.Service/AiChapterService.auto.cs
Normal file
72
CloudBuilder.AI.Service/AiChapterService.auto.cs
Normal file
@ -0,0 +1,72 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.Policy;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public class AiChapterService : IAiChapterService
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
|
||||
private IRepository<AiChapterEntity> repository;
|
||||
public AiChapterService(IApplicationService service)
|
||||
{
|
||||
this.service = service;
|
||||
repository = service.GetRepository<IRepository<AiChapterEntity>>();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiChapter, operate: Operate.Find)]
|
||||
public AiChapterEntity FindByKey(string key)
|
||||
{
|
||||
return repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiBook, operate: Operate.Find)]
|
||||
public AiChapterEntity[] FindByTitle(string title)
|
||||
{
|
||||
|
||||
IRepository<AiBookEntity> repositoryAiBookEntity = repository.GetRepository<IRepository<AiBookEntity>>();
|
||||
AiBookEntity aiBookEntity = repositoryAiBookEntity.DetachedEntities.Where(x => x.Title == title).FirstOrDefault()!;
|
||||
if (aiBookEntity == null) return null;
|
||||
|
||||
return repository.DetachedEntities.Where(x => x.BookGuid == aiBookEntity.Guid).ToArray();
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiChapter, operate: Operate.Find)]
|
||||
public dynamic FindBySearchCriteria(AiChapterSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiChapter, operate: Operate.Print)]
|
||||
public dynamic PrintBySearchCriteria(AiChapterSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiChapter, operate: Operate.Insert)]
|
||||
[UnitOfWork]
|
||||
public AiChapterEntity Insert(AiChapterEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiChapter, operate: Operate.Update)]
|
||||
[UnitOfWork]
|
||||
public AiChapterEntity Update(AiChapterEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiChapter, operate: Operate.Delete)]
|
||||
[UnitOfWork]
|
||||
public void Delete(string key)
|
||||
{
|
||||
var ent = repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
if (ent != null) { repository.DeleteNow(ent); }
|
||||
}
|
||||
}
|
||||
}
|
||||
68
CloudBuilder.AI.Service/AiParagraphService.auto.cs
Normal file
68
CloudBuilder.AI.Service/AiParagraphService.auto.cs
Normal file
@ -0,0 +1,68 @@
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.Policy;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public class AiParagraphService : IAiParagraphService
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
|
||||
private IRepository<AiParagraphEntity> repository;
|
||||
public AiParagraphService(IApplicationService service)
|
||||
{
|
||||
this.service = service;
|
||||
repository = service.GetRepository<IRepository<AiParagraphEntity>>();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiParagraph, operate: Operate.Find)]
|
||||
public AiParagraphEntity FindByKey(string key)
|
||||
{
|
||||
return repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiParagraph, operate: Operate.Find)]
|
||||
public dynamic FindBySearchCriteria(AiParagraphSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiParagraph, operate: Operate.Print)]
|
||||
public dynamic PrintBySearchCriteria(AiParagraphSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiParagraph, operate: Operate.Insert)]
|
||||
[UnitOfWork]
|
||||
public AiParagraphEntity Insert(AiParagraphEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiParagraph, operate: Operate.Insert)]
|
||||
[UnitOfWork]
|
||||
public void Inserts(AiParagraphEntity[] datas)
|
||||
{
|
||||
repository.InsertNow(datas);
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiParagraph, operate: Operate.Update)]
|
||||
[UnitOfWork]
|
||||
public AiParagraphEntity Update(AiParagraphEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiParagraph, operate: Operate.Delete)]
|
||||
[UnitOfWork]
|
||||
public void Delete(string key)
|
||||
{
|
||||
var ent= repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
if (ent != null) { repository.DeleteNow(ent); }
|
||||
}
|
||||
}
|
||||
}
|
||||
111
CloudBuilder.AI.Service/AiSentenceService.auto.cs
Normal file
111
CloudBuilder.AI.Service/AiSentenceService.auto.cs
Normal file
@ -0,0 +1,111 @@
|
||||
using CloudBuilder.AI.Data;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.Policy;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public class AiSentenceService : IAiSentenceService
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
|
||||
private IRepository<AiSentenceEntity> repository;
|
||||
public AiSentenceService(IApplicationService service)
|
||||
{
|
||||
this.service = service;
|
||||
repository = service.GetRepository<IRepository<AiSentenceEntity>>();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiSentence, operate: Operate.Find)]
|
||||
public AiSentenceEntity FindByKey(string key)
|
||||
{
|
||||
return repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiSentence, operate: Operate.Find)]
|
||||
public AiSentenceViewEntityResultData FindBySearchCriteria(AiSentenceSearchCriteria criteria)
|
||||
{
|
||||
AiSentenceViewEntityResultData data = new AiSentenceViewEntityResultData();
|
||||
AiSentenceViewEntity[] list = null;
|
||||
IRepository<AiSentenceViewEntity> repositoryAiSentenceViewEntity = repository.GetRepository<IRepository<AiSentenceViewEntity>>();
|
||||
|
||||
int count = 0;
|
||||
|
||||
string sqlWhere = null;
|
||||
|
||||
if (criteria.Filter != null && criteria.Filter.Length > 0)
|
||||
{
|
||||
sqlWhere = SearchFilter.ComposeWhereClause(criteria.Filter);
|
||||
}
|
||||
|
||||
AiSentenceViewEntity entity = AiSentenceViewEntity.GetInstance();
|
||||
string sql = entity.GetSelectTopFrom(criteria.limit, criteria.page, criteria.orderby.StringToDbField(), criteria.orderbytag, sqlWhere);
|
||||
|
||||
string err = null;
|
||||
try
|
||||
{
|
||||
list = repositoryAiSentenceViewEntity.FromSql(sql).ToArray();
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
err = ex.Message;
|
||||
}
|
||||
|
||||
|
||||
if (list != null && list.Length > 0)
|
||||
{
|
||||
sql = entity.GetSelectCountFrom(sqlWhere);
|
||||
count = (int)repository.ExecuteScalar(sql);
|
||||
}
|
||||
|
||||
data.Limit = criteria.limit;
|
||||
data.Page = criteria.page;
|
||||
data.Datas = list;
|
||||
data.Total = count;
|
||||
//data.Sql = sql;
|
||||
data.ErrorMessage = err;
|
||||
return data;
|
||||
}
|
||||
|
||||
//[PermissionOperate(name: AIPermissionPolicy.AiSentence, operate: Operate.Print)]
|
||||
public dynamic PrintBySearchCriteria(AiSentenceSearchCriteria criteria)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiSentence, operate: Operate.Insert)]
|
||||
[UnitOfWork]
|
||||
public AiSentenceEntity Insert(AiSentenceEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiParagraph, operate: Operate.Insert)]
|
||||
[UnitOfWork]
|
||||
public void Inserts(AiSentenceEntity[] datas)
|
||||
{
|
||||
repository.InsertNow(datas);
|
||||
}
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiSentence, operate: Operate.Update)]
|
||||
[UnitOfWork]
|
||||
public AiSentenceEntity Update(AiSentenceEntity data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
[PermissionOperate(name: AIPermissionPolicy.AiSentence, operate: Operate.Delete)]
|
||||
[UnitOfWork]
|
||||
public void Delete(string key)
|
||||
{
|
||||
var ent= repository.DetachedEntities.Where(x => x.Guid == key).FirstOrDefault()!;
|
||||
if (ent != null) { repository.DeleteNow(ent); }
|
||||
}
|
||||
}
|
||||
}
|
||||
47
CloudBuilder.AI.Service/CloudBuilder.AI.Service.csproj
Normal file
47
CloudBuilder.AI.Service/CloudBuilder.AI.Service.csproj
Normal file
@ -0,0 +1,47 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Utility\**" />
|
||||
<EmbeddedResource Remove="Utility\**" />
|
||||
<None Remove="Utility\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" />
|
||||
<PackageReference Include="ClosedXML" Version="0.102.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.OLE.Interop" Version="17.8.37221" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="CloudBuilder.AI">
|
||||
<HintPath>..\CloudBuilder.AI\bin\Debug\net8.0\CloudBuilder.AI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CloudBuilder.Core">
|
||||
<HintPath>..\CloudBuilder.Core\bin\Debug\net8.0\CloudBuilder.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CloudBuilder.Security">
|
||||
<HintPath>..\CloudBuilder.Security\bin\Debug\net8.0\CloudBuilder.Security.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="D:\MAFAI\CodeGenerator\CodeGenerator\bin\Debug\net8.0-windows\CodeGenerator.exe $(TargetPath)" />
|
||||
</Target>
|
||||
</Project>
|
||||
52
CloudBuilder.AI/CloudBuilder.AI.csproj
Normal file
52
CloudBuilder.AI/CloudBuilder.AI.csproj
Normal file
@ -0,0 +1,52 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.OLE.Interop" Version="17.8.37221" />
|
||||
<PackageReference Include="RazorEngineCore" Version="2023.11.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Linkup\" />
|
||||
<Folder Include="Publisher\" />
|
||||
<Folder Include="SearchCriteria\" />
|
||||
<Folder Include="Service\" />
|
||||
<Folder Include="Subscriber\" />
|
||||
<Folder Include="Utility\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="CloudBuilder.Core">
|
||||
<HintPath>..\CloudBuilder.Core\bin\Debug\net8.0\CloudBuilder.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CloudBuilder.Security">
|
||||
<HintPath>..\CloudBuilder.Security\bin\Debug\net8.0\CloudBuilder.Security.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
|
||||
</Target>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="D:\MAFAI\CodeGenerator\CodeGenerator\bin\Debug\net8.0-windows\CodeGenerator.exe $(TargetPath)" />
|
||||
</Target>
|
||||
</Project>
|
||||
19
CloudBuilder.AI/Data/AiBookData.cs
Normal file
19
CloudBuilder.AI/Data/AiBookData.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using CloudBuilder.AI.Entity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudBuilder.AI.Data
|
||||
{
|
||||
public class AiBookData
|
||||
{
|
||||
public AiBookData() { }
|
||||
public AiBookEntity AiBook { get; set; }
|
||||
public AiChapterEntity[]? AiChapters { get; set; }
|
||||
public AiBookPersonEntity[]? AiBookPersons { get; set; }
|
||||
public AiParagraphEntity[]? AiParagraphs { get; set; }
|
||||
public AiSentenceEntity[]? AiSentences { get; set; }
|
||||
}
|
||||
}
|
||||
18
CloudBuilder.AI/Data/AiSentenceViewEntityResultData.cs
Normal file
18
CloudBuilder.AI/Data/AiSentenceViewEntityResultData.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Entity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudBuilder.AI.Data
|
||||
{
|
||||
[TypeScript]
|
||||
public class AiSentenceViewEntityResultData : SearchCriteriaResultData
|
||||
{
|
||||
public AiSentenceViewEntity[]? Datas { get; set; }
|
||||
}
|
||||
}
|
||||
133
CloudBuilder.AI/Entity/AiBookEntity.auto.cs
Normal file
133
CloudBuilder.AI/Entity/AiBookEntity.auto.cs
Normal file
@ -0,0 +1,133 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_book")]
|
||||
public class AiBookEntity : EntityBase<string>
|
||||
{
|
||||
|
||||
public AiBookEntity()
|
||||
{
|
||||
}
|
||||
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Key]
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("title")]
|
||||
public string Title { get; set; }
|
||||
[Column("author")]
|
||||
public string? Author { get; set; }
|
||||
[Column("description")]
|
||||
public string? Description { get; set; }
|
||||
[Column("book_type")]
|
||||
public string? BookType { get; set; }
|
||||
[Column("file_path")]
|
||||
public string? FilePath { get; set; }
|
||||
[Column("status")]
|
||||
public string Status { get; set; }
|
||||
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
public const string UPDATED_BY = "UpdatedBy";
|
||||
public const string GUID = "Guid";
|
||||
public const string TITLE = "Title";
|
||||
public const string AUTHOR = "Author";
|
||||
public const string DESCRIPTION = "Description";
|
||||
public const string BOOK_TYPE = "BookType";
|
||||
public const string FILE_PATH = "FilePath";
|
||||
public const string STATUS = "Status";
|
||||
|
||||
public const string DB_NAME_AI_BOOK = "ai_book";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,title,author,description,book_type,file_path,status";
|
||||
|
||||
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
public const string DB_UPDATED_BY = "updated_by";
|
||||
public const string DB_GUID = "guid";
|
||||
public const string DB_TITLE = "title";
|
||||
public const string DB_AUTHOR = "author";
|
||||
public const string DB_DESCRIPTION = "description";
|
||||
public const string DB_BOOK_TYPE = "book_type";
|
||||
public const string DB_FILE_PATH = "file_path";
|
||||
public const string DB_STATUS = "status";
|
||||
|
||||
|
||||
public static AiBookEntity GetInstance()
|
||||
{
|
||||
return new AiBookEntity();
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiBookEntity source)
|
||||
{
|
||||
CopyFrom(source, true);
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiBookEntity source, bool includeSystemFields)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.Title = source.Title;
|
||||
this.Author = source.Author;
|
||||
this.Description = source.Description;
|
||||
this.BookType = source.BookType;
|
||||
this.FilePath = source.FilePath;
|
||||
this.Status = source.Status;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetSelectFrom()
|
||||
{
|
||||
return $" select {DB_NAME_FIELDS} from { DB_NAME_AI_BOOK} with(nolock) ";
|
||||
}
|
||||
|
||||
public override string GetSelectCountFrom(string sqlWhere)
|
||||
{
|
||||
return $" select count(*) from { DB_NAME_AI_BOOK} with(nolock) where 1=1 {sqlWhere}";
|
||||
}
|
||||
|
||||
public override string GetSelectTopFrom(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_GUID ;
|
||||
string top = limit > 0 ? $"top {limit}" : "";
|
||||
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_AI_BOOK} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||
}
|
||||
|
||||
public AiBookEntity Clone()
|
||||
{
|
||||
AiBookEntity result = new AiBookEntity();
|
||||
result.CopyFrom(this);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
138
CloudBuilder.AI/Entity/AiBookPersonEntity.auto.cs
Normal file
138
CloudBuilder.AI/Entity/AiBookPersonEntity.auto.cs
Normal file
@ -0,0 +1,138 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_book_person")]
|
||||
public class AiBookPersonEntity : EntityBase<string>
|
||||
{
|
||||
|
||||
public AiBookPersonEntity()
|
||||
{
|
||||
}
|
||||
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Key]
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("book_guid")]
|
||||
public string BookGuid { get; set; }
|
||||
[Column("person_name")]
|
||||
public string PersonName { get; set; }
|
||||
[Column("actor_name")]
|
||||
public string? ActorName { get; set; }
|
||||
[Column("gender")]
|
||||
public string? Gender { get; set; }
|
||||
[Column("sentiment")]
|
||||
public string? Sentiment { get; set; }
|
||||
[Column("sound_file_path")]
|
||||
public string? SoundFilePath { get; set; }
|
||||
[Column("status")]
|
||||
public string? Status { get; set; }
|
||||
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
public const string UPDATED_BY = "UpdatedBy";
|
||||
public const string GUID = "Guid";
|
||||
public const string BOOK_GUID = "BookGuid";
|
||||
public const string PERSON_NAME = "PersonName";
|
||||
public const string ACTOR_NAME = "ActorName";
|
||||
public const string GENDER = "Gender";
|
||||
public const string SENTIMENT = "Sentiment";
|
||||
public const string SOUND_FILE_PATH = "SoundFilePath";
|
||||
public const string STATUS = "Status";
|
||||
|
||||
public const string DB_NAME_AI_BOOK_PERSON = "ai_book_person";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,book_guid,person_name,actor_name,gender,sentiment,sound_file_path,status";
|
||||
|
||||
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
public const string DB_UPDATED_BY = "updated_by";
|
||||
public const string DB_GUID = "guid";
|
||||
public const string DB_BOOK_GUID = "book_guid";
|
||||
public const string DB_PERSON_NAME = "person_name";
|
||||
public const string DB_ACTOR_NAME = "actor_name";
|
||||
public const string DB_GENDER = "gender";
|
||||
public const string DB_SENTIMENT = "sentiment";
|
||||
public const string DB_SOUND_FILE_PATH = "sound_file_path";
|
||||
public const string DB_STATUS = "status";
|
||||
|
||||
|
||||
public static AiBookPersonEntity GetInstance()
|
||||
{
|
||||
return new AiBookPersonEntity();
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiBookPersonEntity source)
|
||||
{
|
||||
CopyFrom(source, true);
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiBookPersonEntity source, bool includeSystemFields)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.BookGuid = source.BookGuid;
|
||||
this.PersonName = source.PersonName;
|
||||
this.ActorName = source.ActorName;
|
||||
this.Gender = source.Gender;
|
||||
this.Sentiment = source.Sentiment;
|
||||
this.SoundFilePath = source.SoundFilePath;
|
||||
this.Status = source.Status;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetSelectFrom()
|
||||
{
|
||||
return $" select {DB_NAME_FIELDS} from { DB_NAME_AI_BOOK_PERSON} with(nolock) ";
|
||||
}
|
||||
|
||||
public override string GetSelectCountFrom(string sqlWhere)
|
||||
{
|
||||
return $" select count(*) from { DB_NAME_AI_BOOK_PERSON} with(nolock) where 1=1 {sqlWhere}";
|
||||
}
|
||||
|
||||
public override string GetSelectTopFrom(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_GUID ;
|
||||
string top = limit > 0 ? $"top {limit}" : "";
|
||||
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_AI_BOOK_PERSON} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||
}
|
||||
|
||||
public AiBookPersonEntity Clone()
|
||||
{
|
||||
AiBookPersonEntity result = new AiBookPersonEntity();
|
||||
result.CopyFrom(this);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
128
CloudBuilder.AI/Entity/AiChapterEntity.auto.cs
Normal file
128
CloudBuilder.AI/Entity/AiChapterEntity.auto.cs
Normal file
@ -0,0 +1,128 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_chapter")]
|
||||
public class AiChapterEntity : EntityBase<string>
|
||||
{
|
||||
|
||||
public AiChapterEntity()
|
||||
{
|
||||
}
|
||||
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Key]
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("book_guid")]
|
||||
public string BookGuid { get; set; }
|
||||
[Column("chapter_index")]
|
||||
public int ChapterIndex { get; set; }
|
||||
[Column("title")]
|
||||
public string Title { get; set; }
|
||||
[Column("content")]
|
||||
public string Content { get; set; }
|
||||
[Column("status")]
|
||||
public string Status { get; set; }
|
||||
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
public const string UPDATED_BY = "UpdatedBy";
|
||||
public const string GUID = "Guid";
|
||||
public const string BOOK_GUID = "BookGuid";
|
||||
public const string CHAPTER_INDEX = "ChapterIndex";
|
||||
public const string TITLE = "Title";
|
||||
public const string CONTENT = "Content";
|
||||
public const string STATUS = "Status";
|
||||
|
||||
public const string DB_NAME_AI_CHAPTER = "ai_chapter";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,book_guid,chapter_index,title,content,status";
|
||||
|
||||
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
public const string DB_UPDATED_BY = "updated_by";
|
||||
public const string DB_GUID = "guid";
|
||||
public const string DB_BOOK_GUID = "book_guid";
|
||||
public const string DB_CHAPTER_INDEX = "chapter_index";
|
||||
public const string DB_TITLE = "title";
|
||||
public const string DB_CONTENT = "content";
|
||||
public const string DB_STATUS = "status";
|
||||
|
||||
|
||||
public static AiChapterEntity GetInstance()
|
||||
{
|
||||
return new AiChapterEntity();
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiChapterEntity source)
|
||||
{
|
||||
CopyFrom(source, true);
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiChapterEntity source, bool includeSystemFields)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.BookGuid = source.BookGuid;
|
||||
this.ChapterIndex = source.ChapterIndex;
|
||||
this.Title = source.Title;
|
||||
this.Content = source.Content;
|
||||
this.Status = source.Status;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetSelectFrom()
|
||||
{
|
||||
return $" select {DB_NAME_FIELDS} from { DB_NAME_AI_CHAPTER} with(nolock) ";
|
||||
}
|
||||
|
||||
public override string GetSelectCountFrom(string sqlWhere)
|
||||
{
|
||||
return $" select count(*) from { DB_NAME_AI_CHAPTER} with(nolock) where 1=1 {sqlWhere}";
|
||||
}
|
||||
|
||||
public override string GetSelectTopFrom(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_GUID ;
|
||||
string top = limit > 0 ? $"top {limit}" : "";
|
||||
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_AI_CHAPTER} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||
}
|
||||
|
||||
public AiChapterEntity Clone()
|
||||
{
|
||||
AiChapterEntity result = new AiChapterEntity();
|
||||
result.CopyFrom(this);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
118
CloudBuilder.AI/Entity/AiChapterPersonEntity.auto.cs
Normal file
118
CloudBuilder.AI/Entity/AiChapterPersonEntity.auto.cs
Normal file
@ -0,0 +1,118 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_chapter_person")]
|
||||
public class AiChapterPersonEntity : EntityBase<string>
|
||||
{
|
||||
|
||||
public AiChapterPersonEntity()
|
||||
{
|
||||
}
|
||||
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Key]
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("chapter_guid")]
|
||||
public string ChapterGuid { get; set; }
|
||||
[Column("person_name")]
|
||||
public string PersonName { get; set; }
|
||||
[Column("person_mapping")]
|
||||
public string PersonMapping { get; set; }
|
||||
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
public const string UPDATED_BY = "UpdatedBy";
|
||||
public const string GUID = "Guid";
|
||||
public const string CHAPTER_GUID = "ChapterGuid";
|
||||
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_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
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_PERSON_NAME = "person_name";
|
||||
public const string DB_PERSON_MAPPING = "person_mapping";
|
||||
|
||||
|
||||
public static AiChapterPersonEntity GetInstance()
|
||||
{
|
||||
return new AiChapterPersonEntity();
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiChapterPersonEntity source)
|
||||
{
|
||||
CopyFrom(source, true);
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiChapterPersonEntity source, bool includeSystemFields)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.ChapterGuid = source.ChapterGuid;
|
||||
this.PersonName = source.PersonName;
|
||||
this.PersonMapping = source.PersonMapping;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetSelectFrom()
|
||||
{
|
||||
return $" select {DB_NAME_FIELDS} from { DB_NAME_AI_CHAPTER_PERSON} with(nolock) ";
|
||||
}
|
||||
|
||||
public override string GetSelectCountFrom(string sqlWhere)
|
||||
{
|
||||
return $" select count(*) from { DB_NAME_AI_CHAPTER_PERSON} with(nolock) where 1=1 {sqlWhere}";
|
||||
}
|
||||
|
||||
public override string GetSelectTopFrom(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_GUID ;
|
||||
string top = limit > 0 ? $"top {limit}" : "";
|
||||
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_AI_CHAPTER_PERSON} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||
}
|
||||
|
||||
public AiChapterPersonEntity Clone()
|
||||
{
|
||||
AiChapterPersonEntity result = new AiChapterPersonEntity();
|
||||
result.CopyFrom(this);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
123
CloudBuilder.AI/Entity/AiParagraphEntity.auto.cs
Normal file
123
CloudBuilder.AI/Entity/AiParagraphEntity.auto.cs
Normal file
@ -0,0 +1,123 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_paragraph")]
|
||||
public class AiParagraphEntity : EntityBase<string>
|
||||
{
|
||||
|
||||
public AiParagraphEntity()
|
||||
{
|
||||
}
|
||||
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Key]
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("chapter_guid")]
|
||||
public string ChapterGuid { get; set; }
|
||||
[Column("paragraph_index")]
|
||||
public int ParagraphIndex { get; set; }
|
||||
[Column("content")]
|
||||
public string Content { get; set; }
|
||||
[Column("dialogue_indc")]
|
||||
public string? DialogueIndc { get; set; }
|
||||
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
public const string UPDATED_BY = "UpdatedBy";
|
||||
public const string GUID = "Guid";
|
||||
public const string CHAPTER_GUID = "ChapterGuid";
|
||||
public const string PARAGRAPH_INDEX = "ParagraphIndex";
|
||||
public const string CONTENT = "Content";
|
||||
public const string DIALOGUE_INDC = "DialogueIndc";
|
||||
|
||||
public const string DB_NAME_AI_PARAGRAPH = "ai_paragraph";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,chapter_guid,paragraph_index,content,dialogue_indc";
|
||||
|
||||
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
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_INDEX = "paragraph_index";
|
||||
public const string DB_CONTENT = "content";
|
||||
public const string DB_DIALOGUE_INDC = "dialogue_indc";
|
||||
|
||||
|
||||
public static AiParagraphEntity GetInstance()
|
||||
{
|
||||
return new AiParagraphEntity();
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiParagraphEntity source)
|
||||
{
|
||||
CopyFrom(source, true);
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiParagraphEntity source, bool includeSystemFields)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.ChapterGuid = source.ChapterGuid;
|
||||
this.ParagraphIndex = source.ParagraphIndex;
|
||||
this.Content = source.Content;
|
||||
this.DialogueIndc = source.DialogueIndc;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetSelectFrom()
|
||||
{
|
||||
return $" select {DB_NAME_FIELDS} from { DB_NAME_AI_PARAGRAPH} with(nolock) ";
|
||||
}
|
||||
|
||||
public override string GetSelectCountFrom(string sqlWhere)
|
||||
{
|
||||
return $" select count(*) from { DB_NAME_AI_PARAGRAPH} with(nolock) where 1=1 {sqlWhere}";
|
||||
}
|
||||
|
||||
public override string GetSelectTopFrom(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_GUID ;
|
||||
string top = limit > 0 ? $"top {limit}" : "";
|
||||
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_AI_PARAGRAPH} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||
}
|
||||
|
||||
public AiParagraphEntity Clone()
|
||||
{
|
||||
AiParagraphEntity result = new AiParagraphEntity();
|
||||
result.CopyFrom(this);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
143
CloudBuilder.AI/Entity/AiSentenceEntity.auto.cs
Normal file
143
CloudBuilder.AI/Entity/AiSentenceEntity.auto.cs
Normal file
@ -0,0 +1,143 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_sentence")]
|
||||
public class AiSentenceEntity : EntityBase<string>
|
||||
{
|
||||
|
||||
public AiSentenceEntity()
|
||||
{
|
||||
}
|
||||
|
||||
[Column("person_name")]
|
||||
public string? PersonName { get; set; }
|
||||
[Column("gender")]
|
||||
public string? Gender { get; set; }
|
||||
[Column("sentiment")]
|
||||
public string? Sentiment { get; set; }
|
||||
[Column("content")]
|
||||
public string Content { get; set; }
|
||||
[Column("status")]
|
||||
public string? Status { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Key]
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("paragraph_guid")]
|
||||
public string ParagraphGuid { get; set; }
|
||||
[Column("sentence_index")]
|
||||
public int SentenceIndex { get; set; }
|
||||
[Column("dialogue_indc")]
|
||||
public string DialogueIndc { get; set; }
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public const string PERSON_NAME = "PersonName";
|
||||
public const string GENDER = "Gender";
|
||||
public const string SENTIMENT = "Sentiment";
|
||||
public const string CONTENT = "Content";
|
||||
public const string STATUS = "Status";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
public const string UPDATED_BY = "UpdatedBy";
|
||||
public const string GUID = "Guid";
|
||||
public const string PARAGRAPH_GUID = "ParagraphGuid";
|
||||
public const string SENTENCE_INDEX = "SentenceIndex";
|
||||
public const string DIALOGUE_INDC = "DialogueIndc";
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
|
||||
public const string DB_NAME_AI_SENTENCE = "ai_sentence";
|
||||
public const string DB_NAME_FIELDS="person_name,gender,sentiment,content,status,updated_datetime,updated_by,guid,paragraph_guid,sentence_index,dialogue_indc,created_datetime,created_by";
|
||||
|
||||
public const string DB_PERSON_NAME = "person_name";
|
||||
public const string DB_GENDER = "gender";
|
||||
public const string DB_SENTIMENT = "sentiment";
|
||||
public const string DB_CONTENT = "content";
|
||||
public const string DB_STATUS = "status";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
public const string DB_UPDATED_BY = "updated_by";
|
||||
public const string DB_GUID = "guid";
|
||||
public const string DB_PARAGRAPH_GUID = "paragraph_guid";
|
||||
public const string DB_SENTENCE_INDEX = "sentence_index";
|
||||
public const string DB_DIALOGUE_INDC = "dialogue_indc";
|
||||
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
|
||||
|
||||
public static AiSentenceEntity GetInstance()
|
||||
{
|
||||
return new AiSentenceEntity();
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiSentenceEntity source)
|
||||
{
|
||||
CopyFrom(source, true);
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiSentenceEntity source, bool includeSystemFields)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.PersonName = source.PersonName;
|
||||
this.Gender = source.Gender;
|
||||
this.Sentiment = source.Sentiment;
|
||||
this.Content = source.Content;
|
||||
this.Status = source.Status;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.ParagraphGuid = source.ParagraphGuid;
|
||||
this.SentenceIndex = source.SentenceIndex;
|
||||
this.DialogueIndc = source.DialogueIndc;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetSelectFrom()
|
||||
{
|
||||
return $" select {DB_NAME_FIELDS} from { DB_NAME_AI_SENTENCE} with(nolock) ";
|
||||
}
|
||||
|
||||
public override string GetSelectCountFrom(string sqlWhere)
|
||||
{
|
||||
return $" select count(*) from { DB_NAME_AI_SENTENCE} with(nolock) where 1=1 {sqlWhere}";
|
||||
}
|
||||
|
||||
public override string GetSelectTopFrom(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_GUID ;
|
||||
string top = limit > 0 ? $"top {limit}" : "";
|
||||
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_AI_SENTENCE} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||
}
|
||||
|
||||
public AiSentenceEntity Clone()
|
||||
{
|
||||
AiSentenceEntity result = new AiSentenceEntity();
|
||||
result.CopyFrom(this);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
152
CloudBuilder.AI/Entity/AiSentenceViewEntity.auto.cs
Normal file
152
CloudBuilder.AI/Entity/AiSentenceViewEntity.auto.cs
Normal file
@ -0,0 +1,152 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_sentence_view")]
|
||||
public class AiSentenceViewEntity : ViewEntityBase
|
||||
{
|
||||
|
||||
public AiSentenceViewEntity()
|
||||
{
|
||||
}
|
||||
|
||||
[Column("chapter_guid")]
|
||||
public string? ChapterGuid { get; set; }
|
||||
[Column("paragraph_index")]
|
||||
public int ParagraphIndex { get; set; }
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Column("sentiment")]
|
||||
public string? Sentiment { get; set; }
|
||||
[Column("content")]
|
||||
public string Content { get; set; }
|
||||
[Column("status")]
|
||||
public string? Status { get; set; }
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("paragraph_guid")]
|
||||
public string ParagraphGuid { get; set; }
|
||||
[Column("sentence_index")]
|
||||
public int SentenceIndex { get; set; }
|
||||
[Column("dialogue_indc")]
|
||||
public string DialogueIndc { get; set; }
|
||||
[Column("person_name")]
|
||||
public string? PersonName { get; set; }
|
||||
[Column("gender")]
|
||||
public string? Gender { get; set; }
|
||||
|
||||
public const string CHAPTER_GUID = "ChapterGuid";
|
||||
public const string PARAGRAPH_INDEX = "ParagraphIndex";
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
public const string UPDATED_BY = "UpdatedBy";
|
||||
public const string SENTIMENT = "Sentiment";
|
||||
public const string CONTENT = "Content";
|
||||
public const string STATUS = "Status";
|
||||
public const string GUID = "Guid";
|
||||
public const string PARAGRAPH_GUID = "ParagraphGuid";
|
||||
public const string SENTENCE_INDEX = "SentenceIndex";
|
||||
public const string DIALOGUE_INDC = "DialogueIndc";
|
||||
public const string PERSON_NAME = "PersonName";
|
||||
public const string GENDER = "Gender";
|
||||
|
||||
public const string DB_NAME_AI_SENTENCE_VIEW = "ai_sentence_view";
|
||||
public const string DB_NAME_FIELDS="chapter_guid,paragraph_index,created_datetime,created_by,updated_datetime,updated_by,sentiment,content,status,guid,paragraph_guid,sentence_index,dialogue_indc,person_name,gender";
|
||||
|
||||
public const string DB_CHAPTER_GUID = "chapter_guid";
|
||||
public const string DB_PARAGRAPH_INDEX = "paragraph_index";
|
||||
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
public const string DB_UPDATED_BY = "updated_by";
|
||||
public const string DB_SENTIMENT = "sentiment";
|
||||
public const string DB_CONTENT = "content";
|
||||
public const string DB_STATUS = "status";
|
||||
public const string DB_GUID = "guid";
|
||||
public const string DB_PARAGRAPH_GUID = "paragraph_guid";
|
||||
public const string DB_SENTENCE_INDEX = "sentence_index";
|
||||
public const string DB_DIALOGUE_INDC = "dialogue_indc";
|
||||
public const string DB_PERSON_NAME = "person_name";
|
||||
public const string DB_GENDER = "gender";
|
||||
|
||||
|
||||
public static AiSentenceViewEntity GetInstance()
|
||||
{
|
||||
return new AiSentenceViewEntity();
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiSentenceViewEntity source)
|
||||
{
|
||||
CopyFrom(source, true);
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiSentenceViewEntity source, bool includeSystemFields)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.ChapterGuid = source.ChapterGuid;
|
||||
this.ParagraphIndex = source.ParagraphIndex;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Sentiment = source.Sentiment;
|
||||
this.Content = source.Content;
|
||||
this.Status = source.Status;
|
||||
this.Guid = source.Guid;
|
||||
this.ParagraphGuid = source.ParagraphGuid;
|
||||
this.SentenceIndex = source.SentenceIndex;
|
||||
this.DialogueIndc = source.DialogueIndc;
|
||||
this.PersonName = source.PersonName;
|
||||
this.Gender = source.Gender;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetSelectFrom()
|
||||
{
|
||||
return $" select {DB_NAME_FIELDS} from { DB_NAME_AI_SENTENCE_VIEW} with(nolock) ";
|
||||
}
|
||||
|
||||
public override string GetSelectCountFrom(string sqlWhere)
|
||||
{
|
||||
return $" select count(*) from { DB_NAME_AI_SENTENCE_VIEW} with(nolock) where 1=1 {sqlWhere}";
|
||||
}
|
||||
|
||||
public override string GetSelectTopFrom(int limit, int start,string orderby,string orderbytag, string sqlWhere)
|
||||
{
|
||||
if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc";
|
||||
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_CHAPTER_GUID ; string top = limit > 0 ? $"top {limit}" : "";
|
||||
return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_AI_SENTENCE_VIEW} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||
}
|
||||
|
||||
public AiSentenceViewEntity Clone()
|
||||
{
|
||||
AiSentenceViewEntity result = new AiSentenceViewEntity();
|
||||
result.CopyFrom(this);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
43
CloudBuilder.AI/Entity/CloudBuilderAIRegistEntity.auto.cs
Normal file
43
CloudBuilder.AI/Entity/CloudBuilderAIRegistEntity.auto.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using CloudBuilder.Core.DependencyInjection.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Reflection;
|
||||
|
||||
namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
public class CloudBuilderAIRegistEntity : IMasterRegistEntityType<ModelBuilder>
|
||||
{
|
||||
///<summary>
|
||||
///注入模块内的所有实体类
|
||||
///</summary>
|
||||
///<param name="builder"></param>
|
||||
public void RegistEntity(ModelBuilder builder)
|
||||
{
|
||||
string _assemblyName = Assembly.GetExecutingAssembly().GetName().Name;
|
||||
//注入所有Entity实体类
|
||||
AddEntityType(builder, _assemblyName);
|
||||
//如果Entity实体类不是单一主键,要单独重写注入
|
||||
RegistKeys(builder);
|
||||
}
|
||||
|
||||
public void AddEntityType(ModelBuilder builder, string _assemblyName)
|
||||
{
|
||||
RegistEntityHelper.AddMasterEntityType(builder, _assemblyName);
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///如果存在多个主键的,要在RegistKeys方法注入
|
||||
///builder.Entity<xxxxxxEntity>().HasKey(c => new { c.TableName, c.FieldName });
|
||||
///builder.Entity<xxxxxxEntity>(eb => { eb.HasNoKey(); });
|
||||
///</summary>
|
||||
///<param name="builder"></param>
|
||||
public void RegistKeys(ModelBuilder builder)
|
||||
{
|
||||
//***BEGIN***
|
||||
|
||||
|
||||
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
|
||||
//***END***
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
CloudBuilder.AI/Policy/AIPermissionPolicy.auto.cs
Normal file
16
CloudBuilder.AI/Policy/AIPermissionPolicy.auto.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace CloudBuilder.AI.Policy
|
||||
{
|
||||
public partial class AIPermissionPolicy
|
||||
{
|
||||
//***BEGIN***
|
||||
public const string AiCharacter = "AiCharacter";
|
||||
public const string AiSentence = "AiSentence";
|
||||
public const string AiWord = "AiWord";
|
||||
public const string AiBook = "AiBook";
|
||||
public const string AiBookPerson = "AiBookPerson";
|
||||
public const string AiChapter = "AiChapter";
|
||||
public const string AiChapterPerson = "AiChapterPerson";
|
||||
public const string AiParagraph = "AiParagraph";
|
||||
//***END***
|
||||
}
|
||||
}
|
||||
28
CloudBuilder.AI/Policy/BookStatusPolicy.cs
Normal file
28
CloudBuilder.AI/Policy/BookStatusPolicy.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using CloudBuilder.Core.DependencyInjection.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudBuilder.AI.Policy
|
||||
{
|
||||
public class BookStatusPolicy : LocalePolicy, IPolicy
|
||||
{
|
||||
public const string SUBMIT = "S";//待提交
|
||||
|
||||
|
||||
private readonly IContext context;
|
||||
private readonly ILocaleMessageManager localeMessageManager;
|
||||
|
||||
public BookStatusPolicy(IContext context, ILocaleMessageManager localeMessageManager) : base(context, localeMessageManager)
|
||||
{
|
||||
this.context = context;
|
||||
this.localeMessageManager = localeMessageManager;
|
||||
|
||||
this.Name = typeof(BookStatusPolicy).Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
CloudBuilder.AI/Policy/ChapterStatusPolicy.cs
Normal file
29
CloudBuilder.AI/Policy/ChapterStatusPolicy.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using CloudBuilder.Core.DependencyInjection.Policy;
|
||||
using CloudBuilder.Core.DependencyInjection.Request;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudBuilder.AI.Policy
|
||||
{
|
||||
|
||||
public class ChapterStatusPolicy : LocalePolicy, IPolicy
|
||||
{
|
||||
public const string PROCESS = "P";//处理中
|
||||
|
||||
|
||||
private readonly IContext context;
|
||||
private readonly ILocaleMessageManager localeMessageManager;
|
||||
|
||||
public ChapterStatusPolicy(IContext context, ILocaleMessageManager localeMessageManager) : base(context, localeMessageManager)
|
||||
{
|
||||
this.context = context;
|
||||
this.localeMessageManager = localeMessageManager;
|
||||
|
||||
this.Name = typeof(BookStatusPolicy).Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.Service;
|
||||
namespace CloudBuilder.AI.SearchCriteria
|
||||
{
|
||||
[TypeScript]
|
||||
public class AiBookPersonSearchCriteria: AbstractSearchCriteria
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
10
CloudBuilder.AI/SearchCriteria/AiBookSearchCriteria.auto.cs
Normal file
10
CloudBuilder.AI/SearchCriteria/AiBookSearchCriteria.auto.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.Service;
|
||||
namespace CloudBuilder.AI.SearchCriteria
|
||||
{
|
||||
[TypeScript]
|
||||
public class AiBookSearchCriteria: AbstractSearchCriteria
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.Service;
|
||||
namespace CloudBuilder.AI.SearchCriteria
|
||||
{
|
||||
[TypeScript]
|
||||
public class AiChapterPersonSearchCriteria: AbstractSearchCriteria
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.Service;
|
||||
namespace CloudBuilder.AI.SearchCriteria
|
||||
{
|
||||
[TypeScript]
|
||||
public class AiChapterSearchCriteria: AbstractSearchCriteria
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.Service;
|
||||
namespace CloudBuilder.AI.SearchCriteria
|
||||
{
|
||||
[TypeScript]
|
||||
public class AiParagraphSearchCriteria: AbstractSearchCriteria
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
using CloudBuilder.Core.Service;
|
||||
namespace CloudBuilder.AI.SearchCriteria
|
||||
{
|
||||
[TypeScript]
|
||||
public class AiSentenceSearchCriteria: AbstractSearchCriteria
|
||||
{
|
||||
}
|
||||
}
|
||||
11
CloudBuilder.AI/Service/IAiBookPersonService.auto.cs
Normal file
11
CloudBuilder.AI/Service/IAiBookPersonService.auto.cs
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.Service;
|
||||
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiBookPersonService :IServiceBase<AiBookPersonEntity, string ,AiBookPersonSearchCriteria>
|
||||
{
|
||||
}
|
||||
}
|
||||
14
CloudBuilder.AI/Service/IAiBookService.auto.cs
Normal file
14
CloudBuilder.AI/Service/IAiBookService.auto.cs
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
using CloudBuilder.AI.Data;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.Service;
|
||||
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiBookService : IServiceBase<AiBookEntity, string, AiBookSearchCriteria>
|
||||
{
|
||||
AiBookEntity FindByTitle(string title);
|
||||
void Insert(AiBookData data);
|
||||
}
|
||||
}
|
||||
11
CloudBuilder.AI/Service/IAiChapterPersonService.auto.cs
Normal file
11
CloudBuilder.AI/Service/IAiChapterPersonService.auto.cs
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.Service;
|
||||
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiChapterPersonService :IServiceBase<AiChapterPersonEntity, string ,AiChapterPersonSearchCriteria>
|
||||
{
|
||||
}
|
||||
}
|
||||
12
CloudBuilder.AI/Service/IAiChapterService.auto.cs
Normal file
12
CloudBuilder.AI/Service/IAiChapterService.auto.cs
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.Service;
|
||||
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiChapterService :IServiceBase<AiChapterEntity, string ,AiChapterSearchCriteria>
|
||||
{
|
||||
AiChapterEntity[] FindByTitle(string title);
|
||||
}
|
||||
}
|
||||
13
CloudBuilder.AI/Service/IAiParagraphService.auto.cs
Normal file
13
CloudBuilder.AI/Service/IAiParagraphService.auto.cs
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
using CloudBuilder.AI.Data;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.Service;
|
||||
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiParagraphService :IServiceBase<AiParagraphEntity, string ,AiParagraphSearchCriteria>
|
||||
{
|
||||
void Inserts(AiParagraphEntity[] datas);
|
||||
}
|
||||
}
|
||||
14
CloudBuilder.AI/Service/IAiSentenceService.auto.cs
Normal file
14
CloudBuilder.AI/Service/IAiSentenceService.auto.cs
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
using CloudBuilder.AI.Data;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.Service;
|
||||
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiSentenceService :IServiceBase<AiSentenceEntity, string ,AiSentenceSearchCriteria>
|
||||
{
|
||||
AiSentenceViewEntityResultData FindBySearchCriteria(AiSentenceSearchCriteria criteria);
|
||||
void Inserts(AiSentenceEntity[] datas);
|
||||
}
|
||||
}
|
||||
154
CloudBuilder.Web.Entry/Controllers/Ai/AiBookController.auto.cs
Normal file
154
CloudBuilder.Web.Entry/Controllers/Ai/AiBookController.auto.cs
Normal file
@ -0,0 +1,154 @@
|
||||
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.AI.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using System;
|
||||
using CloudBuilder.AI.Data;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Ai
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class AiBookController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly IAiBookService aiBookService;
|
||||
|
||||
public AiBookController(IApplicationService service, IAiBookService aiBookService)
|
||||
{
|
||||
this.service = service;
|
||||
this.aiBookService= aiBookService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiBookService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByTitle(string title)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiBookService.FindByTitle(title);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(AiBookEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiBookService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(AiBookData data){
|
||||
try
|
||||
{
|
||||
aiBookService.Insert(data);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(AiBookEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiBookService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
aiBookService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.AI.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using System;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Ai
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class AiBookPersonController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly IAiBookPersonService aiBookPersonService;
|
||||
|
||||
public AiBookPersonController(IApplicationService service, IAiBookPersonService aiBookPersonService)
|
||||
{
|
||||
this.service = service;
|
||||
this.aiBookPersonService= aiBookPersonService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBookPerson", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiBookPersonService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBookPerson", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(AiBookPersonEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiBookPersonService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBookPerson", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(AiBookPersonEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiBookPersonService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBookPerson", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
aiBookPersonService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,134 @@
|
||||
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.AI.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using System;
|
||||
using CloudBuilder.AI.Data;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Ai
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class AiChapterController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly IAiChapterService aiChapterService;
|
||||
|
||||
public AiChapterController(IApplicationService service, IAiChapterService aiChapterService)
|
||||
{
|
||||
this.service = service;
|
||||
this.aiChapterService= aiChapterService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiChapter", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiChapterService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByTitle(string title)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiChapterService.FindByTitle(title);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiChapter", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(AiChapterEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiChapterService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiChapter", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(AiChapterEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiChapterService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiChapter", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
aiChapterService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.AI.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using System;
|
||||
using CloudBuilder.AI.Data;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Ai
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class AiChapterPersonController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly IAiChapterPersonService aiChapterPersonService;
|
||||
|
||||
public AiChapterPersonController(IApplicationService service, IAiChapterPersonService aiChapterPersonService)
|
||||
{
|
||||
this.service = service;
|
||||
this.aiChapterPersonService= aiChapterPersonService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiChapterPerson", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiChapterPersonService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiChapterPerson", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(AiChapterPersonEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiChapterPersonService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiChapterPerson", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(AiChapterPersonEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiChapterPersonService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiChapterPerson", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
aiChapterPersonService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,134 @@
|
||||
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.AI.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using System;
|
||||
using CloudBuilder.AI.Data;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Ai
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class AiParagraphController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly IAiParagraphService aiParagraphService;
|
||||
|
||||
public AiParagraphController(IApplicationService service, IAiParagraphService aiParagraphService)
|
||||
{
|
||||
this.service = service;
|
||||
this.aiParagraphService= aiParagraphService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiParagraph", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiParagraphService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiParagraph", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(AiParagraphEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiParagraphService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiParagraph", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Inserts(AiParagraphEntity[] datas){
|
||||
try
|
||||
{
|
||||
aiParagraphService.Inserts(datas);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiParagraph", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(AiParagraphEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiParagraphService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiParagraph", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
aiParagraphService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,155 @@
|
||||
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.AI.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using System;
|
||||
using CloudBuilder.AI.Data;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Ai
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class AiSentenceController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly IAiSentenceService aiSentenceService;
|
||||
|
||||
public AiSentenceController(IApplicationService service, IAiSentenceService aiSentenceService)
|
||||
{
|
||||
this.service = service;
|
||||
this.aiSentenceService= aiSentenceService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiSentence", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiSentenceService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiSentence", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(AiSentenceSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiSentenceService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiSentence", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(AiSentenceEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiSentenceService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiParagraph", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Inserts(AiSentenceEntity[] datas){
|
||||
try
|
||||
{
|
||||
aiSentenceService.Inserts(datas);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiSentence", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(AiSentenceEntity data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiSentenceService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiSentence", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
aiSentenceService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user