feat: 完成商城系统

This commit is contained in:
橙子
2024-11-03 15:49:41 +08:00
parent fe7211860f
commit 1468a7b878
6 changed files with 153 additions and 41 deletions

View File

@@ -0,0 +1,29 @@
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Yi.Framework.Bbs.Domain.Shared.Etos;
using Yi.Framework.DigitalCollectibles.Domain.Managers;
namespace Yi.Framework.DigitalCollectibles.Domain.EventHandlers;
public class SetAccountInfoEventHandler : ILocalEventHandler<SetAccountInfoEto>, ITransientDependency
{
private readonly CollectiblesManager _collectiblesManager;
private readonly InvitationCodeManager _invitationCodeManager;
public SetAccountInfoEventHandler(CollectiblesManager collectiblesManager,
InvitationCodeManager invitationCodeManager)
{
_collectiblesManager = collectiblesManager;
_invitationCodeManager = invitationCodeManager;
}
public async Task HandleEventAsync(SetAccountInfoEto eventData)
{
var userId = eventData.UserId;
//设置价值
eventData.Value = await _collectiblesManager.GetAccountValueAsync(userId);
//设置积分
eventData.Points = (await _invitationCodeManager.TryGetOrAddAsync(userId)).PointsNumber;
}
}