增加项目,分层
This commit is contained in:
1 parent
6e995a5bdb
commit
0a3e5af6a9
234 files changed
+26994
-1
No files matched your search
@@ -0,0 +1,57 @@
|
||||
//using MAX.Core.Helpers;
|
||||
//using Polly;
|
||||
//using Store.Framework.HttpResultParser;
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
|
||||
//namespace Store.Framework.Attributes
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Http请求请求失败重新尝试 HttpStatusCode 状态不为Ok一律重新尝试
|
||||
// /// </summary>
|
||||
// [AttributeUsage(AttributeTargets.Method)]
|
||||
// public class HttpTryAttribute : AbstractInterceptorAttribute
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// 最大尝试次数
|
||||
// /// </summary>
|
||||
// public int MaxRetryTimes { get; set; } = 3;
|
||||
// /// <summary>
|
||||
// /// 重新尝试延迟时间毫秒
|
||||
// /// </summary>
|
||||
// public int RetryIntervalMilliseconds { get; set; } = 1000;
|
||||
// protected Type[] VerifyTypes { get; set; }
|
||||
// //public HttpTryAttribute()
|
||||
// //{
|
||||
|
||||
// //}
|
||||
|
||||
// public HttpTryAttribute(params Type[] verifyTypes)
|
||||
// {
|
||||
// VerifyTypes = (verifyTypes ?? new Type[0]);
|
||||
// }
|
||||
// public override Task Invoke(AspectContext context, AspectDelegate next)
|
||||
// {
|
||||
// var verify = HttpResultVerify.TryVerify(() =>
|
||||
// {
|
||||
// next(context).Wait();
|
||||
// return (HttpResult)context.ReturnValue;
|
||||
// }, MaxRetryTimes, RetryIntervalMilliseconds);
|
||||
// if (VerifyTypes != null && VerifyTypes.Count() > 0)
|
||||
// {
|
||||
// foreach (Type item in VerifyTypes)
|
||||
// {
|
||||
// if (typeof(IHttpResultVerify).IsAssignableFrom(item))
|
||||
// {
|
||||
// verify.UseCheckResult((IHttpResultVerify)Activator.CreateInstance(item));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// verify.Exec();
|
||||
// return Task.FromResult(0);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Reference in new issue
Block a user