Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.9.2.5 #49

Merged
merged 36 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3cf2cc4
[feat]拆分AbstractWebApiDependencyRegistrar.cs的代码到多个文件。
AlphaYu Jun 23, 2022
39d4180
[feat]ThreadPoolSettings增加Name属性
AlphaYu Jun 24, 2022
dd43905
[feat]AbstractWebApiDependencyRegistrar.cs注册文件优化。
AlphaYu Jun 24, 2022
d6089e2
[feat]sAbstractApplicationDependencyRegistrar.cs拆分到多个分布类
AlphaYu Jun 24, 2022
02f3d8d
[feat]Adnc.Infra.Caching.csproj代码优化。
AlphaYu Jun 24, 2022
0ba0414
[fix]调整涉及adnc.infra.Caching相关代码。
AlphaYu Jun 24, 2022
620cc4b
[fix]调整涉及adnc.infra.Caching相关代码。
AlphaYu Jun 24, 2022
8aaacac
[fix]调整涉及adnc.infra.Caching相关代码。
AlphaYu Jun 24, 2022
26f32b0
[feat]AddHealthChecks调整
AlphaYu Jun 24, 2022
332729b
[feat]代码优化调整
AlphaYu Jun 25, 2022
51004a3
[feat]代码优化调整
AlphaYu Jun 25, 2022
2eaac10
[feat]代码优化调整
AlphaYu Jun 25, 2022
2d84497
[feat]变量名称调整。
AlphaYu Jun 25, 2022
d879a83
[feat]字典,配置代码调整。
AlphaYu Jun 25, 2022
777252a
[feat]完善字典,配置缓存预热相关代码。
AlphaYu Jun 26, 2022
3147048
[feat]代码优化
AlphaYu Jun 26, 2022
24d456a
[feat]代码优化调整
AlphaYu Jun 26, 2022
c0ef9b7
[feat]完善AbstractWebApiDependencyRegistrar.HealthChecks.cs
AlphaYu Jun 26, 2022
e107fb9
[feat]Adnc.Infra.EventBus注册代码优化
AlphaYu Jun 27, 2022
05bd439
[feat]adnc.infra.eventbus注册代码优化
AlphaYu Jun 27, 2022
8b5f5f6
[fix]删除无效代码
AlphaYu Jun 27, 2022
42c2d4e
[feat]PermissionAttribute => AdncAuthorizeAttribute
AlphaYu Jun 27, 2022
dfe678f
[feat]升级依赖组件到最新稳定版
AlphaYu Jun 27, 2022
c13f50a
[feat]升级依赖组件到最新稳定版
AlphaYu Jun 27, 2022
dff4117
[feat]升级依赖组件到最新稳定版
AlphaYu Jun 27, 2022
9acde45
[feat]升级依赖组件到最新稳定版
AlphaYu Jun 27, 2022
d70c8b4
[feat]程序启动,consul注册逻辑完善
AlphaYu Jun 28, 2022
e8fd85e
[fix]增加capdashbord路由配置
AlphaYu Jun 28, 2022
1d823a6
[fix] 添加Obsolete特性,标注已经过期。
AlphaYu Jun 28, 2022
067eb36
[fix]替换fluentvalidation过期方法
AlphaYu Jun 28, 2022
6e23f2a
[fix]消除null警告
AlphaYu Jun 28, 2022
0d16609
[fix]隐藏0436警告
AlphaYu Jun 28, 2022
a6eb80c
[fix]不导入多余的wrappers.proto
AlphaYu Jun 28, 2022
eae71de
[fix]消除参数警告
AlphaYu Jun 28, 2022
160ae95
[fix]调整logger.error参数顺序
AlphaYu Jun 29, 2022
685af79
[feat]nlog配置文件调整
AlphaYu Jun 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[feat]代码优化
  • Loading branch information
AlphaYu committed Jun 26, 2022
commit 314704891f1e5ab59da15dba822d1ceefaadd236
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected virtual void AddEventBusSubscribers<TSubscriber>(Action<IServiceCollec
action?.Invoke(Services);

var tableNamePrefix = "cap";
var groupName = $"cap.{ServiceInfo.ShortName}.{ASPNETCORE_ENVIRONMENT[..3]}".ToLower();
var groupName = $"cap.{ServiceInfo.ShortName}.{this.GetEnvShortName()}".ToLower();

//add skyamp
//Services.AddSkyApmExtensions().AddCap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected virtual void AddEfCoreContextWithRepositories(Action<IServiceCollectio
.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
});

if (IsDevelopment)
if (this.IsDevelopment())
{
//options.AddInterceptors(new DefaultDbCommandInterceptor())
options.LogTo(Console.WriteLine)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ public abstract partial class AbstractApplicationDependencyRegistrar : IDependen
public abstract Assembly ContractsLayerAssembly { get; }
public abstract Assembly RepositoryOrDomainLayerAssembly { get; }
protected List<AddressNode> RpcAddressInfo { get; init; }

public string ASPNETCORE_ENVIRONMENT => Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
public bool IsDevelopment => ASPNETCORE_ENVIRONMENT.EqualsIgnoreCase("Development");
protected IServiceCollection Services { get; init; }
protected IConfiguration Configuration { get; init; }
protected IServiceInfo ServiceInfo { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class AbstractApplicationDependencyRegistrarExtension
/// default rest policies
/// </summary>
/// <returns></returns>
public static List<IAsyncPolicy<HttpResponseMessage>> GenerateDefaultRefitPolicies(this AbstractApplicationDependencyRegistrar registrar)
public static List<IAsyncPolicy<HttpResponseMessage>> GenerateDefaultRefitPolicies(this AbstractApplicationDependencyRegistrar _)
{
//隔离策略
//var bulkheadPolicy = Policy.BulkheadAsync<HttpResponseMessage>(10, 100);
Expand All @@ -35,7 +35,7 @@ public static List<IAsyncPolicy<HttpResponseMessage>> GenerateDefaultRefitPolici
TimeSpan.FromSeconds(5),
});
//超时策略
var timeoutPolicy = Policy.TimeoutAsync<HttpResponseMessage>(registrar.IsDevelopment ? 10 : 9);
var timeoutPolicy = Policy.TimeoutAsync<HttpResponseMessage>(IsDevelopment(_) ? 10 : 9);

//熔断策略
//如下,如果我们的业务代码连续失败50次,就触发熔断(onBreak),就不会再调用我们的业务代码,而是直接抛出BrokenCircuitException异常。
Expand Down Expand Up @@ -84,7 +84,24 @@ public static List<IAsyncPolicy<HttpResponseMessage>> GenerateDefaultRefitPolici
/// </summary>
/// <param name="registrar"></param>
/// <returns></returns>
public static List<IAsyncPolicy<HttpResponseMessage>> GenerateDefaultGrpcPolicies(this AbstractApplicationDependencyRegistrar registrar)
=> GenerateDefaultRefitPolicies(registrar);
public static List<IAsyncPolicy<HttpResponseMessage>> GenerateDefaultGrpcPolicies(this AbstractApplicationDependencyRegistrar registrar) =>
GenerateDefaultRefitPolicies(registrar);


public static string ASPNETCORE_ENVIRONMENT => Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");

public static bool IsDevelopment(this AbstractApplicationDependencyRegistrar _) => ASPNETCORE_ENVIRONMENT.EqualsIgnoreCase("Development");

public static string GetEnvShortName(this AbstractApplicationDependencyRegistrar _)
{
return ASPNETCORE_ENVIRONMENT.ToLower() switch
{
"development" => "dev",
"test" => "test",
"staging" => $"stag",
"production" => $"prod",
_ => throw new NullReferenceException(nameof(ASPNETCORE_ENVIRONMENT))
};
}
}
}