using iWareCommon.Utils; using iWareLog.ORM; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using iWareCommon.Common.Entity; namespace iWareLog.LOG.Entity { public class FailSentMessageEntity : ICommonEntity { /// /// 1主键 /// public int Id { get; set; } /// /// 2提交地址 /// public string Url { get; set; } /// /// 3请求字符串 /// public string RequestStr { get; set; } /// /// 4重试次数 /// public int RetryTimes { get; set; } /// /// 5是否ok,0为未成功,1为成功 /// public int IsOk { get; set; } /// /// 6是否发送邮件:0为未发送,1为已发送 /// public int IsMailed { get; set; } /// /// 7创建时间 /// public DateTime CreateTime { get; set; } /// /// 8结束事件 /// public DateTime FinishTime { get; set; } /// /// 9错误消息 /// public string ResMsg { get; set; } /// /// 无参构造 /// public FailSentMessageEntity() { } /// /// 有参构造 /// /// orm印射的类 public FailSentMessageEntity(LOGERRORFailSentMessage alert) { EntityPropHelper.CopyProp(alert, this, GetColumnMap()); } /// /// 将对象转换成ORM中的类型 /// /// Orm中的BASEShift类型 public LOGERRORFailSentMessage ToOrm() { LOGERRORFailSentMessage alert = new LOGERRORFailSentMessage(); EntityPropHelper.CopyProp(this, alert, GetColumnMap()); return alert; } /// /// 获取自定义角色类中的字段名为键,orm中对象的字段名为值的字段 /// /// public static Dictionary GetColumnMap() { return new Dictionary() { {"Id", "id"}, {"Url", "url"}, {"RequestStr", "requeststr"}, {"RetryTimes", "retrytimes"}, {"IsOk", "isok"}, {"IsMailed", "ismailed"}, {"CreateTime", "createtime"}, {"UpdateTime","updatetime"}, {"ResMsg","resmsg"} }; } /// /// 根据ShiftEntity的字段转BASEShift的字段 /// /// ShiftEntity的字段 /// BASEShift public static string GetColumnName(string name) { var columnMap = GetColumnMap(); return columnMap.ContainsKey(name) ? columnMap[name] : name; } /// /// 获取ShiftEntity对应的表名 /// /// 表名 public static string GetTableName() { return "[dbo].[LOGERRORFailSentMessage]"; } } }