move models to shared, make new admin project

This commit is contained in:
Lapis
2026-06-16 18:32:28 -04:00
parent ee98c4c369
commit c20d215ee0
106 changed files with 60428 additions and 5 deletions
+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; }
}