| | |
| | | _accessor = accessor; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 实例化IInterceptor唯一方法 |
| | | /// </summary> |
| | |
| | | string json; |
| | | try |
| | | { |
| | | if(invocation.Arguments.Any()) |
| | | if (invocation.Arguments.Any()) |
| | | { |
| | | json = JsonConvert.SerializeObject(invocation.Arguments); |
| | | } |
| | |
| | | apiLogAopInfo.ResponseIntervalTime = ResponseTime + "ms"; |
| | | apiLogAopInfo.ResponseJsonData = JsonConvert.SerializeObject(o); |
| | | |
| | | |
| | | await Task.Run(() => |
| | | { |
| | | Parallel.For(0, 1, e => |
| | |
| | | |
| | | public static bool IsAsyncMethod(MethodInfo method) |
| | | { |
| | | return |
| | | method.ReturnType == typeof(Task) || |
| | | method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(Task<>) |
| | | ; |
| | | return method.ReturnType == typeof(Task) || method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(Task<>); |
| | | } |
| | | } |
| | | |
| | |
| | | Func<object, Task> action, Action<Exception> finalAction) |
| | | { |
| | | return typeof(InternalAsyncHelper) |
| | | .GetMethod("AwaitTaskWithPostActionAndFinallyAndGetResult", BindingFlags.Public | BindingFlags.Static) |
| | | .GetMethod(nameof(AwaitTaskWithPostActionAndFinallyAndGetResult), BindingFlags.Public | BindingFlags.Static) |
| | | .MakeGenericMethod(taskReturnType) |
| | | .Invoke(null, new object[] { actualReturnValue, action, finalAction }); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 请求参数数据JSON |
| | | /// </summary> |
| | | [Description("请求参数数据JSON")] |
| | | [Description("请求参数数据JSON")] |
| | | public string RequestParamsData { get; set; } = string.Empty; |
| | | /// <summary> |
| | | /// 请求响应间隔时间 |