/// <summary> /// 初始化接口返回参数方法 /// </summary> /// <param name="response">接受参数实体</param> /// <param name="errorCode">参数接口枚举</param> /// <returns></returns> public static InnerResponse InfoToResponse(this InnerResponse response, InfoErrorCode errorCode) { response.ErrorCode = errorCode.InfoGetValue(); response.Message = errorCode.InfoGetDescription(); response.Success = false; if (errorCode == InfoErrorCode.Code100) { response.Success = true; } return(response); }
/// <summary> /// 初始化接口返回参数方法 /// </summary> /// <param name="response">接受参数实体</param> /// <param name="errorCode">参数接口枚举</param> /// <returns></returns> public static Response InfoToResponse(this Response response, InfoErrorCode errorCode) { response.ErrorCode = errorCode.InfoGetValue(); response.Message = errorCode.InfoGetDescription(); return(response); }