Space info now carries avatar_version instead of the inlined thumbnail; the worker fetches the thumbnail once per version. Legacy base64 rows are migrated to files on startup, and the daily backup uploads avatar files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> [CI]
19 lines
1.0 KiB
C#
19 lines
1.0 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace WebDrop.Core;
|
|
|
|
public sealed class AccountProfile
|
|
{
|
|
[JsonPropertyName("username")] public required string Username { get; init; }
|
|
[JsonPropertyName("displayName")] public required string DisplayName { get; init; }
|
|
/// <summary>头像文件名(服务端存的是磁盘文件)。资料列表、空间成员等接口不再内联头像(动图可能有几 MB),只告诉有没有,头像另用 /accounts/users/{用户名}/avatar 取</summary>
|
|
[JsonPropertyName("avatar")] public string? Avatar { get; init; }
|
|
[JsonPropertyName("hasAvatar")] public bool HasAvatar { get; init; }
|
|
[JsonPropertyName("modifiedAt")] public required long ModifiedAt { get; init; }
|
|
|
|
/// <summary>有损的小图(列表、聊天里默认分发);没有单独上传时用原图。不随 JSON 输出</summary>
|
|
[JsonIgnore] public string? AvatarThumb { get; init; }
|
|
|
|
public AccountProfile WithoutAvatar() => new() { Username = Username, DisplayName = DisplayName, HasAvatar = HasAvatar, ModifiedAt = ModifiedAt };
|
|
}
|