领胜LDS 键盘AOI检测项目
xcd
2020-07-02 b4ac5ccdb184ab08ddd35edc952e3ec0474c8c50
src/Bro.Common.Model/Model/ResponseMessage.cs
@@ -11,55 +11,32 @@
        public bool Result { get; set; } = true;
        public Info Info { get; set; } = new Info();
        public string Message { get; set; }
        public string DataJson { get; set; }
        public void GetMessageFromException(Exception ex)
        {
            //if (ex is ICustomizdException)
            //{
            //    ICustomizdException ie = ex as ICustomizdException;
            //    Code = (int)ie.Level;
            //    Info = ie.Info;
            //}
            //else if (ex is DbEntityValidationException)
            //{
            //    DbEntityValidationException deve = ex as DbEntityValidationException;
            //    Code = 9992;
            //    deve.EntityValidationErrors.ToList().ForEach(error =>
            //    {
            //        DbEntityValidationResult temp = error as DbEntityValidationResult;
            //        temp.ValidationErrors.ToList().ForEach(err =>
            //        {
            //            Info.Title += (err.ErrorMessage + ";");
            //        });
            //    });
            //    Info.Title.TrimEnd(';');
            //    Info.Detail = ex.GetExceptionMessage();
            //}
            //else
            {
                Code = 9999;
                Info = new Info("系统未处理异常,请联系管理员", ex.GetExceptionMessage());
                Message = ex.GetExceptionMessage();
            }
            Result = false;
        }
    }
    public class Info
    {
        public Info() { }
    //public class Info
    //{
    //    public Info() { }
        public Info(string _title, string _detail = "")
        {
            Title = _title;
            Detail = _detail;
        }
        public string Title { get; set; }
    //    public Info(string _title, string _detail = "")
    //    {
    //        Title = _title;
    //        Detail = _detail;
    //    }
    //    public string Title { get; set; }
        public string Detail { get; set; }
    }
    //    public string Detail { get; set; }
    //}
}