using Dpz.Core.Entity.Base;
using Dpz.Core.Entity.Base.Indexes;

namespace Dpz.Core.Public.Entity;

public class Barrage : BaseEntity, IIndexedEntity<Barrage>
{
    /// <summary>
    /// 弹幕内容
    /// </summary>
    public required string Text { get; set; }

    /// <summary>
    /// 分组
    /// </summary>
    public required string Group { get; set; }

    /// <summary>
    /// 弹幕颜色
    /// </summary>
    public required string Color { get; set; }

    /// <summary>
    /// 0为滚动 1 为顶部 2为底部
    /// </summary>
    public int Position { get; set; }

    /// <summary>
    /// —弹幕文字大小。 0为小字 1为大字
    /// </summary>
    public int Size { get; set; }

    /// <summary>
    /// 弹幕所出现的时间。 单位为分秒(十分之一秒)
    /// </summary>
    public decimal Time { get; set; }

    [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
    public DateTime SendTime { get; set; }

    /// <inheritdoc />
    public static IReadOnlyList<EntityIndexDefinition> GetIndexDefinitions() =>
        [new() { Fields = [EntityIndexField.Ascending<Barrage>(x => x.Group)] }];
}
评论加载中...