초기커밋

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,60 @@

using ServerCore;
using ServerBase;
using ServerCommon;
namespace BrokerCore.Entity;
using Actions;
public class BrokerMailEntity : EntityBase, IWithLogActor
{
private readonly EntityBase m_parent;
private readonly IServerLogic m_server_logic;
// !! 주의 현상태에서는 EntityBase는 반드시 UserBase여야 한다.
// !! MailAttribute가 AccountAttribute를 참조하고, AccountAttribute는 UserBase를 참조하기 때문
public BrokerMailEntity(EntityBase parent, IServerLogic serverLogic)
: base(EntityType.Mail, parent)
{
this.m_parent = parent;
this.m_server_logic = serverLogic;
}
//====================================================================================================
// mail에 동록된 모든 Attribute와 Action을 초기화
//====================================================================================================
public override async Task<Result> onInit()
{
addEntityAttribute(new MailAttribute(this, m_parent));
addEntityAction(new BrokerMailSendAction(this, m_server_logic.getDynamoDbClient()));
addEntityAction(new BrokerMailRecvAction(this, m_server_logic.getDynamoDbClient()));
var mail_attribute = this.getEntityAttributeNotNull<MailAttribute>();
var result = await mail_attribute.onInit();
if (result.isFail())
{
return result;
}
var mail_send_action = this.getEntityActionNotNull<BrokerMailSendAction>();
result = await mail_send_action.onInit();
if (result.isFail())
{
return result;
}
return await base.onInit();
}
public ILogActor toLogActor()
{
var log_actor = m_parent as IWithLogActor;
NullReferenceCheckHelper.throwIfNull(log_actor,
() => $"m_parent is not IWithLogActor");
return log_actor.toLogActor();
}
}