示例#1
0
        public static SimpleResponseDto <T> Failed(ResponseCodeEnum responseCodeEnum)
        {
            SimpleResponseDto <T> dto = NewInstance();

            dto.Code       = ((int)responseCodeEnum).ToString();
            dto.Message    = responseCodeEnum.GetMessage();
            dto.ServerTime = DateTime.Now.Ticks;

            return(dto);
        }
示例#2
0
        public static SimpleResponseDto <T> SystemException(Exception e)
        {
            ResponseCodeEnum      responseCodeEnum = ResponseCodeEnum.ResponseCode_500;
            SimpleResponseDto <T> dto = NewInstance();

            dto.Code       = ((int)responseCodeEnum).ToString();
            dto.Message    = responseCodeEnum.GetMessage();
            dto.ServerTime = DateTime.Now.Ticks;

            return(dto);
        }