Couple more slight tweaks :)

This commit is contained in:
Ske
2020-08-21 17:08:49 +02:00
parent 1bb5d203df
commit 10c01da39b
8 changed files with 37 additions and 22 deletions

View File

@@ -34,10 +34,7 @@ namespace PluralKit.Core
public static Task<PKGroup?> QueryGroupByHid(this IPKConnection conn, string hid) =>
conn.QueryFirstOrDefaultAsync<PKGroup?>("select * from groups where hid = @hid", new {hid = hid.ToLowerInvariant()});
public static Task<IEnumerable<PKGroup>> QueryGroupsInSystem(this IPKConnection conn, SystemId system) =>
conn.QueryAsync<PKGroup>("select * from groups where system = @System", new {System = system});
public static Task<int> QueryGroupMemberCount(this IPKConnection conn, GroupId id,
PrivacyLevel? privacyFilter = null)
{

View File

@@ -5,20 +5,20 @@ namespace PluralKit.Core
{
public class PKGroup
{
public GroupId Id { get; }
public string Hid { get; } = null!;
public SystemId System { get; }
public GroupId Id { get; private set; }
public string Hid { get; private set; } = null!;
public SystemId System { get; private set; }
public string Name { get; } = null!;
public string? DisplayName { get; }
public string? Description { get; }
public string? Icon { get; }
public string Name { get; private set; } = null!;
public string? DisplayName { get; private set; }
public string? Description { get; private set; }
public string? Icon { get; private set; }
public PrivacyLevel DescriptionPrivacy { get; }
public PrivacyLevel IconPrivacy { get; }
public PrivacyLevel ListPrivacy { get; }
public PrivacyLevel Visibility { get; }
public PrivacyLevel DescriptionPrivacy { get; private set; }
public PrivacyLevel IconPrivacy { get; private set; }
public PrivacyLevel ListPrivacy { get; private set; }
public PrivacyLevel Visibility { get; private set; }
public Instant Created { get; }
public Instant Created { get; private set; }
}
}