/// <summary>
        /// 返回失败消息
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        protected IActionResult Fail(EnumStateCode code)
        {
            var logger = LogManager.GetCurrentClassLogger();

            logger.Log(LogLevel.Error, code.EnumDescription());
            return(new ResponseResult(false, code.EnumDescription(), ((int)code).ToString(), ModelState.ModelStateMessage()));
        }
Exemplo n.º 2
0
 public ResponseResult(EnumStateCode code, string error) : base(null)
 {
     _success = false;
     _code    = ((int)code).ToString();
     _message = code.EnumDescription();
     _data    = null;
     _error   = error;
 }