From 2db1aa88e8ab53096a936163d686b90d8e056a99 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Wed, 21 Aug 2024 23:18:33 +0800
Subject: [PATCH] 国土对接返回信息加密

---
 src/main/java/com/dji/sample/component/mqtt/service/IMessageSenderService.java |   66 ++++++++++++++++++++++++++++++---
 1 files changed, 60 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/dji/sample/component/mqtt/service/IMessageSenderService.java b/src/main/java/com/dji/sample/component/mqtt/service/IMessageSenderService.java
index 15079a6..a1aecb8 100644
--- a/src/main/java/com/dji/sample/component/mqtt/service/IMessageSenderService.java
+++ b/src/main/java/com/dji/sample/component/mqtt/service/IMessageSenderService.java
@@ -2,8 +2,7 @@
 
 import com.dji.sample.component.mqtt.model.CommonTopicResponse;
 import com.dji.sample.component.mqtt.model.ServiceReply;
-
-import java.util.Optional;
+import com.fasterxml.jackson.core.type.TypeReference;
 
 /**
  * @author sean.zhou
@@ -28,15 +27,17 @@
     void publish(String topic, int qos, CommonTopicResponse response);
 
     /**
-     * Send live streaming start message and receive a response at the same time.
+     * Send message and receive a response at the same time.
+     * 发送消息并同时接收响应。
+     * @param clazz
      * @param topic
      * @param response  notification of whether the start is successful.
      * @return
      */
-    Optional<ServiceReply> publishWithReply(String topic, CommonTopicResponse response);
+    <T> T publishWithReply(Class<T> clazz, String topic, CommonTopicResponse response);
 
     /**
-     * Send live streaming start message and receive a response at the same time.
+     * Send message and receive a response at the same time.
      * @param clazz
      * @param topic
      * @param response
@@ -44,5 +45,58 @@
      * @param <T>
      * @return
      */
-    <T> Optional<T> publishWithReply(Class<T> clazz, String topic, CommonTopicResponse response, int retryTime);
+    <T> T publishWithReply(Class<T> clazz, String topic, CommonTopicResponse response, int retryTime);
+
+    /**
+     * Used exclusively for sending messages for services.
+     * @param clazz The generic class for ServiceReply.
+     * @param sn
+     * @param method
+     * @param data
+     * @param bid
+     * @param <T>
+     * @return
+     */
+    <T> ServiceReply<T> publishServicesTopic(TypeReference<T> clazz, String sn, String method, Object data, String bid);
+
+    /**
+     * Used exclusively for sending messages for services, and does not set the received subtype.
+     * @param sn
+     * @param method
+     * @param data
+     * @param bid
+     * @return
+     */
+    ServiceReply publishServicesTopic(String sn, String method, Object data, String bid);
+
+    /**
+     * Used exclusively for sending messages for services.
+     * @param clazz The generic class for ServiceReply.
+     * @param sn
+     * @param method
+     * @param data
+     * @param <T>
+     * @return
+     */
+    <T> ServiceReply<T> publishServicesTopic(TypeReference<T> clazz, String sn, String method, Object data);
+
+    <T> ServiceReply<T> publishServicesTopic(TypeReference<T> clazz, String sn, String method, Object data, String bid,Long timestamp);
+
+    ServiceReply publishServicesTopic(String sn, String method, Object data, String bid,Long timestamp);
+
+    /**
+     * Used exclusively for sending messages for services, and does not set the received subtype.
+     * @param sn
+     * @param method
+     * @param data
+     * @return
+     */
+    ServiceReply publishServicesTopic(String sn, String method, Object data);
+
+    <T> ServiceReply<T> publishRequestsTopic(TypeReference<T> clazz, String sn, String method, Object data, String bid);
+
+    ServiceReply publishRequestsTopic(String sn, String method, Object data, String bid);
+
+    ServiceReply publishRequestsTopic(String sn, String method, Object data);
+
 }

--
Gitblit v1.9.3