feat(picture): update Username property to return default value for null or empty usernames

This commit is contained in:
shiyu
2025-06-13 15:18:39 +08:00
parent 28ca2387f7
commit 17842cfdf7

View File

@@ -15,7 +15,12 @@ public record PictureResponse
public DateTime? TakenAt { get; set; }
public ExifInfo? ExifInfo { get; set; }
public int? UserId { get; set; }
public string? Username { get; set; }
private string? _username;
public string? Username
{
get => string.IsNullOrEmpty(_username) ? "匿名" : _username;
set => _username = value;
}
public bool IsFavorited { get; set; }
public int FavoriteCount { get; set; }
public int? AlbumId { get; set; }