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,48 @@
using MMOserver.RDB.Models;
using MMOserver.RDB.Services;
using ServerLib.RDB.Handlers;
namespace MMOserver.RDB.Handlers;
public class TestHandler
{
private readonly TestService _testService;
public TestHandler(TestService testService) => _testService = testService;
public async Task<string> GetTestAsync(int id)
{
Test? result = await _testService.GetTestAsync(id);
return result is null
? HandlerHelper.Error("Test not found")
: HandlerHelper.Success(result);
}
public async Task<string> GetTestByUuidAsync(string uuid)
{
Test? result = await _testService.GetTestByUuidAsync(uuid);
return result is null
? HandlerHelper.Error("Test not found")
: HandlerHelper.Success(result);
}
public async Task<string> GetAllTestsAsync()
{
return HandlerHelper.Success(await _testService.GetAllTestsAsync());
}
public async Task<string> CreateTestAsync(int testA, string testB, double testC)
{
return HandlerHelper.Success(await _testService.CreateTestAsync(testA, testB, testC));
}
public async Task<string> UpdateTestAsync(int id, int? testA, string? testB, double? testC)
{
return HandlerHelper.Success(await _testService.UpdateTestAsync(id, testA, testB, testC));
}
public async Task<string> DeleteTestAsync(int id)
{
return HandlerHelper.Success(await _testService.DeleteTestAsync(id));
}
}