current src

This commit is contained in:
Lapis
2026-03-31 17:06:41 -04:00
parent fede8440f7
commit e74618ddce
20 changed files with 1245 additions and 0 deletions
+16
View File
@@ -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; }
}
+24
View File
@@ -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;
}
+20
View File
@@ -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; }
}
+15
View File
@@ -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; }
}