forked from gongxuegit/tiku-backend.net
feat: add student profile endpoints
This commit is contained in:
45
Tiku.Api/Contracts/ProfileDtos.cs
Normal file
45
Tiku.Api/Contracts/ProfileDtos.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json;
|
||||
using Tiku.Application.Profile;
|
||||
|
||||
namespace Tiku.Api.Contracts;
|
||||
|
||||
public sealed class ProfileQueryDto
|
||||
{
|
||||
[Range(1, 50)]
|
||||
public int? RecentLimit { get; set; }
|
||||
|
||||
[Range(1, 20)]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
|
||||
public sealed class UpdateProfileDto
|
||||
{
|
||||
[StringLength(100)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[StringLength(32)]
|
||||
public string? AvatarPreset { get; set; }
|
||||
|
||||
public Guid? RegionId { get; set; }
|
||||
public Guid? SelectedSchoolId { get; set; }
|
||||
public Guid? SelectedMajorId { get; set; }
|
||||
public JsonElement? Stats { get; set; }
|
||||
public JsonElement? Progress { get; set; }
|
||||
public JsonElement? ModuleSelections { get; set; }
|
||||
public JsonElement? RecentActivities { get; set; }
|
||||
|
||||
public UpdateProfileCommand ToCommand()
|
||||
{
|
||||
return new UpdateProfileCommand(
|
||||
Name,
|
||||
AvatarPreset,
|
||||
RegionId,
|
||||
SelectedSchoolId,
|
||||
SelectedMajorId,
|
||||
Stats,
|
||||
Progress,
|
||||
ModuleSelections,
|
||||
RecentActivities);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user