ow
This commit is contained in:
1 parent
2e990e687f
commit
4ec2502778
53 files changed
+365
-1854
No files matched your search
@@ -13,56 +13,56 @@ namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
}
|
||||
|
||||
[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")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Key]
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("book_id")]
|
||||
public string BookId { 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("created_datetime")]
|
||||
public DateTime CreatedDatetime { get; set; }
|
||||
[Column("created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
[Column("updated_datetime")]
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
|
||||
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 BOOK_ID = "BookId";
|
||||
public const string TITLE = "Title";
|
||||
public const string AUTHOR = "Author";
|
||||
public const string DESCRIPTION = "Description";
|
||||
public const string BOOK_TYPE = "BookType";
|
||||
public const string CREATED_DATETIME = "CreatedDatetime";
|
||||
public const string CREATED_BY = "CreatedBy";
|
||||
public const string UPDATED_DATETIME = "UpdatedDatetime";
|
||||
|
||||
public const string DB_NAME_AI_BOOK = "ai_book";
|
||||
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_NAME_FIELDS="file_id,status,updated_by,book_id,title,author,description,book_type,created_datetime,created_by,updated_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_BOOK_ID = "book_id";
|
||||
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_CREATED_DATETIME = "created_datetime";
|
||||
public const string DB_CREATED_BY = "created_by";
|
||||
public const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
|
||||
|
||||
public static AiBookEntity GetInstance()
|
||||
@@ -82,24 +82,24 @@ namespace CloudBuilder.AI.Entity
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
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.BookId = source.BookId;
|
||||
this.Title = source.Title;
|
||||
this.Author = source.Author;
|
||||
this.Description = source.Description;
|
||||
this.BookType = source.BookType;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace CloudBuilder.AI.Entity
|
||||
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 ;
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_BOOK_ID ;
|
||||
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)}";
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_book_person")]
|
||||
public class AiBookPersonEntity : EntityBase<string>
|
||||
public class AiBookPersonEntity : EntityBase<int>
|
||||
{
|
||||
|
||||
public AiBookPersonEntity()
|
||||
@@ -22,10 +22,11 @@ namespace CloudBuilder.AI.Entity
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Key]
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("book_guid")]
|
||||
public string BookGuid { get; set; }
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("person_id")]
|
||||
public int PersonId { get; set; }
|
||||
[Column("book_id")]
|
||||
public string BookId { get; set; }
|
||||
[Column("person_name")]
|
||||
public string PersonName { get; set; }
|
||||
[Column("actor_name")]
|
||||
@@ -43,8 +44,8 @@ namespace CloudBuilder.AI.Entity
|
||||
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_ID = "PersonId";
|
||||
public const string BOOK_ID = "BookId";
|
||||
public const string PERSON_NAME = "PersonName";
|
||||
public const string ACTOR_NAME = "ActorName";
|
||||
public const string GENDER = "Gender";
|
||||
@@ -53,14 +54,14 @@ namespace CloudBuilder.AI.Entity
|
||||
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_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,person_id,book_id,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_ID = "person_id";
|
||||
public const string DB_BOOK_ID = "book_id";
|
||||
public const string DB_PERSON_NAME = "person_name";
|
||||
public const string DB_ACTOR_NAME = "actor_name";
|
||||
public const string DB_GENDER = "gender";
|
||||
@@ -90,8 +91,8 @@ namespace CloudBuilder.AI.Entity
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.BookGuid = source.BookGuid;
|
||||
this.PersonId = source.PersonId;
|
||||
this.BookId = source.BookId;
|
||||
this.PersonName = source.PersonName;
|
||||
this.ActorName = source.ActorName;
|
||||
this.Gender = source.Gender;
|
||||
@@ -121,7 +122,7 @@ namespace CloudBuilder.AI.Entity
|
||||
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 ;
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_PERSON_ID ;
|
||||
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)}";
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_chapter")]
|
||||
public class AiChapterEntity : EntityBase<string>
|
||||
public class AiChapterEntity : EntityBase<AiChapterEntityKey>
|
||||
{
|
||||
|
||||
public AiChapterEntity()
|
||||
@@ -21,17 +21,14 @@ namespace CloudBuilder.AI.Entity
|
||||
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("book_id")]
|
||||
public string BookId { get; set; }
|
||||
[Column("chapter_id")]
|
||||
public int ChapterId { 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; }
|
||||
|
||||
@@ -39,25 +36,23 @@ namespace CloudBuilder.AI.Entity
|
||||
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 BOOK_ID = "BookId";
|
||||
public const string CHAPTER_ID = "ChapterId";
|
||||
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_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,book_id,chapter_id,chapter_index,title,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_BOOK_ID = "book_id";
|
||||
public const string DB_CHAPTER_ID = "chapter_id";
|
||||
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";
|
||||
|
||||
|
||||
@@ -82,11 +77,10 @@ namespace CloudBuilder.AI.Entity
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.BookGuid = source.BookGuid;
|
||||
this.BookId = source.BookId;
|
||||
this.ChapterId = source.ChapterId;
|
||||
this.ChapterIndex = source.ChapterIndex;
|
||||
this.Title = source.Title;
|
||||
this.Content = source.Content;
|
||||
this.Status = source.Status;
|
||||
|
||||
if (includeSystemFields)
|
||||
@@ -111,7 +105,7 @@ namespace CloudBuilder.AI.Entity
|
||||
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 ;
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_BOOK_ID ;
|
||||
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)}";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using CloudBuilder.Core.Authorization;
|
||||
namespace CloudBuilder.AI
|
||||
{
|
||||
[TypeScript]
|
||||
public class AiChapterEntityKey
|
||||
{
|
||||
public string BookId { get; set; }
|
||||
public int ChapterId { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (this == obj) return true;
|
||||
|
||||
AiChapterEntityKey pkey = obj as AiChapterEntityKey;
|
||||
if (pkey == null) return false;
|
||||
|
||||
if (BookId != pkey.BookId) return false;
|
||||
if (ChapterId != pkey.ChapterId) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string declareSql="";
|
||||
declareSql=declareSql+$"declare @__tkey_BookId_0 varchar(50) select @__tkey_BookId_0 ='{BookId}'; " ; declareSql=declareSql+$"declare @__tkey_ChapterId_1 varchar(50) select @__tkey_ChapterId_1 ='{ChapterId}'; " ;
|
||||
return declareSql;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* builder.Entity<AiChapterEntity>().HasKey(c => new { c.BookId, c.ChapterId}); */
|
||||
@@ -6,7 +6,7 @@ namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_chapter_person")]
|
||||
public class AiChapterPersonEntity : EntityBase<string>
|
||||
public class AiChapterPersonEntity : EntityBase<int>
|
||||
{
|
||||
|
||||
public AiChapterPersonEntity()
|
||||
@@ -22,43 +22,40 @@ namespace CloudBuilder.AI.Entity
|
||||
[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_guid")]
|
||||
public string ParagraphGuid { get; set; }
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("person_id")]
|
||||
public int PersonId { get; set; }
|
||||
[Column("chapter_id")]
|
||||
public int ChapterId { get; set; }
|
||||
[Column("paragraph_index")]
|
||||
public int ParagraphIndex { get; set; }
|
||||
public long ParagraphIndex { get; set; }
|
||||
[Column("order_index")]
|
||||
public int OrderIndex { get; set; }
|
||||
[Column("person_name")]
|
||||
public string PersonName { get; set; }
|
||||
[Column("person_mapping")]
|
||||
public string PersonMapping { get; set; }
|
||||
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 PARAGRAPH_GUID = "ParagraphGuid";
|
||||
public const string PERSON_ID = "PersonId";
|
||||
public const string CHAPTER_ID = "ChapterId";
|
||||
public const string PARAGRAPH_INDEX = "ParagraphIndex";
|
||||
public const string ORDER_INDEX = "OrderIndex";
|
||||
public const string PERSON_NAME = "PersonName";
|
||||
public const string PERSON_MAPPING = "PersonMapping";
|
||||
|
||||
public const string DB_NAME_AI_CHAPTER_PERSON = "ai_chapter_person";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,chapter_guid,paragraph_guid,paragraph_index,order_index,person_name,person_mapping";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,person_id,chapter_id,paragraph_index,order_index,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_PARAGRAPH_GUID = "paragraph_guid";
|
||||
public const string DB_PERSON_ID = "person_id";
|
||||
public const string DB_CHAPTER_ID = "chapter_id";
|
||||
public const string DB_PARAGRAPH_INDEX = "paragraph_index";
|
||||
public const string DB_ORDER_INDEX = "order_index";
|
||||
public const string DB_PERSON_NAME = "person_name";
|
||||
@@ -86,9 +83,8 @@ namespace CloudBuilder.AI.Entity
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.ChapterGuid = source.ChapterGuid;
|
||||
this.ParagraphGuid = source.ParagraphGuid;
|
||||
this.PersonId = source.PersonId;
|
||||
this.ChapterId = source.ChapterId;
|
||||
this.ParagraphIndex = source.ParagraphIndex;
|
||||
this.OrderIndex = source.OrderIndex;
|
||||
this.PersonName = source.PersonName;
|
||||
@@ -116,7 +112,7 @@ namespace CloudBuilder.AI.Entity
|
||||
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 ;
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_PERSON_ID ;
|
||||
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)}";
|
||||
}
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
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_view")]
|
||||
public class AiParagraphViewEntity : ViewEntityBase
|
||||
{
|
||||
|
||||
public AiParagraphViewEntity()
|
||||
{
|
||||
}
|
||||
|
||||
[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("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; }
|
||||
[Column("book_guid")]
|
||||
public string BookGuid { 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 BOOK_GUID = "BookGuid";
|
||||
|
||||
public const string DB_NAME_AI_PARAGRAPH_VIEW = "ai_paragraph_view";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,chapter_guid,paragraph_index,content,dialogue_indc,book_guid";
|
||||
|
||||
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 const string DB_BOOK_GUID = "book_guid";
|
||||
|
||||
|
||||
public static AiParagraphViewEntity GetInstance()
|
||||
{
|
||||
return new AiParagraphViewEntity();
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiParagraphViewEntity source)
|
||||
{
|
||||
CopyFrom(source, true);
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(AiParagraphViewEntity 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;
|
||||
this.BookGuid = source.BookGuid;
|
||||
|
||||
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_VIEW} with(nolock) ";
|
||||
}
|
||||
|
||||
public override string GetSelectCountFrom(string sqlWhere)
|
||||
{
|
||||
return $" select count(*) from { DB_NAME_AI_PARAGRAPH_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_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_PARAGRAPH_VIEW} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
|
||||
}
|
||||
|
||||
public AiParagraphViewEntity Clone()
|
||||
{
|
||||
AiParagraphViewEntity result = new AiParagraphViewEntity();
|
||||
result.CopyFrom(this);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -21,20 +21,18 @@ namespace CloudBuilder.AI.Entity
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("paragraph_guid")]
|
||||
public string ParagraphGuid { get; set; }
|
||||
[Column("sentence_id")]
|
||||
public long SentenceId { get; set; }
|
||||
[Column("chapter_id")]
|
||||
public int ChapterId { get; set; }
|
||||
[Column("content")]
|
||||
public string Content { get; set; }
|
||||
[Column("status")]
|
||||
public string? Status { get; set; }
|
||||
[Column("book_guid")]
|
||||
public string BookGuid { get; set; }
|
||||
[Column("chapter_guid")]
|
||||
public string ChapterGuid { get; set; }
|
||||
[Column("chapter_index")]
|
||||
public int ChapterIndex { get; set; }
|
||||
[Column("paragraph_index")]
|
||||
public int ParagraphIndex { get; set; }
|
||||
[Column("book_id")]
|
||||
public string BookId { get; set; }
|
||||
[Column("paragraph_id")]
|
||||
public long ParagraphId { get; set; }
|
||||
[Column("sentence_index")]
|
||||
public int SentenceIndex { get; set; }
|
||||
[Column("dialogue_indc")]
|
||||
@@ -45,47 +43,41 @@ namespace CloudBuilder.AI.Entity
|
||||
public string? Gender { get; set; }
|
||||
[Column("sentiment")]
|
||||
public string? Sentiment { get; set; }
|
||||
[Column("content")]
|
||||
public string Content { 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 PARAGRAPH_GUID = "ParagraphGuid";
|
||||
public const string SENTENCE_ID = "SentenceId";
|
||||
public const string CHAPTER_ID = "ChapterId";
|
||||
public const string CONTENT = "Content";
|
||||
public const string STATUS = "Status";
|
||||
public const string BOOK_GUID = "BookGuid";
|
||||
public const string CHAPTER_GUID = "ChapterGuid";
|
||||
public const string CHAPTER_INDEX = "ChapterIndex";
|
||||
public const string PARAGRAPH_INDEX = "ParagraphIndex";
|
||||
public const string BOOK_ID = "BookId";
|
||||
public const string PARAGRAPH_ID = "ParagraphId";
|
||||
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_DIALOGUE_VIEW = "ai_sentence_dialogue_view";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,guid,paragraph_guid,status,book_guid,chapter_guid,chapter_index,paragraph_index,sentence_index,dialogue_indc,person_name,gender,sentiment,content";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,sentence_id,chapter_id,content,status,book_id,paragraph_id,sentence_index,dialogue_indc,person_name,gender,sentiment";
|
||||
|
||||
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_PARAGRAPH_GUID = "paragraph_guid";
|
||||
public const string DB_SENTENCE_ID = "sentence_id";
|
||||
public const string DB_CHAPTER_ID = "chapter_id";
|
||||
public const string DB_CONTENT = "content";
|
||||
public const string DB_STATUS = "status";
|
||||
public const string DB_BOOK_GUID = "book_guid";
|
||||
public const string DB_CHAPTER_GUID = "chapter_guid";
|
||||
public const string DB_CHAPTER_INDEX = "chapter_index";
|
||||
public const string DB_PARAGRAPH_INDEX = "paragraph_index";
|
||||
public const string DB_BOOK_ID = "book_id";
|
||||
public const string DB_PARAGRAPH_ID = "paragraph_id";
|
||||
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 AiSentenceDialogueViewEntity GetInstance()
|
||||
@@ -109,19 +101,17 @@ namespace CloudBuilder.AI.Entity
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.ParagraphGuid = source.ParagraphGuid;
|
||||
this.SentenceId = source.SentenceId;
|
||||
this.ChapterId = source.ChapterId;
|
||||
this.Content = source.Content;
|
||||
this.Status = source.Status;
|
||||
this.BookGuid = source.BookGuid;
|
||||
this.ChapterGuid = source.ChapterGuid;
|
||||
this.ChapterIndex = source.ChapterIndex;
|
||||
this.ParagraphIndex = source.ParagraphIndex;
|
||||
this.BookId = source.BookId;
|
||||
this.ParagraphId = source.ParagraphId;
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -6,71 +6,76 @@ namespace CloudBuilder.AI.Entity
|
||||
{
|
||||
[TypeScript]
|
||||
[Table("ai_sentence")]
|
||||
public class AiSentenceEntity : EntityBase<string>
|
||||
public class AiSentenceEntity : EntityBase<long>
|
||||
{
|
||||
|
||||
public AiSentenceEntity()
|
||||
{
|
||||
}
|
||||
|
||||
[Column("content")]
|
||||
public string Content { get; set; }
|
||||
[Column("status")]
|
||||
public string? Status { get; set; }
|
||||
[Column("paragraph_id")]
|
||||
public long ParagraphId { 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; }
|
||||
[Column("sentiment")]
|
||||
public string? Sentiment { get; set; }
|
||||
[Column("content")]
|
||||
public string Content { get; set; }
|
||||
[Column("status")]
|
||||
public string? Status { 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; }
|
||||
[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; }
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column("sentence_id")]
|
||||
public long SentenceId { get; set; }
|
||||
[Column("chapter_id")]
|
||||
public int ChapterId { get; set; }
|
||||
|
||||
public const string CONTENT = "Content";
|
||||
public const string STATUS = "Status";
|
||||
public const string PARAGRAPH_ID = "ParagraphId";
|
||||
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 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 UPDATED_DATETIME = "UpdatedDatetime";
|
||||
public const string UPDATED_BY = "UpdatedBy";
|
||||
public const string SENTENCE_ID = "SentenceId";
|
||||
public const string CHAPTER_ID = "ChapterId";
|
||||
|
||||
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_NAME_FIELDS="content,status,paragraph_id,sentence_index,dialogue_indc,person_name,gender,sentiment,created_datetime,created_by,updated_datetime,updated_by,sentence_id,chapter_id";
|
||||
|
||||
public const string DB_CONTENT = "content";
|
||||
public const string DB_STATUS = "status";
|
||||
public const string DB_PARAGRAPH_ID = "paragraph_id";
|
||||
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 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 const string DB_UPDATED_DATETIME = "updated_datetime";
|
||||
public const string DB_UPDATED_BY = "updated_by";
|
||||
public const string DB_SENTENCE_ID = "sentence_id";
|
||||
public const string DB_CHAPTER_ID = "chapter_id";
|
||||
|
||||
|
||||
public static AiSentenceEntity GetInstance()
|
||||
@@ -90,26 +95,27 @@ namespace CloudBuilder.AI.Entity
|
||||
throw new NullReferenceException("Source entity is null.");
|
||||
}
|
||||
|
||||
this.Content = source.Content;
|
||||
this.Status = source.Status;
|
||||
this.ParagraphId = source.ParagraphId;
|
||||
this.SentenceIndex = source.SentenceIndex;
|
||||
this.DialogueIndc = source.DialogueIndc;
|
||||
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;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.SentenceId = source.SentenceId;
|
||||
this.ChapterId = source.ChapterId;
|
||||
|
||||
if (includeSystemFields)
|
||||
{
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.CreatedDatetime = source.CreatedDatetime;
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +132,7 @@ namespace CloudBuilder.AI.Entity
|
||||
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 ;
|
||||
if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_SENTENCE_ID ;
|
||||
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)}";
|
||||
}
|
||||
|
||||
@@ -21,20 +21,18 @@ namespace CloudBuilder.AI.Entity
|
||||
public DateTime UpdatedDatetime { get; set; }
|
||||
[Column("updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
[Column("guid")]
|
||||
public string Guid { get; set; }
|
||||
[Column("paragraph_guid")]
|
||||
public string ParagraphGuid { get; set; }
|
||||
[Column("sentence_id")]
|
||||
public long SentenceId { get; set; }
|
||||
[Column("chapter_id")]
|
||||
public int ChapterId { get; set; }
|
||||
[Column("content")]
|
||||
public string Content { get; set; }
|
||||
[Column("status")]
|
||||
public string? Status { get; set; }
|
||||
[Column("book_guid")]
|
||||
public string BookGuid { get; set; }
|
||||
[Column("chapter_guid")]
|
||||
public string ChapterGuid { get; set; }
|
||||
[Column("chapter_index")]
|
||||
public int ChapterIndex { get; set; }
|
||||
[Column("paragraph_index")]
|
||||
public int ParagraphIndex { get; set; }
|
||||
[Column("book_id")]
|
||||
public string BookId { get; set; }
|
||||
[Column("paragraph_id")]
|
||||
public long ParagraphId { get; set; }
|
||||
[Column("sentence_index")]
|
||||
public int SentenceIndex { get; set; }
|
||||
[Column("dialogue_indc")]
|
||||
@@ -45,47 +43,41 @@ namespace CloudBuilder.AI.Entity
|
||||
public string? Gender { get; set; }
|
||||
[Column("sentiment")]
|
||||
public string? Sentiment { get; set; }
|
||||
[Column("content")]
|
||||
public string Content { 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 PARAGRAPH_GUID = "ParagraphGuid";
|
||||
public const string SENTENCE_ID = "SentenceId";
|
||||
public const string CHAPTER_ID = "ChapterId";
|
||||
public const string CONTENT = "Content";
|
||||
public const string STATUS = "Status";
|
||||
public const string BOOK_GUID = "BookGuid";
|
||||
public const string CHAPTER_GUID = "ChapterGuid";
|
||||
public const string CHAPTER_INDEX = "ChapterIndex";
|
||||
public const string PARAGRAPH_INDEX = "ParagraphIndex";
|
||||
public const string BOOK_ID = "BookId";
|
||||
public const string PARAGRAPH_ID = "ParagraphId";
|
||||
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="created_datetime,created_by,updated_datetime,updated_by,guid,paragraph_guid,status,book_guid,chapter_guid,chapter_index,paragraph_index,sentence_index,dialogue_indc,person_name,gender,sentiment,content";
|
||||
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,sentence_id,chapter_id,content,status,book_id,paragraph_id,sentence_index,dialogue_indc,person_name,gender,sentiment";
|
||||
|
||||
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_PARAGRAPH_GUID = "paragraph_guid";
|
||||
public const string DB_SENTENCE_ID = "sentence_id";
|
||||
public const string DB_CHAPTER_ID = "chapter_id";
|
||||
public const string DB_CONTENT = "content";
|
||||
public const string DB_STATUS = "status";
|
||||
public const string DB_BOOK_GUID = "book_guid";
|
||||
public const string DB_CHAPTER_GUID = "chapter_guid";
|
||||
public const string DB_CHAPTER_INDEX = "chapter_index";
|
||||
public const string DB_PARAGRAPH_INDEX = "paragraph_index";
|
||||
public const string DB_BOOK_ID = "book_id";
|
||||
public const string DB_PARAGRAPH_ID = "paragraph_id";
|
||||
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()
|
||||
@@ -109,19 +101,17 @@ namespace CloudBuilder.AI.Entity
|
||||
this.CreatedBy = source.CreatedBy;
|
||||
this.UpdatedDatetime = source.UpdatedDatetime;
|
||||
this.UpdatedBy = source.UpdatedBy;
|
||||
this.Guid = source.Guid;
|
||||
this.ParagraphGuid = source.ParagraphGuid;
|
||||
this.SentenceId = source.SentenceId;
|
||||
this.ChapterId = source.ChapterId;
|
||||
this.Content = source.Content;
|
||||
this.Status = source.Status;
|
||||
this.BookGuid = source.BookGuid;
|
||||
this.ChapterGuid = source.ChapterGuid;
|
||||
this.ChapterIndex = source.ChapterIndex;
|
||||
this.ParagraphIndex = source.ParagraphIndex;
|
||||
this.BookId = source.BookId;
|
||||
this.ParagraphId = source.ParagraphId;
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,9 @@ namespace CloudBuilder.AI.Entity
|
||||
builder.Entity<BookDmsFileViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<AiParagraphViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<AiSentenceDialogueViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<AiChapterEntity>().HasKey(c => new {c.BookId,c.ChapterId});
|
||||
builder.Entity<AiSentenceDialogueViewEntity>(eb => { eb.HasNoKey(); });
|
||||
builder.Entity<AiSentenceViewEntity>(eb => { eb.HasNoKey(); });
|
||||
//***END***
|
||||
|
||||
Reference in new issue
Block a user