VideoEntity.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. using CZFW.Core;
  2. using CZFW.Framework.Attributes;
  3. using CZFW.Framework.Model.Entity;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.ComponentModel.DataAnnotations.Schema;
  6. namespace CZKJ.GBRS2.Entity
  7. {
  8. [Table("cz_gbrs2_video")]
  9. public class VideoEntity : EntityBase,ISeo ,IShare
  10. {
  11. /// <summary>
  12. /// 名称
  13. /// </summary>
  14. [Display(Name = "名称")]
  15. [StringLength(64)]
  16. [Required]
  17. public string Name { get; set; }
  18. /// <summary>
  19. /// 视频链接
  20. /// </summary>
  21. [Display(Name = "视频链接")]
  22. [StringLength(2048)]
  23. [Required]
  24. [DataType(DataType.MultilineText)]
  25. public string Url { get; set; }
  26. /// <summary>
  27. /// 图片
  28. /// </summary>
  29. [Display(Name = "图片",Description ="图片尺寸:385*280px")]
  30. [StringLength(1024)]
  31. [DataType(DataType.ImageUrl)]
  32. public string Image { get; set; }
  33. /// <summary>
  34. /// 介绍
  35. /// </summary>
  36. [StringLength(1024)]
  37. [Display(Name = "介绍")]
  38. [DataType(DataType.MultilineText)]
  39. public string Description { get; set; }
  40. #region SEO及分享
  41. [NotMapped]
  42. private string seotitle;
  43. [NotMapped]
  44. private string seodescription;
  45. [NotMapped]
  46. private string seokeywords;
  47. [NotMapped]
  48. private string sharetitle;
  49. [NotMapped]
  50. private string sharedescription;
  51. [NotMapped]
  52. private string shareurl;
  53. [NotMapped]
  54. private string shareimage;
  55. [StringLength(128)]
  56. [Display(Name = "SEO标题")]
  57. [Invisible(FormVisible = true, AddVisible = true)]
  58. public string SeoTitle
  59. {
  60. get { return string.IsNullOrEmpty(seotitle) ? Name : seotitle; }
  61. set { seotitle = value; }
  62. }
  63. /// <summary>
  64. /// SEO描述
  65. /// </summary>
  66. [StringLength(512)]
  67. [Display(Name = @"SEO描述")]
  68. [DataType(DataType.MultilineText)]
  69. [Invisible(FormVisible = true, AddVisible = true)]
  70. public string SeoDescription
  71. {
  72. get { return string.IsNullOrEmpty(seodescription) ? Description : seodescription; }
  73. set { seodescription = value; }
  74. }
  75. /// <summary>
  76. /// SEO关键词
  77. /// </summary>
  78. [StringLength(128)]
  79. [Display(Name = @"SEO关键词")]
  80. [Invisible(FormVisible = true, AddVisible = true)]
  81. public string SeoKeywords
  82. {
  83. get { return string.IsNullOrEmpty(seokeywords) ? Name : seokeywords; }
  84. set { seokeywords = value; }
  85. }
  86. /// <summary>
  87. /// 分享图片
  88. /// </summary>
  89. [StringLength(512)]
  90. [Display(Name = @"分享图片")]
  91. [DataType(DataType.ImageUrl)]
  92. [Invisible(FormVisible = true, AddVisible = true)]
  93. public string ShareImage
  94. {
  95. get { return string.IsNullOrEmpty(shareimage) ? Image : shareimage; }
  96. set { shareimage = value; }
  97. }
  98. /// <summary>
  99. /// 分享标题
  100. /// </summary>
  101. [StringLength(128)]
  102. [Display(Name = @"分享标题")]
  103. [Invisible(FormVisible = true, AddVisible = true)]
  104. public string ShareTitle
  105. {
  106. get { return string.IsNullOrEmpty(sharetitle) ? Name : sharetitle; }
  107. set { sharetitle = value; }
  108. }
  109. /// <summary>
  110. /// 分享URL
  111. /// </summary>
  112. [StringLength(512)]
  113. [Display(Name = @"分享URL")]
  114. [Invisible(FormVisible = true, AddVisible = true)]
  115. public string ShareUrl
  116. {
  117. get { return string.IsNullOrEmpty(shareurl) ? ConfigHelper.GetValue<string>("SystemInfo:Website") : shareurl; }
  118. set { shareurl = value; }
  119. }
  120. /// <summary>
  121. /// 分享描述
  122. /// </summary>
  123. [StringLength(512)]
  124. [Display(Name = @"分享描述")]
  125. [Invisible(FormVisible = true, AddVisible = true)]
  126. public string ShareDescription
  127. {
  128. get { return string.IsNullOrEmpty(sharedescription) ? Description : sharedescription; }
  129. set { sharedescription = value; }
  130. }
  131. #endregion
  132. }
  133. }