forked from xiongyuxing/tiku-backend.net
feat: add study content readonly endpoints
This commit is contained in:
26
Tiku.Application/StudyContent/IStudyContentQueryService.cs
Normal file
26
Tiku.Application/StudyContent/IStudyContentQueryService.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Tiku.Application.Catalog;
|
||||
|
||||
namespace Tiku.Application.StudyContent;
|
||||
|
||||
public interface IStudyContentQueryService
|
||||
{
|
||||
Task<CatalogList<VocabularyUnitCatalogItem>> GetVocabularyUnitsAsync(
|
||||
StudyContentFilter filter,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<CatalogList<VocabularyWordCatalogItem>> GetVocabularyWordsAsync(
|
||||
StudyContentFilter filter,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<CatalogList<HandbookSubjectCatalogItem>> GetHandbookSubjectsAsync(
|
||||
StudyContentFilter filter,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<CatalogList<HandbookChapterCatalogItem>> GetHandbookChaptersAsync(
|
||||
StudyContentFilter filter,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<CatalogList<HandbookEntryCatalogItem>> GetHandbookEntriesAsync(
|
||||
StudyContentFilter filter,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
84
Tiku.Application/StudyContent/StudyContentQueryModels.cs
Normal file
84
Tiku.Application/StudyContent/StudyContentQueryModels.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System.Text.Json;
|
||||
using Tiku.Domain.Content;
|
||||
|
||||
namespace Tiku.Application.StudyContent;
|
||||
|
||||
public sealed record StudyContentFilter(
|
||||
Guid TenantId,
|
||||
Guid? RegionId = null,
|
||||
Guid? UnitId = null,
|
||||
Guid? SubjectId = null,
|
||||
Guid? ChapterId = null,
|
||||
Guid? EntryId = null,
|
||||
Guid? ContentNodeId = null,
|
||||
string? Keyword = null,
|
||||
bool IncludeContent = false,
|
||||
int? Limit = null);
|
||||
|
||||
public sealed record VocabularyUnitCatalogItem(
|
||||
Guid Id,
|
||||
string? LegacyId,
|
||||
Guid? RegionId,
|
||||
Guid? EntryId,
|
||||
Guid? ContentNodeId,
|
||||
string Name,
|
||||
string? Description,
|
||||
int? WordCount,
|
||||
int Order,
|
||||
JsonElement Metadata);
|
||||
|
||||
public sealed record VocabularyWordCatalogItem(
|
||||
Guid Id,
|
||||
string? LegacyId,
|
||||
Guid? UnitId,
|
||||
Guid? EntryId,
|
||||
Guid? ContentNodeId,
|
||||
string Word,
|
||||
string? Phonetic,
|
||||
string? Meaning,
|
||||
string? Example,
|
||||
string? ExampleTranslation,
|
||||
int? Difficulty,
|
||||
JsonElement Tags,
|
||||
int Order,
|
||||
JsonElement Metadata);
|
||||
|
||||
public sealed record HandbookSubjectCatalogItem(
|
||||
Guid Id,
|
||||
string? LegacyId,
|
||||
Guid? RegionId,
|
||||
Guid? SchoolId,
|
||||
Guid? MajorId,
|
||||
Guid? EntryId,
|
||||
Guid? ContentNodeId,
|
||||
string Name,
|
||||
HandbookSubjectType? Type,
|
||||
string? Icon,
|
||||
string? Color,
|
||||
string? Description,
|
||||
int Order,
|
||||
JsonElement Metadata);
|
||||
|
||||
public sealed record HandbookChapterCatalogItem(
|
||||
Guid Id,
|
||||
string? LegacyId,
|
||||
Guid? SubjectId,
|
||||
Guid? EntryId,
|
||||
Guid? ContentNodeId,
|
||||
string Name,
|
||||
string? Description,
|
||||
int Order,
|
||||
JsonElement Metadata);
|
||||
|
||||
public sealed record HandbookEntryCatalogItem(
|
||||
Guid Id,
|
||||
string? LegacyId,
|
||||
Guid? ChapterId,
|
||||
Guid? EntryId,
|
||||
Guid? ContentNodeId,
|
||||
string Title,
|
||||
string? Summary,
|
||||
string? Content,
|
||||
JsonElement Tags,
|
||||
int Order,
|
||||
JsonElement Metadata);
|
||||
Reference in New Issue
Block a user