Files
hjha-server/ObjectModel/DBEntity/DBEntityAttribute.cs
xiaoou e9616125ce feat: initial commit - HJHA game server full source
6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) +
game logic (GameFix/GameDAL/ServerData) +
network layer (NetWorkMessage) +
data layer (ObjectModel) +
utilities (MrWu/Core/Config/CloudAPI/dll) +
adapters (zyxAdapter/base)

.NET 8.0 C# solution, 16 projects, 958 source files
2026-07-07 12:02:15 +08:00

71 lines
2.0 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
namespace DBEntitys
{
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class DBFieldNameAttribute : Attribute
{
/// <summary>
/// 别名
/// </summary>
public string FieldName { get; }
/// <summary>
/// 构造函数
/// </summary>
public DBFieldNameAttribute(string fieldName = "")
{
FieldName = fieldName;
}
}
/// <summary>
/// 标记实体属性为时间区间字段
/// 使用此注解的属性在查询时会自动使用 WhereBetween
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class DateRangeFieldAttribute : Attribute
{
/// <summary>
/// 是否为时间区间字段
/// </summary>
public bool IsDateRange { get; }
/// <summary>
/// 构造函数
/// </summary>
/// <param name="isDateRange">默认为true标记为时间区间字段</param>
public DateRangeFieldAttribute(bool isDateRange = true)
{
IsDateRange = isDateRange;
}
}
/// <summary>
/// 标记实体属性在查询时忽略此字段
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class QueryIgnoreAttribute : Attribute
{
}
/// <summary>
/// 标记实体属性使用 LIKE 查询
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class LikeFieldAttribute : Attribute
{
}
/// <summary>
/// 标记实体属性使用 IN 查询(字段值为逗号分隔的多个值)
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class InFieldAttribute : Attribute
{
/// <summary>
/// 分隔符,默认为逗号
/// </summary>
public char Separator { get; set; } = ',';
}
}