package cc.mrbird.febs.rabbit.consumer;
|
|
import cc.mrbird.febs.mall.dto.OpenPrice;
|
import cc.mrbird.febs.mall.service.CJService;
|
import cc.mrbird.febs.rabbit.constants.QueueConstants;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
import java.util.Date;
|
|
/**
|
* @author wzy
|
* @date 2021-09-25
|
**/
|
@Slf4j
|
@Component
|
public class AgentConsumer {
|
|
@Autowired
|
private CJService cjService;
|
|
@RabbitListener(queues = QueueConstants.QUEUE_CHOU_JIANG_TIME)
|
public void getChouJiangDelayMsg(String kjNo) {
|
|
log.info("收到延时开奖信息消息,编号:{}",kjNo);
|
try {
|
cjService.getChouJiangDelayMsg(kjNo);
|
} catch (Exception e) {
|
log.error("延时开奖异常", e);
|
// todo 更新表
|
|
}
|
}
|
|
@RabbitListener(queues = QueueConstants.QUEUE_NO_TIME)
|
public void getNoTimeDelayMsg(String kjNo) {
|
log.info("收到停止下注消息,编号:{}",kjNo);
|
try {
|
cjService.getNoTimeDelayMsg(kjNo);
|
} catch (Exception e) {
|
log.error("停止下注异常", e);
|
// todo 更新表
|
|
}
|
}
|
|
@RabbitListener(queues = QueueConstants.QUEUE_OPEN_PRICE)
|
public void getOpenPriceMsg(OpenPrice openPrice) {
|
log.info("收到开奖信息:{}, {}", openPrice.getKjNo(), openPrice.getKjNum());
|
try {
|
cjService.getOpenPriceMsg(openPrice.getKjNo(), openPrice.getKjNum());
|
} catch (Exception e) {
|
log.error("开奖信息异常", e);
|
// todo 更新表
|
|
}
|
}
|
}
|