초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ServerCore; using ServerBase;
namespace ServerBase;
//=============================================================================================
// Result 관련 확장 함수
//
// author : kangms
//
//=============================================================================================
public static class ResultHelper
{
public static bool isSuccess(this Result result)
{
ArgumentNullReferenceCheckHelper.throwIfNull(result, () => $"result is null !!!");
if (true == result.ErrorCode.isSuccess())
{
return true;
}
return false;
}
public static bool isFail(this Result result)
{
ArgumentNullReferenceCheckHelper.throwIfNull(result, () => $"result is null !!!");
if (true == result.ErrorCode.isFail())
{
return true;
}
return false;
}
public static void setSuccess(this Result result, string resultString = "")
{
ArgumentNullReferenceCheckHelper.throwIfNull(result, () => $"result is null !!!");
result.set(ServerErrorCode.Success, resultString);
}
public static void setFail(this Result result, ServerErrorCode errorCode, string resultString = "")
{
ArgumentNullReferenceCheckHelper.throwIfNull(result, () => $"result is null !!!");
result.set(errorCode, resultString);
}
public static string getResultString(this Result result)
{
ArgumentNullReferenceCheckHelper.throwIfNull(result, () => $"result is null !!!");
return result.ResultString;
}
public static ServerErrorCode getErrorCode(this Result result)
{
ArgumentNullReferenceCheckHelper.throwIfNull(result, () => $"result is null !!!");
return result.ErrorCode;
}
public static void set(this Result result, ServerErrorCode errorCode, string resultString)
{
ArgumentNullReferenceCheckHelper.throwIfNull(result, () => $"result is null !!!");
result.ErrorCode = errorCode;
result.ResultString = resultString;
}
public static string toBasicString(this Result result)
{
ArgumentNullReferenceCheckHelper.throwIfNull(result, () => $"result is null !!!");
return $"ErrorInfo: errCode:{result.getErrorCode()}, errDesc:{result.getResultString()}";
}
}