using CZFW.Core; using CZFW.Framework.Attributes; using CZFW.Framework.Model.Entity; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace CZKJ.GBRS2.Entity { [Table("cz_gbrs2_video")] public class VideoEntity : EntityBase,ISeo ,IShare { /// /// 名称 /// [Display(Name = "名称")] [StringLength(64)] [Required] public string Name { get; set; } /// /// 视频链接 /// [Display(Name = "视频链接")] [StringLength(2048)] [Required] [DataType(DataType.MultilineText)] public string Url { get; set; } /// /// 图片 /// [Display(Name = "图片",Description ="图片尺寸:385*280px")] [StringLength(1024)] [DataType(DataType.ImageUrl)] public string Image { get; set; } /// /// 介绍 /// [StringLength(1024)] [Display(Name = "介绍")] [DataType(DataType.MultilineText)] public string Description { get; set; } #region SEO及分享 [NotMapped] private string seotitle; [NotMapped] private string seodescription; [NotMapped] private string seokeywords; [NotMapped] private string sharetitle; [NotMapped] private string sharedescription; [NotMapped] private string shareurl; [NotMapped] private string shareimage; [StringLength(128)] [Display(Name = "SEO标题")] [Invisible(FormVisible = true, AddVisible = true)] public string SeoTitle { get { return string.IsNullOrEmpty(seotitle) ? Name : seotitle; } set { seotitle = value; } } /// /// SEO描述 /// [StringLength(512)] [Display(Name = @"SEO描述")] [DataType(DataType.MultilineText)] [Invisible(FormVisible = true, AddVisible = true)] public string SeoDescription { get { return string.IsNullOrEmpty(seodescription) ? Description : seodescription; } set { seodescription = value; } } /// /// SEO关键词 /// [StringLength(128)] [Display(Name = @"SEO关键词")] [Invisible(FormVisible = true, AddVisible = true)] public string SeoKeywords { get { return string.IsNullOrEmpty(seokeywords) ? Name : seokeywords; } set { seokeywords = value; } } /// /// 分享图片 /// [StringLength(512)] [Display(Name = @"分享图片")] [DataType(DataType.ImageUrl)] [Invisible(FormVisible = true, AddVisible = true)] public string ShareImage { get { return string.IsNullOrEmpty(shareimage) ? Image : shareimage; } set { shareimage = value; } } /// /// 分享标题 /// [StringLength(128)] [Display(Name = @"分享标题")] [Invisible(FormVisible = true, AddVisible = true)] public string ShareTitle { get { return string.IsNullOrEmpty(sharetitle) ? Name : sharetitle; } set { sharetitle = value; } } /// /// 分享URL /// [StringLength(512)] [Display(Name = @"分享URL")] [Invisible(FormVisible = true, AddVisible = true)] public string ShareUrl { get { return string.IsNullOrEmpty(shareurl) ? ConfigHelper.GetValue("SystemInfo:Website") : shareurl; } set { shareurl = value; } } /// /// 分享描述 /// [StringLength(512)] [Display(Name = @"分享描述")] [Invisible(FormVisible = true, AddVisible = true)] public string ShareDescription { get { return string.IsNullOrEmpty(sharedescription) ? Description : sharedescription; } set { sharedescription = value; } } #endregion } }