forked from gongxuegit/tiku-backend.net
feat: add student video and profile experience
This commit is contained in:
@@ -470,6 +470,7 @@ public sealed class DirectImportDto
|
||||
public Guid? CategoryId { get; set; }
|
||||
public Guid? QuestionBankId { get; set; }
|
||||
public Guid? CollectionId { get; set; }
|
||||
public bool? Async { get; set; }
|
||||
public IReadOnlyCollection<JsonElement>? Items { get; set; }
|
||||
public IReadOnlyCollection<JsonElement>? Units { get; set; }
|
||||
public IReadOnlyCollection<JsonElement>? Words { get; set; }
|
||||
|
||||
@@ -22,6 +22,13 @@ public sealed class ProfileQueryDto
|
||||
public string? Category { get; set; }
|
||||
|
||||
public bool IncludeLocked { get; set; }
|
||||
|
||||
[StringLength(100)]
|
||||
public string? SourceType { get; set; }
|
||||
|
||||
public DateTimeOffset? From { get; set; }
|
||||
|
||||
public DateTimeOffset? To { get; set; }
|
||||
}
|
||||
|
||||
public sealed class UpdateProfileDto
|
||||
|
||||
74
Tiku.Api/Contracts/VideoDtos.cs
Normal file
74
Tiku.Api/Contracts/VideoDtos.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json;
|
||||
using Tiku.Application.Assets;
|
||||
|
||||
namespace Tiku.Api.Contracts;
|
||||
|
||||
public sealed class VideoSearchQueryDto
|
||||
{
|
||||
[StringLength(100)]
|
||||
public string? Keyword { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
[Range(1, 200)]
|
||||
public int? Limit { get; set; }
|
||||
|
||||
public VideoSearchQuery ToQuery() => new(Keyword, SubjectId, Limit);
|
||||
}
|
||||
|
||||
public sealed class VideoPlayDto
|
||||
{
|
||||
[Required]
|
||||
public Guid VideoId { get; set; }
|
||||
|
||||
public Guid? QuestionId { get; set; }
|
||||
|
||||
public VideoPlayCommand ToCommand() => new(VideoId, QuestionId);
|
||||
}
|
||||
|
||||
public sealed class VideoProgressDto
|
||||
{
|
||||
[Required]
|
||||
public Guid VideoId { get; set; }
|
||||
|
||||
public Guid? QuestionId { get; set; }
|
||||
|
||||
[Range(0, int.MaxValue)]
|
||||
public int PositionSeconds { get; set; }
|
||||
|
||||
[Range(0, int.MaxValue)]
|
||||
public int? DurationSeconds { get; set; }
|
||||
|
||||
[Range(0, int.MaxValue)]
|
||||
public int? WatchedSeconds { get; set; }
|
||||
|
||||
public bool? IsCompleted { get; set; }
|
||||
|
||||
public JsonElement Metadata { get; set; } = JsonSerializer.SerializeToElement(new { });
|
||||
|
||||
public VideoProgressCommand ToCommand()
|
||||
{
|
||||
return new VideoProgressCommand(
|
||||
VideoId,
|
||||
QuestionId,
|
||||
PositionSeconds,
|
||||
DurationSeconds,
|
||||
WatchedSeconds,
|
||||
IsCompleted,
|
||||
Metadata);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class QuestionVideoQueryDto
|
||||
{
|
||||
public Guid? QuestionId { get; set; }
|
||||
|
||||
[MaxLength(100)]
|
||||
public IReadOnlyCollection<Guid>? QuestionIds { get; set; }
|
||||
|
||||
[Range(1, 500)]
|
||||
public int? Limit { get; set; }
|
||||
|
||||
public QuestionVideoQuery ToQuery() => new(QuestionId, QuestionIds, Limit);
|
||||
}
|
||||
Reference in New Issue
Block a user