using MadRunFabric.Common;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace MadRunFabric.Model
{
    /// <summary>
    /// 1、重要事项
    /// 2、公告管理 - 省三院
    /// </summary>
    public class Sys_News : IBaseModel<string>
    {
        /// <summary>
        /// id
        /// </summary>
        [Key]
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string id { get; set; }

        /// <summary>
        /// 省code
        /// </summary>
        public string province { get; set; } 

        /// <summary>
        /// 市code
        /// </summary>
        public string city { get; set; }

        /// <summary>
        /// 项目id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string projectid { get; set; }

        /// <summary>
        /// 类型id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string typeid { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string content { get; set; }

        /// <summary>
        /// 图片
        /// </summary>
        public string headimg { get; set; }

        /// <summary>
        /// 图片缩略图
        /// </summary>
        public string headsmallimg { get; set; }

        /// <summary>
        /// 附件
        /// </summary>
        public List<FileBaseModel> files { get; set; }
        /// <summary>
        /// 级别(1最高)
        /// </summary>
        public int level { get; set; }

        /// <summary>
        /// 状态(0正常显示、1不显示) ----------------- 定时部分 state
        /// </summary>
        public int state { get; set; } = 0;
        /// <summary>
        /// 发布类型(0立即发布、1定时发布)
        /// </summary>
        public int publishtype { get; set; } = 0;
        /// <summary>
        /// 定时时间
        /// </summary>
        public DateTime? timingtime { get; set; }
        /// <summary>
        /// 有效期时间(空值不限制)
        /// </summary>
        public DateTime? endtime { get; set; }
        /// <summary>
        /// 权限角色(空值是所有可看) ------------------------------------ 定时部分 end
        /// </summary>
        public string rolecode { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int sort { get; set; }
        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime createtime { get; set; } = DateTime.Now;
        /// <summary>
        /// 提交人工号
        /// </summary>
        public string createuser { get; set; }
        /// <summary>
        /// 提交人姓名
        /// </summary>
        public string createusername { get; set; } 
        /// <summary>
        /// 是否删除
        /// </summary>
        public int isdelete { get; set; } = 0;
        /// <summary>
        /// 删除用户
        /// </summary>
        public string deleteuser { get; set; }
        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? deletetime { get; set; }
    }
}
