admin
2024-10-16 62a447d89331aee1feae7724c7616aa1bb2cfe79
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/MQMsgBodyFactory.java
@@ -1,18 +1,18 @@
package com.yeshi.fanli.util.rocketmq;
import com.aliyun.openservices.ons.api.Message;
import com.google.gson.Gson;
import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
public class MQMsgBodyFactory {
   public static Message create(MQTopicName topic,OrderTopicTagEnum tag,Object body){
      return new Message(topic.name(), tag.name(), new Gson().toJson(body).getBytes());
   }
   public static Message create(MQTopicName topic,UserTopicTagEnum tag,Object body){
      return new Message(topic.name(), tag.name(), new Gson().toJson(body).getBytes());
   }
}
package com.yeshi.fanli.util.rocketmq;
import com.aliyun.openservices.ons.api.Message;
import com.google.gson.Gson;
import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
public class MQMsgBodyFactory {
   public static Message create(MQTopicName topic,OrderTopicTagEnum tag,Object body){
      return new Message(topic.name(), tag.name(), new Gson().toJson(body).getBytes());
   }
   public static Message create(MQTopicName topic,UserTopicTagEnum tag,Object body){
      return new Message(topic.name(), tag.name(), new Gson().toJson(body).getBytes());
   }
}