초기커밋

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,52 @@
using Microsoft.EntityFrameworkCore;
namespace BrokerCore.Repository;
using Context;
using DbEntity;
public class SsoAccountRepo
{
private readonly SsoAccountDbContext m_db_context;
public SsoAccountRepo(SsoAccountDbContext dbContext)
{
m_db_context = dbContext;
}
public async Task<(Result, SsoAccountInfo?)> findOne(ulong id)
{
try
{
var sso_account = await m_db_context.SsoAccounts.Where(x => x.Id == id).FirstOrDefaultAsync();
if (sso_account == null)
{
return (new Result { ErrorCode = ServerErrorCode.AccountIdNotFoundInSsoAccountDb, ResultString = "Not found SsoAccount" },
null);
}
return (new Result(), sso_account);
}
catch (Exception e)
{
return (new Result { ErrorCode = ServerErrorCode.RdbError, ResultString = e.Message },
null);
}
}
public async Task<(Result, SsoAccountInfo?)> findOneByEmail(string email)
{
try
{
var sso_account = await m_db_context.SsoAccounts.Where(x => x.Email == email).FirstOrDefaultAsync();
if (sso_account == null)
{
return (new Result { ErrorCode = ServerErrorCode.AccountIdNotFoundInSsoAccountDb, ResultString = "Not found SsoAccount" },
null);
}
return (new Result(), sso_account);
}
catch (Exception e)
{
return (new Result { ErrorCode = ServerErrorCode.RdbError, ResultString = e.Message },
null);
}
}
}