重构设备控制器

This commit is contained in:
2025-12-05 14:44:36 +08:00
parent d7ba7747ec
commit 7017ffa128
12 changed files with 811 additions and 642 deletions

View File

@@ -84,22 +84,22 @@ func (a *API) setupRoutes() {
// 区域主控相关路由组
areaControllerGroup := authGroup.Group("/area-controllers")
{
areaControllerGroup.POST("", a.deviceController.CreateAreaController) // 创建区域主控
areaControllerGroup.GET("", a.deviceController.ListAreaControllers) // 获取区域主控列表
areaControllerGroup.GET("/:id", a.deviceController.GetAreaController) // 获取单个区域主控
areaControllerGroup.PUT("/:id", a.deviceController.UpdateAreaController) // 更新区域主控
areaControllerGroup.DELETE("/:id", a.deviceController.DeleteAreaController) // 删除区域主控
areaControllerGroup.POST("", a.areaControllerController.CreateAreaController) // 创建区域主控
areaControllerGroup.GET("", a.areaControllerController.ListAreaControllers) // 获取区域主控列表
areaControllerGroup.GET("/:id", a.areaControllerController.GetAreaController) // 获取单个区域主控
areaControllerGroup.PUT("/:id", a.areaControllerController.UpdateAreaController) // 更新区域主控
areaControllerGroup.DELETE("/:id", a.areaControllerController.DeleteAreaController) // 删除区域主控
}
logger.Debug("区域主控相关接口注册成功 (需要认证和审计)")
// 设备模板相关路由组
deviceTemplateGroup := authGroup.Group("/device-templates")
{
deviceTemplateGroup.POST("", a.deviceController.CreateDeviceTemplate) // 创建设备模板
deviceTemplateGroup.GET("", a.deviceController.ListDeviceTemplates) // 获取设备模板列表
deviceTemplateGroup.GET("/:id", a.deviceController.GetDeviceTemplate) // 获取单个设备模板
deviceTemplateGroup.PUT("/:id", a.deviceController.UpdateDeviceTemplate) // 更新设备模板
deviceTemplateGroup.DELETE("/:id", a.deviceController.DeleteDeviceTemplate) // 删除设备模板
deviceTemplateGroup.POST("", a.deviceTemplateController.CreateDeviceTemplate) // 创建设备模板
deviceTemplateGroup.GET("", a.deviceTemplateController.ListDeviceTemplates) // 获取设备模板列表
deviceTemplateGroup.GET("/:id", a.deviceTemplateController.GetDeviceTemplate) // 获取单个设备模板
deviceTemplateGroup.PUT("/:id", a.deviceTemplateController.UpdateDeviceTemplate) // 更新设备模板
deviceTemplateGroup.DELETE("/:id", a.deviceTemplateController.DeleteDeviceTemplate) // 删除设备模板
}
logger.Debug("设备模板相关接口注册成功 (需要认证和审计)")