feat : RDB 기능 추가 (라이브러리, base 코드 구현)

This commit is contained in:
qornwh1
2026-03-01 16:58:38 +09:00
parent 563448a09a
commit 34394f2c96
14 changed files with 410 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
using System.Text.Json;
namespace ServerLib.RDB.Handlers;
public static class HandlerHelper
{
public static string Success<T>(T data)
{
return JsonSerializer.Serialize(new Response<T> { Success = true, Data = data });
}
public static string Error(string message)
{
return JsonSerializer.Serialize(new Response<object> { Success = false, Error = message });
}
public static T? Deserialize<T>(string payload)
{
try { return JsonSerializer.Deserialize<T>(payload); }
catch { return default; }
}
}

View File

@@ -0,0 +1,8 @@
namespace ServerLib.RDB.Handlers;
public class Response<T>
{
public bool Success { get; init; }
public T? Data { get; init; }
public string? Error { get; init; }
}