mirror of
https://github.com/gowvp/gb28181.git
synced 2025-10-12 19:01:51 +08:00
重构状态处理
This commit is contained in:
@@ -75,6 +75,8 @@ func registerGB28181(g gin.IRouter, api GB28181API, handler ...gin.HandlerFunc)
|
||||
group.DELETE("/:id", web.WarpH(api.delDevice))
|
||||
|
||||
group.POST("/:id/catalog", web.WarpH(api.queryCatalog)) // 刷新通道
|
||||
|
||||
group.GET("/channels", web.WarpH(api.FindChannelsForDevice))
|
||||
}
|
||||
|
||||
{
|
||||
@@ -125,6 +127,11 @@ func (a GB28181API) queryCatalog(c *gin.Context, _ *struct{}) (any, error) {
|
||||
return gin.H{"msg": "ok"}, nil
|
||||
}
|
||||
|
||||
func (a GB28181API) FindChannelsForDevice(c *gin.Context, in *gb28181.FindDeviceInput) (any, error) {
|
||||
items, total, err := a.gb28181Core.FindChannelsForDevice(c.Request.Context(), in)
|
||||
return gin.H{"items": items, "total": total}, err
|
||||
}
|
||||
|
||||
// >>> channel >>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
func (a GB28181API) findChannel(c *gin.Context, in *gb28181.FindChannelInput) (any, error) {
|
||||
|
Reference in New Issue
Block a user