초기커밋

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,45 @@
using System.Globalization;
using UGQApiServer.Converter;
using UGQApiServer.Models;
using UGQDataAccess;
using ServerCommon;
using ServerCommon.UGQ.Models;
using UGQApiServer.UGQData;
namespace UGQApiServer;
public static class ApiResponseFactory
{
public static ApiErrorResponse error(ServerErrorCode errorCode)
{
LangEnum langEnum = Culture.ToLangEnum(CultureInfo.CurrentCulture.Name);
var textId = errorCode.ToString().Replace("Ugq", "UGQ_Error_");
var message = UGQDataHelper.getText(langEnum, textId);
return new ApiErrorResponse
{
ErrorCode = (int)errorCode,
ErrorMessage = message ?? errorCode.ToString(),
};
}
public static ValidationErrorResponse validationError(ServerErrorCode errorCode, List<string> errors)
{
LangEnum langEnum = Culture.ToLangEnum(CultureInfo.CurrentCulture.Name);
var textId = errorCode.ToString().Replace("Ugq", "UGQ_Error_");
var message = UGQDataHelper.getText(langEnum, textId);
return new ValidationErrorResponse
{
ErrorCode = (int)errorCode,
ErrorMessage = message ?? errorCode.ToString(),
ValidationErrorMessages = errors
};
}
}