parent
2fa061afdf
commit
928bb1c436
@ -0,0 +1,39 @@
|
||||
package com.luoo.user.dto.point;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* DTO for {@link com.luoo.user.pojo.UserPointLog}
|
||||
*
|
||||
* 抽奖rabbitmq对象
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class DrawDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1115530233333204283L;
|
||||
|
||||
@ApiModelProperty(value = "积分")
|
||||
Integer score;
|
||||
|
||||
@ApiModelProperty(value = "任务积分id")
|
||||
Integer type;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
String userId;
|
||||
|
||||
@ApiModelProperty(value = "任务积分id")
|
||||
String taskPointId;
|
||||
|
||||
@ApiModelProperty(value = "抽奖区域id")
|
||||
Integer regionId;
|
||||
|
||||
@ApiModelProperty(value = "抽奖id")
|
||||
String lotteryId;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.luoo.user.listener;
|
||||
|
||||
import com.luoo.user.dto.point.DrawDTO;
|
||||
import com.luoo.user.pojo.UserPointLog;
|
||||
import com.luoo.user.service.UserPointLogService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @program: luoo_parent
|
||||
* @description: 抽奖队列
|
||||
* @author: yawei.huang
|
||||
* @create: 2024-08-19 09:28
|
||||
**/
|
||||
@Component
|
||||
@RabbitListener(queues = "draw")
|
||||
@Slf4j
|
||||
public class drawListener {
|
||||
|
||||
@Autowired
|
||||
private UserPointLogService userPointLogService;
|
||||
|
||||
@RabbitHandler
|
||||
public void executeDraw(DrawDTO drawDTO) {
|
||||
log.info("drawDTO:{}", drawDTO);
|
||||
userPointLogService.executeDraw(drawDTO);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue