ow
This commit is contained in:
1 parent
d795476b1f
commit
0ba1352862
29 files changed
+526
-157
No files matched your search
@@ -25,7 +25,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Linkup\" />
|
||||
<Folder Include="Publisher\" />
|
||||
<Folder Include="SearchCriteria\" />
|
||||
<Folder Include="Service\" />
|
||||
|
||||
@@ -15,5 +15,10 @@ namespace CloudBuilder.AI.Data
|
||||
public AiBookPersonEntity[]? AiBookPersons { get; set; }
|
||||
public AiParagraphEntity[]? AiParagraphs { get; set; }
|
||||
public AiSentenceEntity[]? AiSentences { get; set; }
|
||||
|
||||
public const string FILE_NAME = "FileName";
|
||||
|
||||
//如果没有加string.Empty;那么前端会要求必须有值
|
||||
public string? FileName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,14 @@ namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
}
|
||||
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("description")]
|
||||
public string? Description { get; set; }
|
||||
[Column("book_type")]
|
||||
public string? BookType { get; set; }
|
||||
[Column("file_id")]
|
||||
public int FileId { get; set; }
|
||||
[Column("status")]
|
||||
public string Status { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
@@ -28,41 +34,35 @@ namespace CloudBuilder.AI.Entity
|
||||
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; }
|
||||
[Column("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string DESCRIPTION = "Description";
|
||||
public const string BOOK_TYPE = "BookType";
|
||||
public const string FILE_ID = "FileId";
|
||||
public const string STATUS = "Status";
|
||||
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 CREATED_DATETIME = "CreatedDatetime";
|
||||
|
||||
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_NAME_FIELDS="description,book_type,file_id,status,created_by,updated_datetime,updated_by,guid,title,author,created_datetime";
|
||||
|
||||
public const string DB_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_DESCRIPTION = "description";
|
||||
public const string DB_BOOK_TYPE = "book_type";
|
||||
public const string DB_FILE_ID = "file_id";
|
||||
public const string DB_STATUS = "status";
|
||||
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 const string DB_CREATED_DATETIME = "created_datetime";
|
||||
|
||||
|
||||
public static AiBookEntity GetInstance()
|
||||
@@ -82,24 +82,24 @@ namespace CloudBuilder.AI.Entity
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.Description = source.Description;
|
||||
this.BookType = source.BookType;
|
||||
this.FileId = source.FileId;
|
||||
this.Status = source.Status;
|
||||
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;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,6 @@ namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
}
|
||||
|
||||
[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")]
|
||||
@@ -25,16 +21,16 @@ namespace CloudBuilder.AI.Entity
|
||||
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("status")]
|
||||
public string? Status { get; set; }
|
||||
[Column("chapter_guid")]
|
||||
public string ChapterGuid { get; set; }
|
||||
[Column("paragraph_index")]
|
||||
public int ParagraphIndex { get; set; }
|
||||
[Column("sentence_index")]
|
||||
public int SentenceIndex { get; set; }
|
||||
[Column("dialogue_indc")]
|
||||
@@ -43,41 +39,45 @@ namespace CloudBuilder.AI.Entity
|
||||
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; }
|
||||
|
||||
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 STATUS = "Status";
|
||||
public const string CHAPTER_GUID = "ChapterGuid";
|
||||
public const string PARAGRAPH_INDEX = "ParagraphIndex";
|
||||
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 SENTIMENT = "Sentiment";
|
||||
public const string CONTENT = "Content";
|
||||
|
||||
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_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,paragraph_guid,status,chapter_guid,paragraph_index,sentence_index,dialogue_indc,person_name,gender,sentiment,content";
|
||||
|
||||
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_STATUS = "status";
|
||||
public const string DB_CHAPTER_GUID = "chapter_guid";
|
||||
public const string DB_PARAGRAPH_INDEX = "paragraph_index";
|
||||
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 const string DB_SENTIMENT = "sentiment";
|
||||
public const string DB_CONTENT = "content";
|
||||
|
||||
|
||||
public static AiSentenceViewEntity GetInstance()
|
||||
@@ -97,21 +97,21 @@ namespace CloudBuilder.AI.Entity
|
||||
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.Status = source.Status;
|
||||
this.ChapterGuid = source.ChapterGuid;
|
||||
this.ParagraphIndex = source.ParagraphIndex;
|
||||
this.SentenceIndex = source.SentenceIndex;
|
||||
this.DialogueIndc = source.DialogueIndc;
|
||||
this.PersonName = source.PersonName;
|
||||
this.Gender = source.Gender;
|
||||
this.Sentiment = source.Sentiment;
|
||||
this.Content = source.Content;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
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}" : "";
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_CREATED_DATETIME ; 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)}";
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,10 @@ namespace CloudBuilder.AI.Entity
|
||||
//***BEGIN***
|
||||
|
||||
|
||||
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<DmsFolderMapEntity>().HasKey(c => new {c.FolderNameParent,c.FolderNameSon});
|
||||
builder.Entity<BookDmsFileViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
|
||||
//***END***
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@ namespace CloudBuilder.AI.Policy
|
||||
{
|
||||
public partial class AIPermissionPolicy
|
||||
{
|
||||
//***BEGIN***
|
||||
public const string AiCharacter = "AiCharacter";
|
||||
public const string AiSentence = "AiSentence";
|
||||
public const string AiWord = "AiWord";
|
||||
//***BEGIN***
|
||||
public const string AiSentence = "AiSentence";
|
||||
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";
|
||||
public const string DmsFile = "DmsFile";
|
||||
public const string DmsFolder = "DmsFolder";
|
||||
//***END***
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,9 @@ namespace CloudBuilder.AI.Policy
|
||||
{
|
||||
public class BookStatusPolicy : LocalePolicy, IPolicy
|
||||
{
|
||||
public const string SUBMIT = "S";//待提交
|
||||
|
||||
public const string DRAFT = "D";
|
||||
public const string SUBMIT = "S";
|
||||
public const string COMPLETED = "C";
|
||||
|
||||
private readonly IContext context;
|
||||
private readonly ILocaleMessageManager localeMessageManager;
|
||||
|
||||
@@ -3,12 +3,21 @@ using CloudBuilder.AI.Data;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Security.Data;
|
||||
using CloudBuilder.Security.SearchCriteria;
|
||||
|
||||
namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiBookService : IServiceBase<AiBookEntity, string, AiBookSearchCriteria>
|
||||
public interface IAiBookService : IServiceBase<AiBookData, string, AiBookSearchCriteria>
|
||||
{
|
||||
AiBookResultData FindBySearchCriteria(AiBookSearchCriteria tc);
|
||||
|
||||
void Deletes(string[] keys);
|
||||
AiBookEntity FindByTitle(string title);
|
||||
void Insert(AiBookData data);
|
||||
AiBookData Insert(AiBookData data);
|
||||
|
||||
AiBookData Update(AiBookData data);
|
||||
|
||||
AiBookData ProcessBook(string key, string encoding, string pattern);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
using CloudBuilder.AI.Data;
|
||||
using CloudBuilder.AI.Entity;
|
||||
using CloudBuilder.AI.SearchCriteria;
|
||||
using CloudBuilder.Core.Service;
|
||||
@@ -7,6 +8,8 @@ namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiChapterService :IServiceBase<AiChapterEntity, string ,AiChapterSearchCriteria>
|
||||
{
|
||||
AiChapterResultData FindBySearchCriteria(AiChapterSearchCriteria criteria);
|
||||
|
||||
AiChapterEntity[] FindByTitle(string title);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiParagraphService :IServiceBase<AiParagraphEntity, string ,AiParagraphSearchCriteria>
|
||||
{
|
||||
|
||||
|
||||
void Inserts(AiParagraphEntity[] datas);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,8 @@ namespace CloudBuilder.AI.Service
|
||||
{
|
||||
public interface IAiSentenceService :IServiceBase<AiSentenceEntity, string ,AiSentenceSearchCriteria>
|
||||
{
|
||||
AiSentenceViewEntityResultData FindBySearchCriteria(AiSentenceSearchCriteria criteria);
|
||||
AiSentenceViewEntity[] FindByChapterGuid(string chapterGuid);
|
||||
AiSentenceViewResultData FindBySearchCriteria(AiSentenceSearchCriteria criteria);
|
||||
void Inserts(AiSentenceEntity[] datas);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user