修改controller包
This commit is contained in:
@@ -91,9 +91,9 @@ func NewAPI(cfg config.ServerConfig,
|
||||
config: cfg,
|
||||
listenHandler: listenHandler,
|
||||
// 在 NewAPI 中初始化用户控制器,并将其作为 API 结构体的成员
|
||||
userController: user.NewController(userService, baseCtx),
|
||||
userController: user.NewController(baseCtx, userService),
|
||||
// 在 NewAPI 中初始化设备控制器,并将其作为 API 结构体的成员
|
||||
deviceController: device.NewController(deviceService, baseCtx),
|
||||
deviceController: device.NewController(baseCtx, deviceService),
|
||||
// 在 NewAPI 中初始化计划控制器,并将其作为 API 结构体的成员
|
||||
planController: plan.NewController(baseCtx, planService),
|
||||
// 在 NewAPI 中初始化猪场管理控制器
|
||||
@@ -101,7 +101,7 @@ func NewAPI(cfg config.ServerConfig,
|
||||
// 在 NewAPI 中初始化猪群控制器
|
||||
pigBatchController: management.NewPigBatchController(baseCtx, pigBatchService),
|
||||
// 在 NewAPI 中初始化数据监控控制器
|
||||
monitorController: monitor.NewController(monitorService, baseCtx),
|
||||
monitorController: monitor.NewController(baseCtx, monitorService),
|
||||
}
|
||||
|
||||
api.setupRoutes() // 设置所有路由
|
||||
|
||||
Reference in New Issue
Block a user