using System.ComponentModel.DataAnnotations;
using Tiku.Application.Assets;
namespace Tiku.Api.Contracts;
///
/// 资产查询参数。
///
public sealed class AssetQueryDto
{
///
/// 租户编码。
///
[StringLength(100)]
public string? TenantCode { get; set; }
///
/// 地区 ID。
///
public Guid? RegionId { get; set; }
///
/// 科目 ID。
///
public Guid? SubjectId { get; set; }
///
/// 分类 ID。
///
public Guid? CategoryId { get; set; }
///
/// 内容节点 ID。
///
public Guid? ContentNodeId { get; set; }
///
/// 题目 ID。
///
public Guid? QuestionId { get; set; }
///
/// 资产 ID。
///
public Guid? AssetId { get; set; }
///
/// 资产类型。
///
[StringLength(50)]
public string? AssetType { get; set; }
///
/// 分类。
///
[StringLength(100)]
public string? Category { get; set; }
///
/// 资产键。
///
[StringLength(200)]
public string? AssetKey { get; set; }
///
/// 关键字。
///
[StringLength(100)]
public string? Keyword { get; set; }
///
/// 是否包含锁定资源。
///
public bool IncludeLocked { get; set; }
///
/// 是否包含停用数据。
///
public bool IncludeInactive { get; set; }
///
/// 返回数量上限。
///
[Range(1, 500)]
public int? Limit { get; set; }
public AssetFilter ToFilter(Guid tenantId)
{
return new AssetFilter(
tenantId,
RegionId,
SubjectId,
CategoryId,
ContentNodeId,
QuestionId,
AssetId,
AssetType,
Category,
AssetKey,
Keyword,
IncludeLocked,
IncludeInactive,
Limit);
}
}