Skip to content

Commit fb007c4

Browse files
committed
refactor: 更新依赖版本并优化本地化引用路径
- 更新Quartz和Lib.Harmony到最新版本 - 在CodeGenerator中添加Localization项目引用 - 统一本地化服务引用路径,移除冗余命名空间前缀 - 添加Swagger相关命名空间引用
1 parent 9851a4c commit fb007c4

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

GameFrameX.CodeGenerator/Agent/AgentGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void Execute(GeneratorExecutionContext context)
182182

183183
if (mth.IsThreadSafe && mth.HasTimeout)
184184
{
185-
context.LogError(LocalizationService.GetString(GameFrameX.Localization.Keys.CodeGenerator.AgentGenerator.CannotSetTimeoutForThreadSafeAttribute, fullName, method.Identifier.Text, threadSafeAttributeName));
185+
context.LogError(LocalizationService.GetString(Localization.Keys.CodeGenerator.AgentGenerator.CannotSetTimeoutForThreadSafeAttribute, fullName, method.Identifier.Text, threadSafeAttributeName));
186186
}
187187

188188
if (!mth.IsApi && !mth.Discard && mth.HasTimeout)

GameFrameX.CodeGenerator/GameFrameX.CodeGenerator.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
<ItemGroup>
2828
<ProjectReference Include="..\GameFrameX.Core\GameFrameX.Core.csproj" />
29+
<ProjectReference Include="..\GameFrameX.Localization\GameFrameX.Localization.csproj" />
2930
</ItemGroup>
3031

3132
</Project>

GameFrameX.Core/GameFrameX.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</PropertyGroup>
4747

4848
<ItemGroup>
49-
<PackageReference Include="Quartz" Version="3.15.0" />
49+
<PackageReference Include="Quartz" Version="3.15.1" />
5050
</ItemGroup>
5151

5252
<ItemGroup>

GameFrameX.StartUp/AppStartUpByHTTPServer.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
using Microsoft.AspNetCore.Http;
4545
using Microsoft.Extensions.DependencyInjection;
4646
using Microsoft.Extensions.Logging;
47+
using Microsoft.OpenApi;
4748
using Microsoft.OpenApi.Models;
4849
using Serilog;
4950

@@ -156,13 +157,14 @@ private async Task StartHttpServer(List<BaseHttpHandler> baseHandler, Func<strin
156157
app.UseSwagger();
157158
app.UseSwaggerUI(options =>
158159
{
159-
options.SwaggerEndpoint(string.Format(LocalizationService.GetString(GameFrameX.Localization.Keys.StartUp.HttpServer.SwaggerEndpointFormat), openApiInfo.Version), openApiInfo.Title);
160-
options.RoutePrefix = LocalizationService.GetString(GameFrameX.Localization.Keys.StartUp.HttpServer.SwaggerRoutePrefix);
160+
var swaggerEndpoint = LocalizationService.GetString(Localization.Keys.StartUp.HttpServer.SwaggerEndpointFormat, openApiInfo.Version);
161+
options.SwaggerEndpoint(swaggerEndpoint, openApiInfo.Title);
162+
options.RoutePrefix = LocalizationService.GetString(Localization.Keys.StartUp.HttpServer.SwaggerRoutePrefix);
161163
});
162164

163165
foreach (var ip in ipList)
164166
{
165-
LogHelper.Debug(LocalizationService.GetString(GameFrameX.Localization.Keys.StartUp.HttpServer.SwaggerUiAccess, ip, Setting.HttpPort));
167+
LogHelper.Debug(LocalizationService.GetString(Localization.Keys.StartUp.HttpServer.SwaggerUiAccess, ip, Setting.HttpPort));
166168
}
167169
}
168170

@@ -178,15 +180,15 @@ private async Task StartHttpServer(List<BaseHttpHandler> baseHandler, Func<strin
178180
app.MapPrometheusScrapingEndpoint();
179181
foreach (var ip in ipList)
180182
{
181-
LogHelper.Info(LocalizationService.GetString(GameFrameX.Localization.Keys.StartUp.PrometheusMetricsEndpointEnabledInline, ip, Setting.HttpPort));
183+
LogHelper.Info(LocalizationService.GetString(Localization.Keys.StartUp.PrometheusMetricsEndpointEnabledInline, ip, Setting.HttpPort));
182184
}
183185
}
184186
else if (Setting.IsOpenTelemetry && Setting.IsOpenTelemetryMetrics && Setting.MetricsPort > 0)
185187
{
186-
LogHelper.Info(LocalizationService.GetString(GameFrameX.Localization.Keys.StartUp.PrometheusMetricsServiceOnStandalonePort, Setting.MetricsPort));
188+
LogHelper.Info(LocalizationService.GetString(Localization.Keys.StartUp.PrometheusMetricsServiceOnStandalonePort, Setting.MetricsPort));
187189
foreach (var ip in ipList)
188190
{
189-
LogHelper.Info(LocalizationService.GetString(GameFrameX.Localization.Keys.StartUp.PrometheusMetricsEndpointEnabled, ip, Setting.MetricsPort));
191+
LogHelper.Info(LocalizationService.GetString(Localization.Keys.StartUp.PrometheusMetricsEndpointEnabled, ip, Setting.MetricsPort));
190192
}
191193
}
192194

@@ -210,8 +212,8 @@ private async Task StartHttpServer(List<BaseHttpHandler> baseHandler, Func<strin
210212
// 开发模式,启用 Swagger
211213
route.WithOpenApi(operation =>
212214
{
213-
operation.Summary = LocalizationService.GetString(GameFrameX.Localization.Keys.StartUp.HttpServer.HandlePostRequest);
214-
operation.Description = LocalizationService.GetString(GameFrameX.Localization.Keys.StartUp.HttpServer.HandleGameClientPostRequest);
215+
operation.Summary = LocalizationService.GetString(Localization.Keys.StartUp.HttpServer.HandlePostRequest);
216+
operation.Description = LocalizationService.GetString(Localization.Keys.StartUp.HttpServer.HandleGameClientPostRequest);
215217
return operation;
216218
});
217219
}

GameFrameX.Utility/GameFrameX.Utility.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<PackageReference Include="GameFrameX.Foundation.Extensions" Version="1.7.1.11" />
4646
<PackageReference Include="GameFrameX.Foundation.Logger" Version="1.7.1.11" />
4747
<PackageReference Include="GameFrameX.Foundation.Utility" Version="1.7.1.11" />
48-
<PackageReference Include="Lib.Harmony" Version="2.4.1" />
48+
<PackageReference Include="Lib.Harmony" Version="2.4.2" />
4949
<PackageReference Include="SharpZipLib" Version="1.4.2" />
5050
<PackageReference Include="Tedd.RandomUtils" Version="1.0.6" />
5151
<PackageReference Include="Mapster" Version="7.4.0" />

0 commit comments

Comments
 (0)