using Kivii;
using Kivii.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Njust.Pdf.Analysis.Entities
{

    public class AnalyseBase : EntityWithMetadata 
    {
        [ApiMember(Description = "文献哈希值")]
        [IgnoreUpdate]
        [StringLength(50)]
        public string HashCode { get; set; }

        [ApiMember(Description = "文件名")]
        [StringLength(200)]
        public string FileName { get; set; }

        [ApiMember(Description = "标题")]
        [StringLength(500)]
        public string Title { get; set; }

        [ApiMember(Description = "类别")]
        [StringLength(50)]
        public string Type { get; set; }

        [ApiMember(Description = "分类")]
        [StringLength(50)]
        public string Category { get; set; }

        [ApiMember(Description = "期刊")]
        public string Source { get; set; }

        [ApiMember(Description = "作者")]
        public string Author { get; set; }

        [ApiMember(Description = "关键词")]
        public string Keywords { get; set; }

        [ApiMember(Description = "发表日期")]
        public string PublishTime { get; set; }

        [ApiMember(Description = "机构")]
        [StringLength(500)]
        public string Organization { get; set; }

        [ApiMember(Description = "国家")]
        public string Country { get; set; }

        [ApiMember(Description = "基金")]
        [StringLength(1000)]
        public string Fund { get; set; }

        [ApiMember(Description = "摘要")]
        [StringLength(int.MaxValue)]
        public string Abstract { get; set; }

        [ApiMember(Description = "正文")]
        [StringLength(int.MaxValue)]
        public string Mainbody { get; set; }

        [ApiMember(Description = "全文")]
        [InternalSetter]
        [StringLength(int.MaxValue)]
        public string Allbody { get; set; }

        [ApiMember(Description = "参考文献")]
        [StringLength(int.MaxValue)]
        public string Reference { get; set; }

        [ApiMember(Description = "导入时间")]
        public DateTime ImportTime { get; set; }

        [ApiMember(Description = "导入路径")]
        [InternalSetter]
        [StringLength(200)]
        public string ImportPath { get; set; }

        [ApiMember(Description = "导入人")]
        public string ImportUserName { get; set; }

        [CurrentMemberKvid]
        public Guid ImportUserKvid { get; set; }

        [ApiMember(Description = "解析时间")]
        public DateTime? AnlysisTime { get; set; }

        [ApiMember(Description = "解析人")]
        [CurrentMemberName]
        public string AnlysisUserName { get; set; }

        [CurrentMemberKvid]
        public Guid AnlysisUserKvid { get; set; }

        [ApiMember(Description = "是否解析")]
        [InternalSetter]
        public bool IsAnlysis { get; set; }

        [ApiMember(Description = "复核时间")]
        public DateTime? CheckTime { get; set; }

        [ApiMember(Description = "复核人")]
        public string CheckUserName { get; set; }

        [CurrentMemberKvid]
        public Guid CheckUserKvid { get; set; }

        [ApiMember(Description = "是否复核")]
        [InternalSetter]
        public bool IsChecked { get; set; }

        [ApiMember(Description = "语言")]
        public string Language { get; set; }

        [ApiMember(Description = "所属领域")]
        public string DomainName { get; set; }

        [ApiMember(Description = "是否有图片")]
        [InternalSetter]
        public bool IsImaged { get; set; }
    }

    [Alias(Configs.TableAnalyseName)]
    [Api(Description ="文献解析表")]
    public class Analyse :AnalyseBase,IEntityInAssemblyDb
    {
        [Ignore]
        public new string Allbody { get; set; }

    }

    [Alias(Configs.TableAnalyseName)]
    [Api(Description = "文献解析表")]
    public class AnalyseAll : AnalyseBase, IEntityInAssemblyDb
    {

    }
}
