forked from gongxuegit/tiku-backend.net
feat: add student profile endpoints
This commit is contained in:
81
Tiku.Application/Profile/ProfileModels.cs
Normal file
81
Tiku.Application/Profile/ProfileModels.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Tiku.Application.Profile;
|
||||
|
||||
public sealed record ProfileActor(Guid TenantId, Guid UserId);
|
||||
|
||||
public sealed record ProfileQuery(int? RecentLimit = null, int? Limit = null);
|
||||
|
||||
public sealed record UpdateProfileCommand(
|
||||
string? Name,
|
||||
string? AvatarPreset,
|
||||
Guid? RegionId,
|
||||
Guid? SelectedSchoolId,
|
||||
Guid? SelectedMajorId,
|
||||
JsonElement? Stats,
|
||||
JsonElement? Progress,
|
||||
JsonElement? ModuleSelections,
|
||||
JsonElement? RecentActivities);
|
||||
|
||||
public sealed record StudentProfileItem(
|
||||
Guid ProfileId,
|
||||
Guid UserId,
|
||||
string? Username,
|
||||
string? Phone,
|
||||
string? Email,
|
||||
string? Name,
|
||||
string AvatarPreset,
|
||||
string AvatarDisplayUrl,
|
||||
string PrimaryRole,
|
||||
int Score,
|
||||
Guid? RegionId,
|
||||
string? RegionName,
|
||||
Guid? SelectedSchoolId,
|
||||
string? SelectedSchoolName,
|
||||
Guid? SelectedMajorId,
|
||||
string? SelectedMajorName,
|
||||
int QuestionsAnsweredToday,
|
||||
int MasteredWordsCount,
|
||||
DateOnly? LastCheckInDate,
|
||||
JsonElement Stats,
|
||||
JsonElement Progress,
|
||||
JsonElement ModuleSelections,
|
||||
JsonElement RecentActivities,
|
||||
IReadOnlyCollection<RecentPracticeItem> RecentPractices,
|
||||
StudentMembershipItem Membership);
|
||||
|
||||
public sealed record RecentPracticeItem(
|
||||
Guid Id,
|
||||
string? PracticeType,
|
||||
string? TargetName,
|
||||
int Progress,
|
||||
DateTimeOffset? LastAccessAt,
|
||||
DateTimeOffset? LastPracticeAt);
|
||||
|
||||
public sealed record StudentMembershipItem(bool IsSvip, DateTimeOffset? ExpiresAt);
|
||||
|
||||
public sealed record ExamCountdownItem(
|
||||
Guid Id,
|
||||
string? LegacyId,
|
||||
Guid? RegionId,
|
||||
Guid? SchoolId,
|
||||
string ExamName,
|
||||
DateTimeOffset? ExamAt,
|
||||
string? ExamType,
|
||||
string? Description,
|
||||
JsonElement Metadata,
|
||||
int Order,
|
||||
bool IsActive,
|
||||
int? DaysLeft);
|
||||
|
||||
public sealed record ExamCountdownList(
|
||||
IReadOnlyCollection<ExamCountdownItem> Items,
|
||||
Guid? RegionId,
|
||||
Guid? SchoolId);
|
||||
|
||||
public interface IProfileService
|
||||
{
|
||||
Task<StudentProfileItem> GetMeAsync(ProfileActor actor, ProfileQuery query, CancellationToken cancellationToken = default);
|
||||
Task<StudentProfileItem> UpdateMeAsync(ProfileActor actor, UpdateProfileCommand command, CancellationToken cancellationToken = default);
|
||||
Task<ExamCountdownList> GetExamCountdownsAsync(ProfileActor actor, ProfileQuery query, CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user