using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PublicCode { /// /// 系统日志基础类 /// public class SystemLogModel : ISystemLogModel { public SystemLogModel() { this.Init(); } /// /// 主键 /// public string id { get; set; } /// /// 创建时间 /// public string create_time { get; set; } /// /// 基本状态,0为默认 /// public string state { get; set; } /// /// 记录的来源系统 /// public string create_system { get; set; } /// /// 记录者 /// ss public string create_user { get; set; } /// /// 日志级别 /// public string log_level { get; set; } /// /// 其他信息 /// public string other_info { get; set; } /// /// 日志归类编号 /// public string log_code { get; set; } /// /// 发生的类 /// public string source_class { get; set; } /// /// 初始化赋值 /// public virtual void Init() { id = Guid.NewGuid().ToString(); create_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"); state = "0"; log_level = "low"; create_system = AppContext.BaseDirectory; log_code = AppContext.BaseDirectory + "_" + Guid.NewGuid().ToString(); } public virtual bool IsNull() { bool res = true; foreach (var a in this.GetType().GetProperties()) { res = res && string.IsNullOrWhiteSpace(Convert.ToString(a.GetValue(this))); } return res; } } }