定义控制器和注册路由(服务层和领域层没实现)

This commit is contained in:
2025-12-05 16:08:06 +08:00
parent 7017ffa128
commit 2bb187071f
9 changed files with 805 additions and 38 deletions

View File

@@ -84,11 +84,14 @@ func (a *API) setupRoutes() {
// 区域主控相关路由组
areaControllerGroup := authGroup.Group("/area-controllers")
{
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) // 删除区域主控
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) // 删除区域主控
areaControllerGroup.POST("/:id/ota/start", a.areaControllerController.StartUpgrade) // 开始升级
areaControllerGroup.GET("/ota/progress/:taskId", a.areaControllerController.GetUpgradeProgress) // 获取升级进度
areaControllerGroup.POST("/ota/tasks/:taskId/stop", a.areaControllerController.StopUpgrade) // 停止升级
}
logger.Debug("区域主控相关接口注册成功 (需要认证和审计)")