forked from gongxuegit/tiku-backend.net
feat: enforce tenant isolation and shared question bank
This commit is contained in:
37
Tiku.Domain/Catalog/TaxonomyEntities.cs
Normal file
37
Tiku.Domain/Catalog/TaxonomyEntities.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Text.Json;
|
||||
using Tiku.Domain.Common;
|
||||
|
||||
namespace Tiku.Domain.Catalog;
|
||||
|
||||
public sealed class TaxonomyNode : AuditableTenantEntity
|
||||
{
|
||||
public Guid? ParentOwnerTenantId { get; set; }
|
||||
public Guid? ParentId { get; set; }
|
||||
public TaxonomyNodeType NodeType { get; set; } = TaxonomyNodeType.KnowledgePoint;
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Path { get; set; }
|
||||
public int Depth { get; set; }
|
||||
public int SortOrder { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
public JsonElement Metadata { get; set; } = JsonDefaults.Object();
|
||||
}
|
||||
|
||||
public sealed class QuestionTaxonomyAssignment : Entity, ITenantOwned
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public Guid QuestionId { get; set; }
|
||||
public Guid TaxonomyOwnerTenantId { get; set; }
|
||||
public Guid TaxonomyNodeId { get; set; }
|
||||
public bool IsPrimary { get; set; }
|
||||
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
|
||||
}
|
||||
|
||||
public enum TaxonomyNodeType
|
||||
{
|
||||
Subject,
|
||||
Chapter,
|
||||
KnowledgePoint,
|
||||
Paper,
|
||||
Custom
|
||||
}
|
||||
Reference in New Issue
Block a user