|
|
|
@ -2,15 +2,23 @@ package com.qniao.dam.application.handler.marriagebounty; |
|
|
|
|
|
|
|
import com.google.common.eventbus.Subscribe; |
|
|
|
import com.qniao.dam.api.command.reward.user.request.AcquireMatchmakerConfirmMeetingRewardDto; |
|
|
|
import com.qniao.dam.application.service.marriagebounty.MarriageBountyOrderApplicationService; |
|
|
|
import com.qniao.dam.application.service.reward.RewardApplicationService; |
|
|
|
import com.qniao.dam.domian.aggregate.marriagebounty.event.MarriageBountyOrderConfirmedMeetingEvent; |
|
|
|
import com.qniao.dam.domian.aggregate.marriagebounty.event.MarriageBountyOrderCreatedEvent; |
|
|
|
import com.qniao.dam.domian.aggregate.marriagebounty.event.MarriageBountyOrderCreatedMQ; |
|
|
|
import com.qniao.dam.infrastructure.constant.MqExchange; |
|
|
|
import com.qniao.dam.infrastructure.constant.MqQueue; |
|
|
|
import com.qniao.das.domian.aggregate.marriageseekingreward.event.RewardSelectedGuestEvent; |
|
|
|
import com.qniao.domain.BaseApplicationService; |
|
|
|
import com.qniao.framework.utils.TypeConvertUtils; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.amqp.core.AmqpTemplate; |
|
|
|
import org.springframework.amqp.core.ExchangeTypes; |
|
|
|
import org.springframework.amqp.rabbit.annotation.Exchange; |
|
|
|
import org.springframework.amqp.rabbit.annotation.Queue; |
|
|
|
import org.springframework.amqp.rabbit.annotation.QueueBinding; |
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
@ -24,6 +32,8 @@ public class MarriageBountyOrderEventHandle extends BaseApplicationService { |
|
|
|
private AmqpTemplate amqpTemplate; |
|
|
|
@Resource |
|
|
|
private RewardApplicationService rewardApplicationService; |
|
|
|
@Resource |
|
|
|
private MarriageBountyOrderApplicationService marriageBountyOrderApplicationService; |
|
|
|
|
|
|
|
@Subscribe |
|
|
|
public void handle(MarriageBountyOrderCreatedEvent event) { |
|
|
|
@ -50,4 +60,17 @@ public class MarriageBountyOrderEventHandle extends BaseApplicationService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RabbitListener(bindings = @QueueBinding(value = @Queue(MqQueue.REWARD_SELECTED_GUEST), |
|
|
|
exchange = @Exchange(value = MqExchange.REWARD_SELECTED_GUEST, |
|
|
|
type = ExchangeTypes.FANOUT))) |
|
|
|
public void handle(RewardSelectedGuestEvent event) { |
|
|
|
try { |
|
|
|
//创建榜单 |
|
|
|
marriageBountyOrderApplicationService.confirmMeeting(event.getMarriageBountyOrderId(),event.getMatchmakerUserId(),event.getMiId()); |
|
|
|
log.error("接收到MQ事件:{}", event); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("悬赏招亲确认见面处理异常", e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |