Helius
2021-06-11 50d4789eab5944b1b400f17ff00e3219228c5b79
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.xcong.excoin.rabbit.consumer;
 
import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel;
import com.xcong.excoin.configurations.RabbitMqConfig;
import com.xcong.excoin.rabbit.pricequeue.OrderModel;
import com.xcong.excoin.rabbit.pricequeue.OrderOperatePriceService;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
 
 
/**
 * 用户修改止损止盈价格、提价限价委托、下单爆仓价等消息
 * 后台打包开启 APP 不开启
 * @author helius
 */
@Component
@Deprecated
@ConditionalOnProperty(prefix = "app", name = "newest-price-update-job-contract", havingValue = "true")
public class OperateOrderPriceConsumer {
 
 
    /**
     * 用户修改止损止盈价格、提价限价委托、下单爆仓价等消息
     *
     * @param message 消息体
     * @param channel 信道
     * @date 2019年4月19日
     */
    @RabbitListener(queues = RabbitMqConfig.QUEUE_PRICEOPERATE)
    public void onMessageMorePro(Message message, Channel channel) {
        String content = new String(message.getBody());
        System.out.println("我收到了用户的订单操作消息:" + content);
        // 操作前的map
        // 转为model
        OrderModel orderModel = JSONObject.parseObject(content, OrderModel.class);
        // 向优先队列添加
        OrderOperatePriceService.dealWithNewMq(orderModel);
 
    }
 
 
}