mirror of
https://github.com/CannedNet/CannedNet.git
synced 2026-10-26 15:38:57 -07:00
current src
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace CannedNet;
|
||||
|
||||
public class Account
|
||||
{
|
||||
[JsonPropertyName("accountId")] public int? AccountId { get; set; }
|
||||
[JsonPropertyName("profileImage")] public string? ProfileImage { get; set; }
|
||||
[JsonPropertyName("isJunior")] public bool IsJunior { get; set; }
|
||||
[JsonPropertyName("platforms")] public int? Platforms { get; set; }
|
||||
[JsonPropertyName("personalPronouns")] public int? PersonalPronouns { get; set; }
|
||||
[JsonPropertyName("identityFlags")] public int? IdentityFlags { get; set; }
|
||||
[JsonPropertyName("username")] public string? Username { get; set; }
|
||||
[JsonPropertyName("displayName")] public string? DisplayName { get; set; }
|
||||
[JsonPropertyName("createdAt")] public DateTime CreatedAt { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace CannedNet;
|
||||
|
||||
public class CachedLogin
|
||||
{
|
||||
[JsonIgnore]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("accountId")]
|
||||
public int AccountId { get; set; }
|
||||
|
||||
[JsonPropertyName("platform")]
|
||||
public PlatformType Platform { get; set; }
|
||||
|
||||
[JsonPropertyName("platformId")]
|
||||
public string PlatformID { get; set; }
|
||||
|
||||
[JsonPropertyName("lastLoginTime")]
|
||||
public DateTime LastLoginTime { get; set; }
|
||||
|
||||
[JsonPropertyName("requirePassword")]
|
||||
public bool RequirePassword { get; set; } = false;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace CannedNet;
|
||||
|
||||
public class RecNetResultWithValue<T> : RecNetResult
|
||||
{
|
||||
[JsonPropertyName("value")] public required T? Value { get; set; }
|
||||
}
|
||||
public class RecNetResult
|
||||
{
|
||||
public static RecNetResult Ok() => new RecNetResult { Success = true };
|
||||
public static RecNetResult Err(string error) => new RecNetResult { Success = false, Error = error };
|
||||
public static RecNetResultWithValue<T> Ok<T>(T value) => new RecNetResultWithValue<T> { Success = true, Value = value };
|
||||
public static RecNetResultWithValue<T> Err<T>(string error) => new RecNetResultWithValue<T> { Success = false, Error = error, Value = default };
|
||||
|
||||
[JsonPropertyName("success")] public bool Success { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonPropertyName("error")] public string? Error { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace CannedNet;
|
||||
|
||||
public class SelfAccount : Account
|
||||
{
|
||||
[JsonPropertyName("email")] public string? Email { get; set; }
|
||||
[JsonPropertyName("phone")] public string? Phone { get; set; }
|
||||
[JsonPropertyName("juniorState")] public JuniorState? JuniorState { get; set; }
|
||||
[JsonPropertyName("birthday")] public DateTime? Birthday { get; set; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonPropertyName("parentAccountId")] public string? ParentAccountId { get; set; }
|
||||
[JsonPropertyName("availableUsernameChanges")] public int? AvailableUsernameChanges { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user