Include account info for personal publishers

This commit is contained in:
2025-05-27 22:49:33 +08:00
parent fcaeb9afbe
commit acece9cbce
5 changed files with 3430 additions and 3 deletions

View File

@ -22,9 +22,9 @@ public class Publisher : ModelBase
[MaxLength(256)] public string Nick { get; set; } = string.Empty;
[MaxLength(4096)] public string? Bio { get; set; }
public string? PictureId { get; set; }
[MaxLength(32)] public string? PictureId { get; set; }
public CloudFile? Picture { get; set; }
public string? BackgroundId { get; set; }
[MaxLength(32)] public string? BackgroundId { get; set; }
public CloudFile? Background { get; set; }
[JsonIgnore] public ICollection<Post.Post> Posts { get; set; } = new List<Post.Post>();
@ -35,7 +35,7 @@ public class Publisher : ModelBase
public ICollection<PublisherSubscription> Subscriptions { get; set; } = new List<PublisherSubscription>();
public Guid? AccountId { get; set; }
[JsonIgnore] public Account.Account? Account { get; set; }
public Account.Account? Account { get; set; }
public Guid? RealmId { get; set; }
[JsonIgnore] public Realm.Realm? Realm { get; set; }
}

View File

@ -20,6 +20,7 @@ public class PublisherController(AppDatabase db, PublisherService ps, FileServic
public async Task<ActionResult<Publisher>> GetPublisher(string name)
{
var publisher = await db.Publishers
.Include(e => e.Account)
.Where(e => e.Name == name)
.FirstOrDefaultAsync();
if (publisher is null) return NotFound();