mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 14:57:54 +00:00
Migrate to type-safe model ID structs
This commit is contained in:
parent
e5ac5edc35
commit
b9cbd241de
21 changed files with 167 additions and 41 deletions
|
|
@ -9,10 +9,10 @@ namespace PluralKit.Core
|
|||
{
|
||||
public static class DatabaseViewsExt
|
||||
{
|
||||
public static Task<IEnumerable<SystemFronter>> QueryCurrentFronters(this IPKConnection conn, int system) =>
|
||||
public static Task<IEnumerable<SystemFronter>> QueryCurrentFronters(this IPKConnection conn, SystemId system) =>
|
||||
conn.QueryAsync<SystemFronter>("select * from system_fronters where system = @system", new {system});
|
||||
|
||||
public static Task<IEnumerable<ListedMember>> QueryMemberList(this IPKConnection conn, int system, PrivacyLevel? privacyFilter = null, string? filter = null, bool includeDescriptionInNameFilter = false)
|
||||
public static Task<IEnumerable<ListedMember>> QueryMemberList(this IPKConnection conn, SystemId system, PrivacyLevel? privacyFilter = null, string? filter = null, bool includeDescriptionInNameFilter = false)
|
||||
{
|
||||
StringBuilder query = new StringBuilder("select * from member_list where system = @system");
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ namespace PluralKit.Core
|
|||
{
|
||||
public class SystemFronter
|
||||
{
|
||||
public int SystemId { get; }
|
||||
public int SwitchId { get; }
|
||||
public SystemId SystemId { get; }
|
||||
public SwitchId SwitchId { get; }
|
||||
public Instant SwitchTimestamp { get; }
|
||||
public int MemberId { get; }
|
||||
public MemberId MemberId { get; }
|
||||
public string MemberHid { get; }
|
||||
public string MemberName { get; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue