zs 8 months ago
parent
commit
9f28df8215

+ 6 - 0
src/main/java/com/free/entity/ChatRecord.java

@@ -59,4 +59,10 @@ public class ChatRecord extends BaseEntity {
   @ApiModelProperty("内容类型")
   private String content_type;
 
+
+  @Column(comment = "已读/未读", defaultValue = "0")
+  @TableField(value = "is_read")
+  @ApiModelProperty("已读/未读")
+  private String is_read;
+
 }

+ 1 - 0
src/main/java/com/free/entity/TransferApply.java

@@ -52,4 +52,5 @@ public class TransferApply extends BaseEntity {
   @ApiModelProperty("是否结束")
   private int is_close;
 
+
 }

+ 5 - 3
src/main/java/com/free/mq/MqService.java

@@ -1,9 +1,9 @@
 package com.free.mq;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
 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;
@@ -31,9 +31,10 @@ 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(JsonInclude.Include.NON_NULL);
+    mapper.setSerializationInclusion(Include.NON_NULL);
     strMsg = mapper.writeValueAsString(msg);
     rabbitTemplate.convertAndSend(ex, queue, strMsg);
   }
@@ -84,8 +85,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) {