From b4ac5ccdb184ab08ddd35edc952e3ec0474c8c50 Mon Sep 17 00:00:00 2001 From: xcd <834800634@qq.com> Date: 星期四, 02 七月 2020 11:32:53 +0800 Subject: [PATCH] 修改运动/板卡接口返回值类型 --- src/Bro.Common.Model/Model/ResponseMessage.cs | 49 +++++++++++++------------------------------------ 1 files changed, 13 insertions(+), 36 deletions(-) diff --git a/src/Bro.Common.Model/Model/ResponseMessage.cs b/src/Bro.Common.Model/Model/ResponseMessage.cs index 61d5ffe..3f13f70 100644 --- a/src/Bro.Common.Model/Model/ResponseMessage.cs +++ b/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; } + //} } -- Gitblit v1.8.0