Skip to content

Commit 2e91536

Browse files
committed
docs(database): 添加双语文档注释
为 GameFrameX.DataBase 模块的所有公共 API 添加标准的双语文档注释: - 类和接口添加 remarks 英文翻译 - 参数和返回值使用中英双语格式 - 属性添加 value 标签说明 涉及文件: - GameDB.cs: 游戏数据库静态工具类 - BaseCacheState.cs: 缓存数据对象基类 - IDatabaseService.cs: 数据库服务接口 - ICacheState.cs: 缓存数据对象接口 - DbOptions.cs: 数据库选项配置 - ISafeCreate.cs: 创建标记接口 - StateHash.cs: 状态哈希计算处理器
1 parent 934117d commit 2e91536

7 files changed

Lines changed: 526 additions & 225 deletions

File tree

GameFrameX.DataBase/Abstractions/DbOptions.cs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,46 @@
3333
namespace GameFrameX.DataBase.Abstractions;
3434

3535
/// <summary>
36-
/// 数据库选项
36+
/// 数据库选项
3737
/// </summary>
38+
/// <remarks>
39+
/// Database configuration options.
40+
/// </remarks>
3841
public sealed record DbOptions
3942
{
4043
/// <summary>
41-
/// 数据库类型
44+
/// 数据库类型
4245
/// </summary>
46+
/// <remarks>
47+
/// Database type.
48+
/// </remarks>
49+
/// <value>数据库类型 / Database type</value>
4350
public string Type { get; init; }
4451

4552
/// <summary>
46-
/// 连接字符串
53+
/// 连接字符串
4754
/// </summary>
55+
/// <remarks>
56+
/// Connection string.
57+
/// </remarks>
58+
/// <value>连接字符串 / Connection string</value>
4859
public string ConnectionString { get; init; }
4960

5061
/// <summary>
51-
/// 数据库名称
62+
/// 数据库名称
5263
/// </summary>
64+
/// <remarks>
65+
/// Database name.
66+
/// </remarks>
67+
/// <value>数据库名称 / Database name</value>
5368
public string Name { get; init; }
5469

5570
/// <summary>
56-
/// 是否使用时区时间记录
71+
/// 是否使用时区时间记录
5772
/// </summary>
73+
/// <remarks>
74+
/// Whether to use time zone for time recording.
75+
/// </remarks>
76+
/// <value>是否使用时区时间记录 / Whether to use time zone for time recording</value>
5877
public bool IsUseTimeZone { get; init; } = true;
5978
}

GameFrameX.DataBase/Abstractions/ICacheState.cs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,54 @@
3434
namespace GameFrameX.DataBase.Abstractions;
3535

3636
/// <summary>
37-
/// 缓存数据对象接口
37+
/// 缓存数据对象接口
3838
/// </summary>
39+
/// <remarks>
40+
/// Cache data object interface.
41+
/// </remarks>
3942
public interface ICacheState : ISafeDeletedFilter, ISafeCreatedFilter, ISafeUpdateFilter
4043
{
4144
/// <summary>
42-
/// 唯一ID
45+
/// 唯一ID
4346
/// </summary>
47+
/// <remarks>
48+
/// Unique identifier.
49+
/// </remarks>
50+
/// <value>唯一ID / Unique ID</value>
4451
long Id { get; set; }
4552

4653
/// <summary>
47-
/// 是否修改
54+
/// 是否修改
4855
/// </summary>
56+
/// <remarks>
57+
/// Whether the object has been modified.
58+
/// </remarks>
59+
/// <returns>如果已修改则返回 <c>true</c>;否则返回 <c>false</c> / <c>true</c> if modified; otherwise <c>false</c></returns>
4960
bool IsModify();
5061

5162
/// <summary>
5263
/// 用于在对象从数据库加载后进行一些特定的处理,如初始化数据或设置状态。
5364
/// </summary>
54-
/// <param name="isNew">是否是新对象</param>
65+
/// <remarks>
66+
/// Used to perform specific processing after the object is loaded from the database, such as initializing data or setting state.
67+
/// </remarks>
68+
/// <param name="isNew">是否是新对象 / Whether it is a new object</param>
5569
void LoadFromDbPostHandler(bool isNew);
5670

5771
/// <summary>
5872
/// 在对象保存到数据库后调用的方法,可以进行一些后续处理。
5973
/// </summary>
74+
/// <remarks>
75+
/// Method called after the object is saved to the database, can perform some post-processing.
76+
/// </remarks>
6077
void SaveToDbPostHandler();
6178

6279
/// <summary>
63-
/// 将对象序列化转换为字节数组
80+
/// 将对象序列化转换为字节数组
6481
/// </summary>
65-
/// <returns></returns>
82+
/// <remarks>
83+
/// Serialize the object to a byte array.
84+
/// </remarks>
85+
/// <returns>序列化后的字节数组 / Serialized byte array</returns>
6686
byte[] ToBytes();
6787
}

0 commit comments

Comments
 (0)