|
|
|
@ -0,0 +1,36 @@ |
|
|
|
package com.qniao.dam.application.handler.product; |
|
|
|
|
|
|
|
import com.qniao.dam.domain.aggregate.product.ProductAggregate; |
|
|
|
import com.qniao.dam.domain.aggregate.product.entity.Product; |
|
|
|
import com.qniao.dam.infrastructure.constant.MqExchange; |
|
|
|
import com.qniao.dam.infrastructure.constant.MqQueue; |
|
|
|
import com.qniao.das.domian.aggregate.siteactivity.event.SiteActivityCreatedMQEvent; |
|
|
|
import com.qniao.domain.BaseApplicationService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
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; |
|
|
|
|
|
|
|
@Component |
|
|
|
@Slf4j |
|
|
|
public class ProductEventHandler extends BaseApplicationService { |
|
|
|
|
|
|
|
@Resource |
|
|
|
private ProductAggregate productAggregate; |
|
|
|
|
|
|
|
@RabbitListener(bindings = @QueueBinding(value = @Queue(MqQueue.SITE_ACTIVITY_CREATED), |
|
|
|
exchange = @Exchange(value = MqExchange.SITE_ACTIVITY_CREATED, |
|
|
|
type = ExchangeTypes.FANOUT))) |
|
|
|
public void handleConfirmMatch(SiteActivityCreatedMQEvent event) { |
|
|
|
try { |
|
|
|
Product product = new Product(); |
|
|
|
}catch (Exception e){ |
|
|
|
log.error("线下活动事件已创建处理异常:", e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |