From 334ab1476a68a6475be0fa96543d0513c821aef1 Mon Sep 17 00:00:00 2001
From: xiaolipro <2357729423@qq.com>
Date: Mon, 2 Feb 2026 18:15:56 +0800
Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Aconfig=20move=20to=20consul=20and?=
=?UTF-8?q?=20framework=20upgrade=20to=208.0.1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Directory.Build.props | 2 +-
.../InterfaceForward.Api.csproj | 1 +
src/InterfaceForward.Api/Program.cs | 1 +
src/InterfaceForward.Api/appsettings.json | 89 ++-----------------
4 files changed, 8 insertions(+), 85 deletions(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 98c98ba..dfff247 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,6 +1,6 @@
- 8.0.0
+ 8.0.1
diff --git a/src/InterfaceForward.Api/InterfaceForward.Api.csproj b/src/InterfaceForward.Api/InterfaceForward.Api.csproj
index 03c8103..0773f42 100644
--- a/src/InterfaceForward.Api/InterfaceForward.Api.csproj
+++ b/src/InterfaceForward.Api/InterfaceForward.Api.csproj
@@ -11,6 +11,7 @@
+
diff --git a/src/InterfaceForward.Api/Program.cs b/src/InterfaceForward.Api/Program.cs
index a5d6a02..5f97342 100644
--- a/src/InterfaceForward.Api/Program.cs
+++ b/src/InterfaceForward.Api/Program.cs
@@ -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();
diff --git a/src/InterfaceForward.Api/appsettings.json b/src/InterfaceForward.Api/appsettings.json
index 1be52f1..c5971d5 100644
--- a/src/InterfaceForward.Api/appsettings.json
+++ b/src/InterfaceForward.Api/appsettings.json
@@ -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 类型,默认true,建议true
- "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"
}
}