Skip to content

Commit 00d18d1

Browse files
committed
refactor(数据库): 清理无用引用并优化本地化字符串引用
移除MongoDbService中无用的GameFrameX.Utility引用 统一本地化字符串引用路径,移除冗余命名空间前缀 更新ISafeDelete接口添加必要的引用 优化BaseCacheState中LoadFromDbPostHandler方法调用
1 parent 8f18d47 commit 00d18d1

File tree

6 files changed

+37
-37
lines changed

6 files changed

+37
-37
lines changed

GameFrameX.DataBase.Mongo/MongoDbService.Delete.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
using System.Linq.Expressions;
3333
using GameFrameX.Foundation.Utility;
34-
using GameFrameX.Utility;
3534

3635
namespace GameFrameX.DataBase.Mongo;
3736

GameFrameX.DataBase.Mongo/MongoDbService.Update.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
// ==========================================================================================
3131

3232
using GameFrameX.Foundation.Utility;
33-
using GameFrameX.Utility;
3433

3534
namespace GameFrameX.DataBase.Mongo;
3635

GameFrameX.DataBase.Mongo/MongoDbService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ public async Task<bool> Open(DbOptions dbOptions)
6969
await DB.InitAsync(dbOptions.Name, settings);
7070
_mongoDbContext = new MongoDbContext();
7171
CurrentDatabase = DB.Database(dbOptions.Name);
72-
LogHelper.Info(LocalizationService.GetString(GameFrameX.Localization.Keys.Database.MongoDbInitializedSuccessfully, dbOptions.ConnectionString, dbOptions.Name));
72+
LogHelper.Info(LocalizationService.GetString(Localization.Keys.Database.MongoDbInitializedSuccessfully, dbOptions.ConnectionString, dbOptions.Name));
7373
return true;
7474
}
7575
catch (Exception exception)
7676
{
7777
LogHelper.Fatal(exception);
78-
string message = LocalizationService.GetString(GameFrameX.Localization.Keys.Database.MongoDbInitializationFailed, dbOptions.ConnectionString, dbOptions.Name);
78+
string message = LocalizationService.GetString(Localization.Keys.Database.MongoDbInitializationFailed, dbOptions.ConnectionString, dbOptions.Name);
7979
Console.ForegroundColor = ConsoleColor.Red;
8080
Console.WriteLine(message);
8181
Console.ResetColor();

GameFrameX.DataBase/Abstractions/ISafeDelete.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
// Official Documentation: https://gameframex.doc.alianblank.com/
3030
// ==========================================================================================
3131

32+
using GameFrameX.Foundation.Orm.Entity.Filter;
33+
3234
namespace GameFrameX.DataBase.Abstractions;
3335

3436
/// <summary>

GameFrameX.DataBase/BaseCacheState.cs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
// ==========================================================================================
2-
// GameFrameX 组织及其衍生项目的版权、商标、专利及其他相关权利
3-
// GameFrameX organization and its derivative projects' copyrights, trademarks, patents, and related rights
4-
// 均受中华人民共和国及相关国际法律法规保护。
5-
// are protected by the laws of the People's Republic of China and relevant international regulations.
6-
//
7-
// 使用本项目须严格遵守相应法律法规及开源许可证之规定。
8-
// Usage of this project must strictly comply with applicable laws, regulations, and open-source licenses.
9-
//
10-
// 本项目采用 MIT 许可证与 Apache License 2.0 双许可证分发,
11-
// This project is dual-licensed under the MIT License and Apache License 2.0,
12-
// 完整许可证文本请参见源代码根目录下的 LICENSE 文件。
13-
// please refer to the LICENSE file in the root directory of the source code for the full license text.
14-
//
15-
// 禁止利用本项目实施任何危害国家安全、破坏社会秩序、
16-
// It is prohibited to use this project to engage in any activities that endanger national security, disrupt social order,
17-
// 侵犯他人合法权益等法律法规所禁止的行为!
18-
// or infringe upon the legitimate rights and interests of others, as prohibited by laws and regulations!
19-
// 因基于本项目二次开发所产生的一切法律纠纷与责任,
20-
// Any legal disputes and liabilities arising from secondary development based on this project
21-
// 本项目组织与贡献者概不承担。
22-
// shall be borne solely by the developer; the project organization and contributors assume no responsibility.
23-
//
24-
// GitHub 仓库:https://github.com/GameFrameX
25-
// GitHub Repository: https://github.com/GameFrameX
26-
// Gitee 仓库:https://gitee.com/GameFrameX
27-
// Gitee Repository: https://gitee.com/GameFrameX
28-
// 官方文档:https://gameframex.doc.alianblank.com/
29-
// Official Documentation: https://gameframex.doc.alianblank.com/
30-
// ==========================================================================================
31-
1+
// ==========================================================================================
2+
// GameFrameX 组织及其衍生项目的版权、商标、专利及其他相关权利
3+
// GameFrameX organization and its derivative projects' copyrights, trademarks, patents, and related rights
4+
// 均受中华人民共和国及相关国际法律法规保护。
5+
// are protected by the laws of the People's Republic of China and relevant international regulations.
6+
//
7+
// 使用本项目须严格遵守相应法律法规及开源许可证之规定。
8+
// Usage of this project must strictly comply with applicable laws, regulations, and open-source licenses.
9+
//
10+
// 本项目采用 MIT 许可证与 Apache License 2.0 双许可证分发,
11+
// This project is dual-licensed under the MIT License and Apache License 2.0,
12+
// 完整许可证文本请参见源代码根目录下的 LICENSE 文件。
13+
// please refer to the LICENSE file in the root directory of the source code for the full license text.
14+
//
15+
// 禁止利用本项目实施任何危害国家安全、破坏社会秩序、
16+
// It is prohibited to use this project to engage in any activities that endanger national security, disrupt social order,
17+
// 侵犯他人合法权益等法律法规所禁止的行为!
18+
// or infringe upon the legitimate rights and interests of others, as prohibited by laws and regulations!
19+
// 因基于本项目二次开发所产生的一切法律纠纷与责任,
20+
// Any legal disputes and liabilities arising from secondary development based on this project
21+
// 本项目组织与贡献者概不承担。
22+
// shall be borne solely by the developer; the project organization and contributors assume no responsibility.
23+
//
24+
// GitHub 仓库:https://github.com/GameFrameX
25+
// GitHub Repository: https://github.com/GameFrameX
26+
// Gitee 仓库:https://gitee.com/GameFrameX
27+
// Gitee Repository: https://gitee.com/GameFrameX
28+
// 官方文档:https://gameframex.doc.alianblank.com/
29+
// Official Documentation: https://gameframex.doc.alianblank.com/
30+
// ==========================================================================================
31+
3232
using GameFrameX.DataBase.Abstractions;
3333
using GameFrameX.DataBase.Storage;
3434
using GameFrameX.Foundation.Json;
@@ -165,7 +165,7 @@ private void CheckStateHash()
165165
return;
166166
}
167167

168-
LoadFromDbPostHandler(false);
168+
LoadFromDbPostHandler();
169169
}
170170

171171
/// <summary>

GameFrameX.DataBase/Storage/StateHash.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void SaveToDbPostHandler()
8080
{
8181
if (CacheHash.high64 == ToSaveHash.high64 && CacheHash.low64 == ToSaveHash.low64)
8282
{
83-
LogHelper.Warning(LocalizationService.GetString(GameFrameX.Localization.Keys.Storage.CacheHashEquals, State.GetType().FullName));
83+
LogHelper.Warning(LocalizationService.GetString(Localization.Keys.Storage.CacheHashEquals, State.GetType().FullName));
8484
}
8585

8686
CacheHash = ToSaveHash;

0 commit comments

Comments
 (0)