package cn.iocoder.yudao.module.order.listener;

import cn.iocoder.yudao.framework.apollo.core.event.AssignConfirmedCustomerEvent;
import cn.iocoder.yudao.framework.apollo.core.event.ProductConfirmedEvent;
import cn.iocoder.yudao.module.order.service.orderException.OrderExceptionService;
import lombok.AllArgsConstructor;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 新商品确认异常
 */
@Component("ProductConfirmedListener")
@AllArgsConstructor
public class ProductConfirmedListener {
    private final OrderExceptionService orderExceptionService;

    /**
     * 客户商品确认回调
     *
     * @param event 商品id
     */
    @EventListener(ProductConfirmedEvent.class)
    public void assignedProductCallback(ProductConfirmedEvent event) {
        orderExceptionService.assignedProductCallback(event.getProductId());
    }
}
