fix
wzy
2022-11-06 420efcecbc5b9b17f96b9c0a37d9bc3a5f1afccd
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
package cc.mrbird.febs.rabbit.consumer;
 
import cc.mrbird.febs.dapp.service.DappSystemService;
import cc.mrbird.febs.rabbit.QueueConstants;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
 
/**
 * @author wzy
 * @date 2022-05-31
 **/
@Slf4j
@Component
@ConditionalOnProperty(prefix = "system", name = "online-transfer", havingValue = "true")
public class ChainConsumer {
 
    @Autowired
    private DappSystemService dappSystemService;
 
    @RabbitListener(queues = QueueConstants.ACHIEVE_TREE)
    public void achieveTree(String id) {
        log.info("收到业绩树消息");
        dappSystemService.achieveTree(Long.parseLong(id));
    }
 
    /**
     * 生产者在tfc应用
     * @param data
     */
    @RabbitListener(queues = QueueConstants.TFC_NEW_PRICE)
    public void tfcNewPrice(String data) {
        dappSystemService.tfcNewPrice(data);
    }
}