using System.ComponentModel.DataAnnotations;
using Tiku.Application.StudyContent;
namespace Tiku.Api.Contracts;
///
/// Study内容查询参数。
///
public sealed class StudyContentQueryDto
{
///
/// 租户编码。
///
[StringLength(100)]
public string? TenantCode { get; set; }
///
/// 地区 ID。
///
public Guid? RegionId { get; set; }
///
/// 单元 ID。
///
public Guid? UnitId { get; set; }
///
/// 科目 ID。
///
public Guid? SubjectId { get; set; }
///
/// 章节 ID。
///
public Guid? ChapterId { get; set; }
///
/// 内容入口 ID。
///
public Guid? EntryId { get; set; }
///
/// 内容节点 ID。
///
public Guid? ContentNodeId { get; set; }
///
/// 关键字。
///
[StringLength(100)]
public string? Keyword { get; set; }
///
/// 是否包含正文内容。
///
public bool IncludeContent { get; set; }
///
/// 返回数量上限。
///
[Range(1, 2000)]
public int? Limit { get; set; }
public StudyContentFilter ToFilter(Guid tenantId)
{
return new StudyContentFilter(
tenantId,
RegionId,
UnitId,
SubjectId,
ChapterId,
EntryId,
ContentNodeId,
Keyword,
IncludeContent,
Limit);
}
}