修改 Bootstrap 注入 Gateway Client 依赖到 IotCardHandler 和 DeviceHandler

This commit is contained in:
2026-02-02 17:27:59 +08:00
parent 80f560df33
commit 246ea6e287
8 changed files with 187 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/gofiber/fiber/v2"
"github.com/break/junhong_cmp_fiber/internal/gateway"
"github.com/break/junhong_cmp_fiber/internal/model/dto"
deviceService "github.com/break/junhong_cmp_fiber/internal/service/device"
"github.com/break/junhong_cmp_fiber/pkg/constants"
@@ -14,12 +15,14 @@ import (
)
type DeviceHandler struct {
service *deviceService.Service
service *deviceService.Service
gatewayClient *gateway.Client
}
func NewDeviceHandler(service *deviceService.Service) *DeviceHandler {
func NewDeviceHandler(service *deviceService.Service, gatewayClient *gateway.Client) *DeviceHandler {
return &DeviceHandler{
service: service,
service: service,
gatewayClient: gatewayClient,
}
}