get all accounts endpoint added

This commit is contained in:
2024-11-06 16:29:24 +01:00
Unverified
parent d6fda7dbb8
commit 57fd4ba7a1
9 changed files with 113 additions and 1 deletions

View File

@@ -1,13 +1,28 @@
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using WatchIt.Common.Model.Genders;
using WatchIt.Common.Query;
namespace WatchIt.Common.Model.Accounts;
public class AccountResponse : Account
public class AccountResponse : Account, IQueryOrderable<AccountResponse>
{
#region PROPERTIES
[JsonIgnore]
public static IDictionary<string, Func<AccountResponse, IComparable>> OrderableProperties { get; } = new Dictionary<string, Func<AccountResponse, IComparable>>
{
{ "id", x => x.Id },
{ "username", x => x.Username },
{ "email", x => x.Email },
{ "description", x => x.Description },
{ "gender", x => x.Gender.Name },
{ "last_active", x => x.LastActive },
{ "creation_date", x => x.CreationDate },
{ "is_admin", x => x.IsAdmin }
};
[JsonPropertyName("id")]
public required long Id { get; set; }