using MediatR; using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Domain.Tenants.Enums; namespace TakeoutSaaS.Application.App.Tenants.Commands; /// /// 创建租户公告命令。 /// public sealed record CreateTenantAnnouncementCommand : IRequest { /// /// 租户 ID(雪花算法)。 /// public long TenantId { get; init; } /// /// 公告标题。 /// [Required] [StringLength(128)] public string Title { get; init; } = string.Empty; /// /// 公告正文内容。 /// [Required] public string Content { get; init; } = string.Empty; /// /// 公告类型。 /// public TenantAnnouncementType AnnouncementType { get; init; } = TenantAnnouncementType.System; /// /// 优先级,数值越大越靠前。 /// public int Priority { get; init; } = 0; /// /// 生效开始时间(UTC)。 /// public DateTime EffectiveFrom { get; init; } = DateTime.UtcNow; /// /// 生效结束时间(UTC),为空则长期有效。 /// public DateTime? EffectiveTo { get; init; } /// /// 发布者范围。 /// public PublisherScope PublisherScope { get; init; } = PublisherScope.Tenant; /// /// 目标受众类型。 /// [Required] [MaxLength(64)] public string TargetType { get; init; } = string.Empty; /// /// 目标受众参数(JSON)。 /// public string? TargetParameters { get; init; } }