|
@@ -3,13 +3,13 @@ package com.free.mq;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|
|
import java.util.Map;
|
|
|
import java.util.HashMap;
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
@@ -33,6 +33,7 @@ public class MqService {
|
|
|
* @throws JsonProcessingException JSON处理异常
|
|
|
*/
|
|
|
public void sendMsg(String ex, String queue, Map msg) throws JsonProcessingException {
|
|
|
+ System.out.println(msg);
|
|
|
String strMsg = null;
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
mapper.setSerializationInclusion(Include.NON_NULL);
|
|
@@ -88,8 +89,9 @@ public class MqService {
|
|
|
String routerKey = MqListeners.queueName + "." + apply.getUser_id();
|
|
|
Map map = new HashMap<>();
|
|
|
Map data = Utils.objectToMap(apply);
|
|
|
- map.put("data", map);
|
|
|
+ map.put("data", data);
|
|
|
map.put("type", "notice");
|
|
|
+ System.out.println(data);
|
|
|
try {
|
|
|
this.sendMsg(ex, routerKey, map);
|
|
|
} catch (JsonProcessingException e) {
|