From ec46a32ca330e5c416302eb082e44fa164b37829 Mon Sep 17 00:00:00 2001
From: xieb <vip_xiaobin810@163.com>
Date: Fri, 22 Sep 2023 17:41:16 +0800
Subject: [PATCH] 配置修改

---
 src/main/java/com/dji/sample/component/mqtt/service/IMessageSenderService.java |   63 +++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 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 7930d41..e21816c 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
@@ -1,6 +1,8 @@
 package com.dji.sample.component.mqtt.service;
 
 import com.dji.sample.component.mqtt.model.CommonTopicResponse;
+import com.dji.sample.component.mqtt.model.ServiceReply;
+import com.fasterxml.jackson.core.type.TypeReference;
 
 /**
  * @author sean.zhou
@@ -24,4 +26,65 @@
      */
     void publish(String topic, int qos, CommonTopicResponse response);
 
+    /**
+     * Send message and receive a response at the same time.
+     * @param clazz
+     * @param topic
+     * @param response  notification of whether the start is successful.
+     * @return
+     */
+    <T> T publishWithReply(Class<T> clazz, String topic, CommonTopicResponse response);
+
+    /**
+     * Send message and receive a response at the same time.
+     * @param clazz
+     * @param topic
+     * @param response
+     * @param retryTime
+     * @param <T>
+     * @return
+     */
+    <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);
+
+    /**
+     * 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);
 }

--
Gitblit v1.9.3