Skip to content

Commit

Permalink
Merge pull request #24 from netcorepal/v2
Browse files Browse the repository at this point in the history
use v2.x
  • Loading branch information
witskeeper authored Nov 26, 2024
2 parents 7432491 + ef9e213 commit 1109720
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion template/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<NetCorePalVersion>2.0.0-preview.1.2411120955</NetCorePalVersion>
<NetCorePalVersion>2.0.0-preview.1.2411260738</NetCorePalVersion>
<FrameworkVersion>8.0.0</FrameworkVersion>
<ExtensionsVersion>8.0.0</ExtensionsVersion>
<EntityFrameworkVersion>8.0.0</EntityFrameworkVersion>
Expand Down
11 changes: 5 additions & 6 deletions template/src/ABC.Template.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
using Serilog.Formatting.Json;
using Hangfire;
using Hangfire.Redis.StackExchange;
using NetCorePal.Extensions.AspNetCore.Json;
using NetCorePal.Extensions.MultiEnv;
using NetCorePal.Extensions.NewtonsoftJson;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Refit;
Expand Down Expand Up @@ -122,15 +121,15 @@
builder.Services.AddUnitOfWork<ApplicationDbContext>();
builder.Services.AddMySqlTransactionHandler();
builder.Services.AddRedisLocks();
//配置多环境Options
builder.Services.Configure<EnvOptions>(envOptions => builder.Configuration.GetSection("Env").Bind(envOptions));
builder.Services.AddContext().AddEnvContext().AddCapContextProcessor();
builder.Services.AddNetCorePalServiceDiscoveryClient();
builder.Services.AddIntegrationEventServices(typeof(Program))
.AddIIntegrationEventConverter(typeof(Program))
.UseCap(typeof(Program))
.AddContextIntegrationFilters()
.AddEnvIntegrationFilters(envOption => envOption.ServiceName = "Abc.Template");
.AddContextIntegrationFilters();
builder.Services.AddMultiEnv(envOption => envOption.ServiceName = "Abc.Template")
.AddEnvIntegrationFilters()
.AddEnvServiceSelector();
builder.Services.AddCap(x =>
{
x.JsonSerializerOptions.Converters.Add(new EntityIdJsonConverterFactory());
Expand Down
3 changes: 2 additions & 1 deletion template/src/ABC.Template.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"HostName": "localhost",
"UserName": "guest",
"Password": "guest",
"VirtualHost": "/"
"VirtualHost": "/",
"Port": 5672
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.AspNetCore.Hosting;
using NetCorePal.Extensions.AspNetCore.Json;

namespace ABC.Template.Web.Tests.Extensions;

Expand Down
1 change: 0 additions & 1 deletion template/test/ABC.Template.Web.Tests/ProgramTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Net.Http.Json;
using Microsoft.AspNetCore.Mvc.Testing;
using NetCorePal.Extensions.AspNetCore.Json;
using Xunit;

namespace ABC.Template.Web.Tests
Expand Down

0 comments on commit 1109720

Please sign in to comment.