Skip to content

Commit

Permalink
Added restfull api of mqtt config
Browse files Browse the repository at this point in the history
Added restfull api of mqtt config
  • Loading branch information
wind-c committed Aug 8, 2024
1 parent f05f581 commit a153d61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mqtt/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit a153d61

Please sign in to comment.