重构状态处理

This commit is contained in:
xugo
2025-06-14 18:11:36 +08:00
parent 57a9a5b42e
commit 3fc455ecdd
16 changed files with 114 additions and 15 deletions

View File

@@ -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) {