admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
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
package com.yeshi.fanli.util.mq.cmq;
 
import com.google.gson.Gson;
import com.yeshi.fanli.dto.push.PushContentDetailDTO;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.mq.rabbit.RabbitmqSenderUtil;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
@Component
public class PushCMQManager {
 
    @Resource
    private RabbitTemplate rabbitTemplate;
 
 
    public static String PUSH_HW = "push-hw";
 
    static {
        PUSH_HW += "-" + Constant.systemCommonConfig.getProjectName();
    }
 
 
    /**
     * @param dto
     */
    public void addHWPush(PushContentDetailDTO dto) {
        if (dto == null)
            return;
        String json = new Gson().toJson(dto);
        RabbitmqSenderUtil.sendQueueMsg(rabbitTemplate, PUSH_HW, json);
    }
}