feat:config move to consul and framework upgrade to 8.0.1

This commit is contained in:
xiaolipro 2026-02-02 18:15:56 +08:00
parent c59f691492
commit 334ab1476a
4 changed files with 8 additions and 85 deletions

View File

@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<!-- All Fake packages -->
<FakePackageVersion>8.0.0</FakePackageVersion>
<FakePackageVersion>8.0.1</FakePackageVersion>
</PropertyGroup>
</Project>

View File

@ -11,6 +11,7 @@
<ProjectReference Include="..\InterfaceForward.Application\InterfaceForward.Application.csproj" />
<ProjectReference Include="..\InterfaceForward.ServiceDefaults\InterfaceForward.ServiceDefaults.csproj"/>
<PackageReference Include="Fake.Autofac" Version="$(FakePackageVersion)" />
<PackageReference Include="Fake.Consul" Version="$(FakePackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.21" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.18" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />

View File

@ -3,6 +3,7 @@ using Serilog;
var builder = WebApplication.CreateSlimBuilder(args);
var configuration = builder.Configuration;
builder.Configuration.AddConsul("idwms/itfxapi", source => source.ReloadOnChange = true);
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(configuration)
.CreateLogger();

View File

@ -1,87 +1,8 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft.AspNetCore": "Debug"
}
},
"Properties": {
"ServiceName": "interface-api"
},
"Enrich": [
"FromLogContext",
"WithMachineName",
"WithProcessId",
"WithThreadId"
],
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext} - {Message:lj}{NewLine}{Exception}",
"formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog"
}
}
]
},
"AllowedHosts": "*",
"App": {
"Urls": [
"http://*:8888"
],
"CorsOrigins": [
"http://localhost:8888"
]
},
"InterfaceRelay": {
"FailedNeedPush": ["A007", "A009", "A022", "A015"],
"ServiceProviderDefaultQPS": 10,
"SpinPeriod": 500
},
"ConnectionStrings": {
"Default": "server=129.204.22.146;database=interface_forward;uid=dev;pwd=itd!@#123;charset=utf8mb4;"
},
"FeiShuNotice": {
"TitlePrefix": "itfx-dev",
"Webhook": "https://open.feishu.cn/open-apis/bot/v2/hook/94e24bce-619d-4b3b-936c-e206353ce802",
"Timeout": 20
},
"Redis": {
"Host": "129.204.22.146:6379",
"Password": "itd!@#123",
"MaxPoolSize": 1000,
"Database": 0,
"Prefix": ""
},
"RabbitMQ": {
"Connections": {
"Default": {
"HostName": "129.204.22.146",
"Port": 5672,
"UserName": "rabbit",
"Password": "itd!@#123",
"DispatchConsumersAsync": true
}
}
},
"ElasticSearch": {
"NodeUrls": [ "http://129.204.22.146:9200" ],
"LoginName": "elastic",
"Password": "itd!@#123",
"ShowLogInfo": false,
"IndexPrefix": ""
},
"JWTSettings": {
"ValidateIssuerSigningKey": true, // bool true
"IssuerSigningKey": "3c1cbc3f546eda35168c3aa3cb91780fbe703f0996c1d133ea96dc85c70bbc0a", // string 16
"ValidateIssuer": true, // bool true
"ValidIssuer": "SimpleAdmin", // string
"ValidateAudience": true, // bool true
"ValidAudience": "SimpleAdmin", // string
"ValidateLifetime": true, // bool truetrue
"ExpiredTime": 50000, // long 20
"ClockSkew": 10, // long 5
"Algorithm": "HS256" // string HS256
"UseLocalConfigs": false,
"Consul": {
"Address": "http://81.71.47.150:8500",
"Datacenter": "dc1",
"Token": "97217125-df0b-5c0a-dbfc-8885def5e471"
}
}