parent
fdb479ef49
commit
02693836b2
@ -1,29 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.mq.consumer.coupon;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.mq.message.coupon.UserCreateMessage;
|
||||
import cn.iocoder.yudao.module.promotion.service.coupon.CouponService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* 针对 {@link UserCreateMessage} 的消费者
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class UserCreateConsumer implements Consumer<UserCreateMessage> {
|
||||
|
||||
@Resource
|
||||
private CouponService couponService;
|
||||
|
||||
@Override
|
||||
public void accept(UserCreateMessage message) {
|
||||
log.info("[onMessage][消息内容({})]", message);
|
||||
couponService.takeCouponByRegister(message.getUserId());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 消息队列的消费者
|
||||
*/
|
||||
package cn.iocoder.yudao.module.promotion.mq.consumer;
|
||||
@ -1,21 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.mq.message.coupon;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 会员用户创建消息
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
@Data
|
||||
public class UserCreateMessage {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 消息队列的消息
|
||||
*/
|
||||
package cn.iocoder.yudao.module.promotion.mq.message;
|
||||
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 消息队列的生产者
|
||||
*/
|
||||
package cn.iocoder.yudao.module.promotion.mq.producer;
|
||||
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 消息队列的消息
|
||||
*/
|
||||
package cn.iocoder.yudao.module.member.message;
|
||||
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 消息队列的消费者
|
||||
*/
|
||||
package cn.iocoder.yudao.module.member.mq.consumer;
|
||||
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 消息队列的消息
|
||||
*/
|
||||
package cn.iocoder.yudao.module.member.mq.message;
|
||||
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 消息队列的生产者
|
||||
*/
|
||||
package cn.iocoder.yudao.module.member.mq.producer;
|
||||
@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 占位
|
||||
*/
|
||||
package cn.iocoder.yudao.module.system.mq.producer;
|
||||
Loading…
Reference in new issue