From a153d614b36ae1571869cf834ea086c6328f3c95 Mon Sep 17 00:00:00 2001 From: Wind <573966@qq.com> Date: Thu, 8 Aug 2024 23:00:20 +0800 Subject: [PATCH] Added restfull api of mqtt config Added restfull api of mqtt config --- mqtt/rest/rest.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mqtt/rest/rest.go b/mqtt/rest/rest.go index 0230bf8..1bf056f 100644 --- a/mqtt/rest/rest.go +++ b/mqtt/rest/rest.go @@ -16,6 +16,7 @@ const ( MqttAddBlacklistPath = "/api/v1/mqtt/blacklist/{id}" MqttDelBlacklistPath = "/api/v1/mqtt/blacklist/{id}" MqttPublishMessagePath = "/api/v1/mqtt/message" + MqttGetConfigPath = "/api/v1/mqtt/config" ) type Handler = func(http.ResponseWriter, *http.Request) @@ -32,6 +33,7 @@ func New(server *mqtt.Server) *Rest { func (s *Rest) GenHandlers() map[string]Handler { return map[string]Handler{ + "GET " + MqttGetConfigPath: s.viewConfig, "GET " + MqttGetOverallPath: s.getOverallInfo, "GET " + MqttGetOnlinePath: s.getOnlineCount, "GET " + MqttGetClientPath: s.getClient,