Files
tiku-backend.net/Tiku.Api/Contracts/ProfileDtos.cs
2026-07-26 18:36:28 +08:00

46 lines
1.1 KiB
C#

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);
}
}