Beispiel #1
0
        /// <summary>
        /// 异常处理
        /// </summary>
        /// <param name="request"></param>
        /// <param name="responseModel"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        private string GetErrorContent(RequestModelType request, ApiResponseModelBase responseModel, Exception ex)
        {
            string custError = GetCustomErrorOutput(request, responseModel, ex);

            if (custError != NoCustomOutputFun)
            {
                return(custError);
            }
            //responseModel.respTime = DateTime.Now;
            var resp = GetUnSuccessResponseModel(responseModel);

            if (resp == null)
            {
                return(OutputProcessor.OutPut <ApiResponseModelBase>(responseModel, IgnoreList));
            }
            else
            {
                return(OutputProcessor.OutPut <ResponseModelType>(resp, IgnoreList));
            }
        }
Beispiel #2
0
 /// <summary>
 /// 执行接口序列化
 /// </summary>
 /// <param name="responseModel"></param>
 /// <param name="requestModel"></param>
 /// <returns></returns>
 private string GetOutPutContent(ResponseModelType responseModel, RequestModelType requestModel)
 {
     return(OutputProcessor.OutPut <ResponseModelType>(responseModel, IgnoreList));
 }
Beispiel #3
0
 /// <summary>
 /// 执行接口序列化
 /// </summary>
 /// <param name="responseModel"></param>
 /// <param name="requestModel"></param>
 /// <returns></returns>
 private string GetOutPutContent(ResponseModelType responseModel, RequestModelType requestModel)
 {
     //responseModel.respTime = DateTime.Now;
     return(OutputProcessor.OutPut <ResponseModelType>(responseModel));
 }