feat: replace iot adapter with mqtt command pipeline
This commit is contained in:
17
backend/api/internal/routers/iot.go
Normal file
17
backend/api/internal/routers/iot.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
iotlogic "git.apinb.com/heqiapp/platforms/backend/api/internal/logic/iot"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func RegisterIoT(serviceKey string, engine *gin.Engine) {
|
||||
group := engine.Group(fmt.Sprintf("/%s/internal/v1/iot", serviceKey))
|
||||
group.Use(iotlogic.RequireInternalToken())
|
||||
group.POST("/commands", iotlogic.CreateCommand)
|
||||
group.GET("/commands/:identity", iotlogic.GetCommand)
|
||||
group.GET("/outbox/next", iotlogic.ClaimOutbox)
|
||||
group.POST("/outbox/:identity/result", iotlogic.CompleteOutbox)
|
||||
group.POST("/device-messages", iotlogic.SaveDeviceMessage)
|
||||
}
|
||||
@@ -10,5 +10,6 @@ func Register(serviceKey string, engine *gin.Engine) {
|
||||
RegisterDelivery(serviceKey, engine)
|
||||
RegisterClient(serviceKey, engine)
|
||||
RegisterPaymentReturn(serviceKey, engine)
|
||||
RegisterIoT(serviceKey, engine)
|
||||
registerUploadRoute(serviceKey, engine)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user