This commit is contained in:
owenchen committed 2026-05-21 14:52:36 +08:00
1 parent 2697285ce7
commit 30c22a3d0c
73 files changed
+7117

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.AI.Data
{
public class AiBookProcessData
{
public string? Encoding { get; set; } = string.Empty;
public string? Pattern { get; set; } = string.Empty;
}
}
+20
View File
@@ -0,0 +1,20 @@
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 AiBookResultData : SearchCriteriaResultData
{
public AiBookEntity[]? Datas { get; set; }
}
}
@@ -0,0 +1,17 @@
using CloudBuilder.AI.Entity;
using CloudBuilder.Core.Authorization;
using CloudBuilder.Core.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.AI.Data
{
[TypeScript]
public class AiChapterResultData : SearchCriteriaResultData
{
public AiChapterEntity[]? Datas { get; set; }
}
}
@@ -0,0 +1,18 @@
using CloudBuilder.AI.Entity;
using CloudBuilder.Core.Authorization;
using CloudBuilder.Core.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.AI.Data
{
[TypeScript]
public class AiParagraphResultData : SearchCriteriaResultData
{
public AiParagraphEntity[]? Datas { get; set; }
}
}
@@ -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 AiSentenceViewResultData : SearchCriteriaResultData
{
public AiSentenceViewEntity[]? Datas { get; set; }
}
}
@@ -0,0 +1,36 @@
using CloudBuilder.AI.Entity;
using CloudBuilder.Core.Authorization;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.AI.Data
{
[NotMapped]
[TypeScript]
public class BookDmsFileViewDisplayData : BookDmsFileViewEntity
{
public BookDmsFileViewDisplayData()
{
}
public BookDmsFileViewDisplayData(BookDmsFileViewEntity entity)
{
CopyFrom(entity);
}
public const string IS_SELECTED = "IsSelected";
public const string IS_PLAY = "IsPlay";
public const string IS_PAUSE = "IsPause";
public bool? IsSelected { get; set; }
public string? IsPlay { get; set; }
public string? IsPause { get; set; }
public string? FormattedPic { get; set; }
}
}
+18
View File
@@ -0,0 +1,18 @@
using CloudBuilder.Core.Authorization;
using CloudBuilder.Core.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.AI.Data
{
[TypeScript]
public class DmsFileResultData : SearchCriteriaResultData
{
public BookDmsFileViewDisplayData[]? Datas { get; set; }
public string[]? Previews { get; set; }
}
}
+17
View File
@@ -0,0 +1,17 @@
using CloudBuilder.AI.Entity;
using CloudBuilder.Core.Authorization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.AI.Data
{
[TypeScript]
public class DmsFolderTreeData
{
public DmsFolderEntity[]? DmsFolders { get; set; }
public DmsFolderMapEntity[]? DmsFoldersMaps { get; set; }
}
}
@@ -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("book_dms_file")]
public class BookDmsFileEntity : EntityBase<int>
{
public BookDmsFileEntity()
{
}
[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("file_id")]
public int FileId { get; set; }
[Column("upload_name")]
public string UploadName { get; set; }
[Column("file_category")]
public string FileCategory { get; set; }
[Column("org_file_name")]
public string OrgFileName { 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 FILE_ID = "FileId";
public const string UPLOAD_NAME = "UploadName";
public const string FILE_CATEGORY = "FileCategory";
public const string ORG_FILE_NAME = "OrgFileName";
public const string DB_NAME_BOOK_DMS_FILE = "book_dms_file";
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,file_id,upload_name,file_category,org_file_name";
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_FILE_ID = "file_id";
public const string DB_UPLOAD_NAME = "upload_name";
public const string DB_FILE_CATEGORY = "file_category";
public const string DB_ORG_FILE_NAME = "org_file_name";
public static BookDmsFileEntity GetInstance()
{
return new BookDmsFileEntity();
}
public virtual void CopyFrom(BookDmsFileEntity source)
{
CopyFrom(source, true);
}
public virtual void CopyFrom(BookDmsFileEntity 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.FileId = source.FileId;
this.UploadName = source.UploadName;
this.FileCategory = source.FileCategory;
this.OrgFileName = source.OrgFileName;
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_BOOK_DMS_FILE} with(nolock) ";
}
public override string GetSelectCountFrom(string sqlWhere)
{
return $" select count(*) from { DB_NAME_BOOK_DMS_FILE} 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_FILE_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_BOOK_DMS_FILE} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
}
public BookDmsFileEntity Clone()
{
BookDmsFileEntity result = new BookDmsFileEntity();
result.CopyFrom(this);
return result;
}
}
}
@@ -0,0 +1,190 @@
using CloudBuilder.Core.Authorization;
using CloudBuilder.Core.DatabaseAccessor.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CloudBuilder.AI.Entity
{
[TypeScript]
[Table("book_dms_file_view")]
public class BookDmsFileViewEntity : ViewEntityBase
{
public BookDmsFileViewEntity()
{
}
[Column("created_datetime")]
public DateTime CreatedDatetime { get; set; }
[Column("created_by")]
public string CreatedBy { get; set; }
[Column("file_id")]
public int FileId { get; set; }
[Column("upload_name")]
public string UploadName { get; set; }
[Column("file_category")]
public string FileCategory { get; set; }
[Column("org_file_name")]
public string OrgFileName { get; set; }
[Column("allow_delete_indc")]
public string AllowDeleteIndc { get; set; }
[Column("file_type")]
public string? FileType { get; set; }
[Column("landscape_indc")]
public string? LandscapeIndc { get; set; }
[Column("transcode_indc")]
public string? TranscodeIndc { get; set; }
[Column("url")]
public string Url { get; set; }
[Column("is_directory_indc")]
public string IsDirectoryIndc { get; set; }
[Column("is_link_indc")]
public string IsLinkIndc { get; set; }
[Column("linked_file_id")]
public int LinkedFileId { get; set; }
[Column("order_key")]
public string? OrderKey { get; set; }
[Column("file_tag")]
public string? FileTag { get; set; }
[Column("allow_rename_indc")]
public string AllowRenameIndc { get; set; }
[Column("file_name")]
public string FileName { get; set; }
[Column("file_path")]
public string FilePath { get; set; }
[Column("folder_local_name")]
public string? FolderLocalName { get; set; }
[Column("file_size")]
public int FileSize { get; set; }
[Column("ower_id")]
public string OwerId { get; set; }
[Column("revision_no")]
public int RevisionNo { get; set; }
public const string CREATED_DATETIME = "CreatedDatetime";
public const string CREATED_BY = "CreatedBy";
public const string FILE_ID = "FileId";
public const string UPLOAD_NAME = "UploadName";
public const string FILE_CATEGORY = "FileCategory";
public const string ORG_FILE_NAME = "OrgFileName";
public const string ALLOW_DELETE_INDC = "AllowDeleteIndc";
public const string FILE_TYPE = "FileType";
public const string LANDSCAPE_INDC = "LandscapeIndc";
public const string TRANSCODE_INDC = "TranscodeIndc";
public const string URL = "Url";
public const string IS_DIRECTORY_INDC = "IsDirectoryIndc";
public const string IS_LINK_INDC = "IsLinkIndc";
public const string LINKED_FILE_ID = "LinkedFileId";
public const string ORDER_KEY = "OrderKey";
public const string FILE_TAG = "FileTag";
public const string ALLOW_RENAME_INDC = "AllowRenameIndc";
public const string FILE_NAME = "FileName";
public const string FILE_PATH = "FilePath";
public const string FOLDER_LOCAL_NAME = "FolderLocalName";
public const string FILE_SIZE = "FileSize";
public const string OWER_ID = "OwerId";
public const string REVISION_NO = "RevisionNo";
public const string DB_NAME_BOOK_DMS_FILE_VIEW = "book_dms_file_view";
public const string DB_NAME_FIELDS="created_datetime,created_by,file_id,upload_name,file_category,org_file_name,allow_delete_indc,file_type,landscape_indc,transcode_indc,url,is_directory_indc,is_link_indc,linked_file_id,order_key,file_tag,allow_rename_indc,file_name,file_path,folder_local_name,file_size,ower_id,revision_no";
public const string DB_CREATED_DATETIME = "created_datetime";
public const string DB_CREATED_BY = "created_by";
public const string DB_FILE_ID = "file_id";
public const string DB_UPLOAD_NAME = "upload_name";
public const string DB_FILE_CATEGORY = "file_category";
public const string DB_ORG_FILE_NAME = "org_file_name";
public const string DB_ALLOW_DELETE_INDC = "allow_delete_indc";
public const string DB_FILE_TYPE = "file_type";
public const string DB_LANDSCAPE_INDC = "landscape_indc";
public const string DB_TRANSCODE_INDC = "transcode_indc";
public const string DB_URL = "url";
public const string DB_IS_DIRECTORY_INDC = "is_directory_indc";
public const string DB_IS_LINK_INDC = "is_link_indc";
public const string DB_LINKED_FILE_ID = "linked_file_id";
public const string DB_ORDER_KEY = "order_key";
public const string DB_FILE_TAG = "file_tag";
public const string DB_ALLOW_RENAME_INDC = "allow_rename_indc";
public const string DB_FILE_NAME = "file_name";
public const string DB_FILE_PATH = "file_path";
public const string DB_FOLDER_LOCAL_NAME = "folder_local_name";
public const string DB_FILE_SIZE = "file_size";
public const string DB_OWER_ID = "ower_id";
public const string DB_REVISION_NO = "revision_no";
public static BookDmsFileViewEntity GetInstance()
{
return new BookDmsFileViewEntity();
}
public virtual void CopyFrom(BookDmsFileViewEntity source)
{
CopyFrom(source, true);
}
public virtual void CopyFrom(BookDmsFileViewEntity source, bool includeSystemFields)
{
if (source == null)
{
throw new NullReferenceException("Source entity is null.");
}
this.CreatedDatetime = source.CreatedDatetime;
this.CreatedBy = source.CreatedBy;
this.FileId = source.FileId;
this.UploadName = source.UploadName;
this.FileCategory = source.FileCategory;
this.OrgFileName = source.OrgFileName;
this.AllowDeleteIndc = source.AllowDeleteIndc;
this.FileType = source.FileType;
this.LandscapeIndc = source.LandscapeIndc;
this.TranscodeIndc = source.TranscodeIndc;
this.Url = source.Url;
this.IsDirectoryIndc = source.IsDirectoryIndc;
this.IsLinkIndc = source.IsLinkIndc;
this.LinkedFileId = source.LinkedFileId;
this.OrderKey = source.OrderKey;
this.FileTag = source.FileTag;
this.AllowRenameIndc = source.AllowRenameIndc;
this.FileName = source.FileName;
this.FilePath = source.FilePath;
this.FolderLocalName = source.FolderLocalName;
this.FileSize = source.FileSize;
this.OwerId = source.OwerId;
this.RevisionNo = source.RevisionNo;
if (includeSystemFields)
{
this.CreatedDatetime = source.CreatedDatetime;
this.CreatedBy = source.CreatedBy;
}
}
public override string GetSelectFrom()
{
return $" select {DB_NAME_FIELDS} from { DB_NAME_BOOK_DMS_FILE_VIEW} with(nolock) ";
}
public override string GetSelectCountFrom(string sqlWhere)
{
return $" select count(*) from { DB_NAME_BOOK_DMS_FILE_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_BOOK_DMS_FILE_VIEW} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
}
public BookDmsFileViewEntity Clone()
{
BookDmsFileViewEntity result = new BookDmsFileViewEntity();
result.CopyFrom(this);
return result;
}
}
}
@@ -0,0 +1,184 @@
using CloudBuilder.Core.Authorization;
using CloudBuilder.Core.DatabaseAccessor.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CloudBuilder.AI.Entity
{
[TypeScript]
[Table("dms_file")]
public class DmsFileEntity : EntityBase<int>
{
public DmsFileEntity()
{
}
[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]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("file_id")]
public int FileId { get; set; }
[Column("file_name")]
public string FileName { get; set; }
[Column("file_type")]
public string? FileType { get; set; }
[Column("landscape_indc")]
public string? LandscapeIndc { get; set; }
[Column("transcode_indc")]
public string? TranscodeIndc { get; set; }
[Column("linked_file_id")]
public int LinkedFileId { get; set; }
[Column("org_file_name")]
public string OrgFileName { get; set; }
[Column("order_key")]
public string? OrderKey { get; set; }
[Column("file_tag")]
public string? FileTag { get; set; }
[Column("allow_rename_indc")]
public string AllowRenameIndc { get; set; }
[Column("allow_delete_indc")]
public string AllowDeleteIndc { get; set; }
[Column("file_path")]
public string FilePath { get; set; }
[Column("file_size")]
public int FileSize { get; set; }
[Column("ower_id")]
public string OwerId { get; set; }
[Column("revision_no")]
public int RevisionNo { get; set; }
[Column("is_directory_indc")]
public string IsDirectoryIndc { get; set; }
[Column("is_link_indc")]
public string IsLinkIndc { 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 FILE_ID = "FileId";
public const string FILE_NAME = "FileName";
public const string FILE_TYPE = "FileType";
public const string LANDSCAPE_INDC = "LandscapeIndc";
public const string TRANSCODE_INDC = "TranscodeIndc";
public const string LINKED_FILE_ID = "LinkedFileId";
public const string ORG_FILE_NAME = "OrgFileName";
public const string ORDER_KEY = "OrderKey";
public const string FILE_TAG = "FileTag";
public const string ALLOW_RENAME_INDC = "AllowRenameIndc";
public const string ALLOW_DELETE_INDC = "AllowDeleteIndc";
public const string FILE_PATH = "FilePath";
public const string FILE_SIZE = "FileSize";
public const string OWER_ID = "OwerId";
public const string REVISION_NO = "RevisionNo";
public const string IS_DIRECTORY_INDC = "IsDirectoryIndc";
public const string IS_LINK_INDC = "IsLinkIndc";
public const string DB_NAME_DMS_FILE = "dms_file";
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,file_id,file_name,file_type,landscape_indc,transcode_indc,linked_file_id,org_file_name,order_key,file_tag,allow_rename_indc,allow_delete_indc,file_path,file_size,ower_id,revision_no,is_directory_indc,is_link_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_FILE_ID = "file_id";
public const string DB_FILE_NAME = "file_name";
public const string DB_FILE_TYPE = "file_type";
public const string DB_LANDSCAPE_INDC = "landscape_indc";
public const string DB_TRANSCODE_INDC = "transcode_indc";
public const string DB_LINKED_FILE_ID = "linked_file_id";
public const string DB_ORG_FILE_NAME = "org_file_name";
public const string DB_ORDER_KEY = "order_key";
public const string DB_FILE_TAG = "file_tag";
public const string DB_ALLOW_RENAME_INDC = "allow_rename_indc";
public const string DB_ALLOW_DELETE_INDC = "allow_delete_indc";
public const string DB_FILE_PATH = "file_path";
public const string DB_FILE_SIZE = "file_size";
public const string DB_OWER_ID = "ower_id";
public const string DB_REVISION_NO = "revision_no";
public const string DB_IS_DIRECTORY_INDC = "is_directory_indc";
public const string DB_IS_LINK_INDC = "is_link_indc";
public static DmsFileEntity GetInstance()
{
return new DmsFileEntity();
}
public virtual void CopyFrom(DmsFileEntity source)
{
CopyFrom(source, true);
}
public virtual void CopyFrom(DmsFileEntity 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.FileId = source.FileId;
this.FileName = source.FileName;
this.FileType = source.FileType;
this.LandscapeIndc = source.LandscapeIndc;
this.TranscodeIndc = source.TranscodeIndc;
this.LinkedFileId = source.LinkedFileId;
this.OrgFileName = source.OrgFileName;
this.OrderKey = source.OrderKey;
this.FileTag = source.FileTag;
this.AllowRenameIndc = source.AllowRenameIndc;
this.AllowDeleteIndc = source.AllowDeleteIndc;
this.FilePath = source.FilePath;
this.FileSize = source.FileSize;
this.OwerId = source.OwerId;
this.RevisionNo = source.RevisionNo;
this.IsDirectoryIndc = source.IsDirectoryIndc;
this.IsLinkIndc = source.IsLinkIndc;
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_DMS_FILE} with(nolock) ";
}
public override string GetSelectCountFrom(string sqlWhere)
{
return $" select count(*) from { DB_NAME_DMS_FILE} 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_FILE_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_DMS_FILE} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
}
public DmsFileEntity Clone()
{
DmsFileEntity result = new DmsFileEntity();
result.CopyFrom(this);
return result;
}
}
}
@@ -0,0 +1,114 @@
using CloudBuilder.Core.Authorization;
using CloudBuilder.Core.DatabaseAccessor.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CloudBuilder.AI.Entity
{
[TypeScript]
[Table("dms_folder")]
public class DmsFolderEntity : EntityBase<int>
{
public DmsFolderEntity()
{
}
[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]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("folder_id")]
public int FolderId { get; set; }
[Column("folder_name")]
public string FolderName { get; set; }
[Column("folder_local_name")]
public string? FolderLocalName { 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 FOLDER_ID = "FolderId";
public const string FOLDER_NAME = "FolderName";
public const string FOLDER_LOCAL_NAME = "FolderLocalName";
public const string DB_NAME_DMS_FOLDER = "dms_folder";
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,folder_id,folder_name,folder_local_name";
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_FOLDER_ID = "folder_id";
public const string DB_FOLDER_NAME = "folder_name";
public const string DB_FOLDER_LOCAL_NAME = "folder_local_name";
public static DmsFolderEntity GetInstance()
{
return new DmsFolderEntity();
}
public virtual void CopyFrom(DmsFolderEntity source)
{
CopyFrom(source, true);
}
public virtual void CopyFrom(DmsFolderEntity 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.FolderId = source.FolderId;
this.FolderName = source.FolderName;
this.FolderLocalName = source.FolderLocalName;
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_DMS_FOLDER} with(nolock) ";
}
public override string GetSelectCountFrom(string sqlWhere)
{
return $" select count(*) from { DB_NAME_DMS_FOLDER} 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_FOLDER_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_DMS_FOLDER} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
}
public DmsFolderEntity Clone()
{
DmsFolderEntity result = new DmsFolderEntity();
result.CopyFrom(this);
return result;
}
}
}
@@ -0,0 +1,112 @@
using CloudBuilder.Core.Authorization;
using CloudBuilder.Core.DatabaseAccessor.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CloudBuilder.AI.Entity
{
[TypeScript]
[Table("dms_folder_map")]
public class DmsFolderMapEntity : EntityBase<DmsFolderMapEntityKey>
{
public DmsFolderMapEntity()
{
}
[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("folder_name_parent")]
public string FolderNameParent { get; set; }
[Column("folder_name_son")]
public string FolderNameSon { get; set; }
[Column("orderby")]
public int Orderby { 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 FOLDER_NAME_PARENT = "FolderNameParent";
public const string FOLDER_NAME_SON = "FolderNameSon";
public const string ORDERBY = "Orderby";
public const string DB_NAME_DMS_FOLDER_MAP = "dms_folder_map";
public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,folder_name_parent,folder_name_son,orderby";
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_FOLDER_NAME_PARENT = "folder_name_parent";
public const string DB_FOLDER_NAME_SON = "folder_name_son";
public const string DB_ORDERBY = "orderby";
public static DmsFolderMapEntity GetInstance()
{
return new DmsFolderMapEntity();
}
public virtual void CopyFrom(DmsFolderMapEntity source)
{
CopyFrom(source, true);
}
public virtual void CopyFrom(DmsFolderMapEntity 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.FolderNameParent = source.FolderNameParent;
this.FolderNameSon = source.FolderNameSon;
this.Orderby = source.Orderby;
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_DMS_FOLDER_MAP} with(nolock) ";
}
public override string GetSelectCountFrom(string sqlWhere)
{
return $" select count(*) from { DB_NAME_DMS_FOLDER_MAP} 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_FOLDER_NAME_PARENT ;
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_DMS_FOLDER_MAP} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}";
}
public DmsFolderMapEntity Clone()
{
DmsFolderMapEntity result = new DmsFolderMapEntity();
result.CopyFrom(this);
return result;
}
}
}
@@ -0,0 +1,32 @@
using CloudBuilder.Core.Authorization;
namespace CloudBuilder.AI
{
[TypeScript]
public class DmsFolderMapEntityKey
{
public string FolderNameParent { get; set; }
public string FolderNameSon { get; set; }
public override bool Equals(object obj)
{
if (this == obj) return true;
DmsFolderMapEntityKey pkey = obj as DmsFolderMapEntityKey;
if (pkey == null) return false;
if (FolderNameParent != pkey.FolderNameParent) return false;
if (FolderNameSon != pkey.FolderNameSon) return false;
return true;
}
public override string ToString()
{
string declareSql="";
declareSql=declareSql+$"declare @__tkey_FolderNameParent_0 varchar(50) select @__tkey_FolderNameParent_0 ='{FolderNameParent}'; " ; declareSql=declareSql+$"declare @__tkey_FolderNameSon_1 varchar(50) select @__tkey_FolderNameSon_1 ='{FolderNameSon}'; " ;
return declareSql;
}
}
}
/* builder.Entity<DmsFolderMapEntity>().HasKey(c => new { c.FolderNameParent, c.FolderNameSon}); */
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.AI.Linkup
{
public class AiBookOperationLinkup
{
public int DisplayMode;
public string Guid;
}
}
+24
View File
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.AI.Policy
{
public class AIPrefixPolicy
{
public const string AI_BOOK = "AI_BOOK";
public const string GUID = "GUID";
public const string AI_BOOK_PREFIX = "B";
public const string AI_BOOK_GUID_FORMAT = "000000";
public const string BOOK_DMS_FILE = "BOOK_DMS_FILE";
public const string BOOK_DMS_FILE_BOOK_NAME = "BOOK_NAME";
public const string BOOK_DMS_FILE_FORMAT = "00000000";
public const string DMS_FOLDER = "DMS_FOLDER";
public const string DMS_FOLDER_FOLDER_NAME = "FOLDER_NAME";
}
}
@@ -0,0 +1,10 @@
using CloudBuilder.Core.Authorization;
using CloudBuilder.Core.Service;
namespace CloudBuilder.AI.SearchCriteria
{
[TypeScript]
public class DmsFileSearchCriteria: AbstractSearchCriteria
{
}
}
@@ -0,0 +1,44 @@
using CloudBuilder.AI.Data;
using CloudBuilder.AI.Entity;
using CloudBuilder.AI.SearchCriteria;
using CloudBuilder.Core.Service;
using Microsoft.AspNetCore.Http;
namespace CloudBuilder.AI.Service
{
public interface IDmsFileService : IServiceBase<DmsFileEntity, int, DmsFileSearchCriteria>
{
DmsFileResultData FindBySearchCriteria(DmsFileSearchCriteria tc);
dynamic PrintBySearchCriteria(DmsFileSearchCriteria tc);
DmsFileEntity PackUploadFile(IFormFile file, string folderName);
DmsFileEntity CreateDmsFile(DmsFileEntity dmsFile);
string GetFolderName(string folderLocalName);
string CreateDmsFolder(DmsFileEntity dmsFile);
DmsFileEntity UpdateDmsFolder(DmsFileEntity dmsFile);
void MoveDmsFolder(DmsFileEntity dmsFile);
SelectOption[] FindDmsFolders();
DmsFolderTreeData FindDmsFolderTreeData();
BookDmsFileViewEntity UploadFile();
dynamic DownloadFile(int fileId);
dynamic DownloadFilePreview(DmsFileEntity dmsFile);
dynamic DownloadFileCombine(string fileName);
DmsFileResultData FindDatasBySearchCriteria(DmsFileSearchCriteria criteria);
void DeleteFolder(string folderName);
int FindDmsFolderMapByFolderName(string folderName);
string FindFolderNameParentByFolderName(string folderName);
}
}