using ZR.Model.Enum; namespace ZR.Model.Content.Dto { public class ArticleQueryDto : PagerInfo { public long? UserId { get; set; } public string Status { get; set; } public string Title { get; set; } public string AbstractText { get; set; } public int? IsPublic { get; set; } public int? IsTop { get; set; } public int? CategoryId { get; set; } public DateTime? BeginTime { get; set; } public DateTime? EndTime { get; set; } public int? ArticleType { get; set; } /// /// 1、最新 2、私密 3、热门 /// public int TabId { get; set; } /// /// 话题ID /// public int? TopicId { get; set; } /// /// 排序 1、热门 2、最新 /// public int? OrderBy { get; set; } /// /// 审核状态 /// public AuditStatusEnum? AuditStatus { get; set; } /// /// 查询我加入的圈子 /// public bool QueryMyJoin { get; set; } /// /// 搜索内容 /// public string SearchText { get; set; } } /// /// 输入输出对象 /// public class ArticleDto { [Required(ErrorMessage = "Cid不能为空")] public long Cid { get; set; } //[Required(ErrorMessage = "标题不能为空")] public string Title { get; set; } [Required(ErrorMessage = "内容不能为空")] public string Content { get; set; } public long? UserId { get; set; } public string Status { get; set; } public string EditorType { get; set; } public string Tags { get; set; } public int Hits { get; set; } public int? CategoryId { get; set; } public DateTime? CreateTime { get; set; } public DateTime? UpdateTime { get; set; } public string AuthorName { get; set; } public string CoverUrl { get; set; } public ArticleCategoryDto CategoryNav { get; set; } public string[] TagList { get { return Tags?.Split(',', StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty(); } } public int IsPublic { get; set; } = 1; public string AbstractText { get; set; } public int IsTop { get; set; } /// /// 内容类型 /// public ArticleTypeEnum ArticleType { get; set; } /// /// 点赞数 /// public int PraiseNum { get; set; } /// /// 评论数 /// public int CommentNum { get; set; } /// /// 分享数 /// public int ShareNum { get; set; } /// /// 用户IP /// [JsonIgnore] public string UserIP { get; set; } /// /// 地理位置 /// [JsonIgnore] public string Location { get; set; } /// /// 封面图片集合 /// public string[] CoverImgList { get { return CoverUrl?.Split(',', StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty(); } } /// /// 地理位置 /// public string Position { get { var temp_location = Location?.Split("-")?[0]; if (temp_location == "0") { return "IP未知"; } return temp_location?.Replace("省", ""); } } /// /// 是否点赞 /// public int IsPraise { get; set; } public long TopicId { get; set; } public string TopicName { get; set; } public ArticleUser User { get; set; } /// /// 审核状态 /// public AuditStatusEnum? AuditStatus { get; set; } public CommentSwitchEnum? CommentSwitch { get; set; } } public class ArticleUser { public string Avatar { get; set; } = string.Empty; public string NickName { get; set; } public int Sex { get; set; } } }