ow
This commit is contained in:
1 parent
2e990e687f
commit
4ec2502778
53 files changed
+365
-1854
No files matched your search
@@ -7,9 +7,9 @@ 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 System;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
@@ -198,53 +198,6 @@ this.aiBookService= aiBookService;
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic ExtractNames(string bookGuid){
|
||||
try
|
||||
{
|
||||
aiBookService.ExtractNames(bookGuid);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ExtractNamesByChapterGuidCompositionData
|
||||
{
|
||||
public string bookGuid { get; set; }
|
||||
public string chapterGuid { get; set; }
|
||||
|
||||
}
|
||||
[PermissionOperate(name: "AiBook", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic ExtractNamesByChapterGuid(ExtractNamesByChapterGuidCompositionData compositionData){
|
||||
try
|
||||
{
|
||||
aiBookService.ExtractNamesByChapterGuid(compositionData.bookGuid,compositionData.chapterGuid);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Find")]
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,12 @@ 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 System;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using CloudBuilder.AI;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Ai
|
||||
{
|
||||
@@ -31,7 +32,7 @@ this.aiChapterService= aiChapterService;
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
public dynamic FindByKey(AiChapterEntityKey key)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -47,26 +48,6 @@ this.aiChapterService= aiChapterService;
|
||||
{
|
||||
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: "AiBook", operate: "Find")]
|
||||
@@ -134,7 +115,7 @@ this.aiChapterService= aiChapterService;
|
||||
[PermissionOperate(name: "AiBook", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
public dynamic Delete(AiChapterEntityKey key){
|
||||
try
|
||||
{
|
||||
aiChapterService.Delete(key);
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
|
||||
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;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
|
||||
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;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,12 @@ 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 System;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using CloudBuilder.AI;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Ai
|
||||
{
|
||||
@@ -31,7 +32,7 @@ this.aiSentenceService= aiSentenceService;
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
public dynamic FindByKey(Int64 key)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -51,12 +52,12 @@ this.aiSentenceService= aiSentenceService;
|
||||
|
||||
[PermissionOperate(name: "AiBook", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByChapterGuid(string chapterGuid)
|
||||
public dynamic FindByChapterId(Int64 chapterId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = aiSentenceService.FindByChapterGuid(chapterGuid);
|
||||
var result = aiSentenceService.FindByChapterId(chapterId);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
@@ -154,7 +155,7 @@ this.aiSentenceService= aiSentenceService;
|
||||
[PermissionOperate(name: "AiBook", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
public dynamic Delete(Int64 key){
|
||||
try
|
||||
{
|
||||
aiSentenceService.Delete(key);
|
||||
|
||||
@@ -7,11 +7,12 @@ 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 System;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using CloudBuilder.AI;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Ai
|
||||
|
||||
Reference in new issue
Block a user