296 lines
7.3 KiB
Go
296 lines
7.3 KiB
Go
// Code generated by Wire. DO NOT EDIT.
|
|
|
|
//go:generate go run github.com/google/wire/cmd/wire
|
|
//go:build !wireinject
|
|
// +build !wireinject
|
|
|
|
package wirex
|
|
|
|
import (
|
|
"context"
|
|
"ifms/internal/mods"
|
|
"ifms/internal/mods/autocontrol"
|
|
api3 "ifms/internal/mods/autocontrol/api"
|
|
biz3 "ifms/internal/mods/autocontrol/biz"
|
|
dal3 "ifms/internal/mods/autocontrol/dal"
|
|
"ifms/internal/mods/digital"
|
|
api2 "ifms/internal/mods/digital/api"
|
|
biz2 "ifms/internal/mods/digital/biz"
|
|
dal2 "ifms/internal/mods/digital/dal"
|
|
"ifms/internal/mods/envmonitor"
|
|
api4 "ifms/internal/mods/envmonitor/api"
|
|
biz4 "ifms/internal/mods/envmonitor/biz"
|
|
dal4 "ifms/internal/mods/envmonitor/dal"
|
|
"ifms/internal/mods/rbac"
|
|
"ifms/internal/mods/rbac/api"
|
|
"ifms/internal/mods/rbac/biz"
|
|
"ifms/internal/mods/rbac/dal"
|
|
"ifms/pkg/util"
|
|
)
|
|
|
|
// Injectors from wire.go:
|
|
|
|
func BuildInjector(ctx context.Context) (*Injector, func(), error) {
|
|
db, cleanup, err := InitDB(ctx)
|
|
if err != nil {
|
|
return nil, nil, err
|
|
}
|
|
cacher, cleanup2, err := InitCacher(ctx)
|
|
if err != nil {
|
|
cleanup()
|
|
return nil, nil, err
|
|
}
|
|
auther, cleanup3, err := InitAuth(ctx)
|
|
if err != nil {
|
|
cleanup2()
|
|
cleanup()
|
|
return nil, nil, err
|
|
}
|
|
trans := &util.Trans{
|
|
DB: db,
|
|
}
|
|
menu := &dal.Menu{
|
|
DB: db,
|
|
}
|
|
menuResource := &dal.MenuResource{
|
|
DB: db,
|
|
}
|
|
roleMenu := &dal.RoleMenu{
|
|
DB: db,
|
|
}
|
|
bizMenu := &biz.Menu{
|
|
Cache: cacher,
|
|
Trans: trans,
|
|
MenuDAL: menu,
|
|
MenuResourceDAL: menuResource,
|
|
RoleMenuDAL: roleMenu,
|
|
}
|
|
apiMenu := &api.Menu{
|
|
MenuBIZ: bizMenu,
|
|
}
|
|
role := &dal.Role{
|
|
DB: db,
|
|
}
|
|
userRole := &dal.UserRole{
|
|
DB: db,
|
|
}
|
|
bizRole := &biz.Role{
|
|
Cache: cacher,
|
|
Trans: trans,
|
|
RoleDAL: role,
|
|
RoleMenuDAL: roleMenu,
|
|
UserRoleDAL: userRole,
|
|
}
|
|
apiRole := &api.Role{
|
|
RoleBIZ: bizRole,
|
|
}
|
|
user := &dal.User{
|
|
DB: db,
|
|
}
|
|
bizUser := &biz.User{
|
|
Cache: cacher,
|
|
Trans: trans,
|
|
UserDAL: user,
|
|
UserRoleDAL: userRole,
|
|
}
|
|
apiUser := &api.User{
|
|
UserBIZ: bizUser,
|
|
}
|
|
login := &biz.Login{
|
|
Cache: cacher,
|
|
Auth: auther,
|
|
UserDAL: user,
|
|
UserRoleDAL: userRole,
|
|
MenuDAL: menu,
|
|
UserBIZ: bizUser,
|
|
}
|
|
apiLogin := &api.Login{
|
|
LoginBIZ: login,
|
|
}
|
|
logger := &dal.Logger{
|
|
DB: db,
|
|
}
|
|
bizLogger := &biz.Logger{
|
|
LoggerDAL: logger,
|
|
}
|
|
apiLogger := &api.Logger{
|
|
LoggerBIZ: bizLogger,
|
|
}
|
|
casbinx := &rbac.Casbinx{
|
|
Cache: cacher,
|
|
MenuDAL: menu,
|
|
MenuResourceDAL: menuResource,
|
|
RoleDAL: role,
|
|
}
|
|
rbacRBAC := &rbac.RBAC{
|
|
DB: db,
|
|
MenuAPI: apiMenu,
|
|
RoleAPI: apiRole,
|
|
UserAPI: apiUser,
|
|
LoginAPI: apiLogin,
|
|
LoggerAPI: apiLogger,
|
|
Casbinx: casbinx,
|
|
}
|
|
diagram := &dal2.Diagram{
|
|
DB: db,
|
|
}
|
|
bizDiagram := &biz2.Diagram{
|
|
Trans: trans,
|
|
DiagramDAL: diagram,
|
|
}
|
|
apiDiagram := &api2.Diagram{
|
|
DiagramBIZ: bizDiagram,
|
|
}
|
|
digitalDIGITAL := &digital.DIGITAL{
|
|
DB: db,
|
|
DiagramAPI: apiDiagram,
|
|
}
|
|
deviceRunLog := &dal3.DeviceRunLog{
|
|
DB: db,
|
|
}
|
|
bizDeviceRunLog := &biz3.DeviceRunLog{
|
|
Trans: trans,
|
|
DeviceRunLogDAL: deviceRunLog,
|
|
}
|
|
apiDeviceRunLog := &api3.DeviceRunLog{
|
|
DeviceRunLogBIZ: bizDeviceRunLog,
|
|
}
|
|
deviceControlLog := &dal3.DeviceControlLog{
|
|
DB: db,
|
|
}
|
|
bizDeviceControlLog := &biz3.DeviceControlLog{
|
|
Trans: trans,
|
|
DeviceControlLogDAL: deviceControlLog,
|
|
}
|
|
apiDeviceControlLog := &api3.DeviceControlLog{
|
|
DeviceControlLogBIZ: bizDeviceControlLog,
|
|
}
|
|
device := &dal3.Device{
|
|
DB: db,
|
|
}
|
|
deviceFishPond := &dal3.DeviceFishPond{
|
|
DB: db,
|
|
}
|
|
bizDevice := &biz3.Device{
|
|
Trans: trans,
|
|
DeviceDAL: device,
|
|
DeviceFishPondDAL: deviceFishPond,
|
|
}
|
|
apiDevice := &api3.Device{
|
|
DeviceBIZ: bizDevice,
|
|
}
|
|
bizDeviceFishPond := &biz3.DeviceFishPond{
|
|
Trans: trans,
|
|
DeviceFishPondDAL: deviceFishPond,
|
|
}
|
|
apiDeviceFishPond := &api3.DeviceFishPond{
|
|
DeviceFishPondBIZ: bizDeviceFishPond,
|
|
}
|
|
deviceTypeInfo := &dal3.DeviceTypeInfo{
|
|
DB: db,
|
|
}
|
|
bizDeviceTypeInfo := &biz3.DeviceTypeInfo{
|
|
Trans: trans,
|
|
DeviceTypeInfoDAL: deviceTypeInfo,
|
|
}
|
|
apiDeviceTypeInfo := &api3.DeviceTypeInfo{
|
|
DeviceTypeInfoBIZ: bizDeviceTypeInfo,
|
|
}
|
|
autoControl := &autocontrol.AutoControl{
|
|
DB: db,
|
|
DeviceRunLogAPI: apiDeviceRunLog,
|
|
DeviceControlLogAPI: apiDeviceControlLog,
|
|
DeviceAPI: apiDevice,
|
|
DeviceFishPondAPI: apiDeviceFishPond,
|
|
DeviceTypeInfoAPI: apiDeviceTypeInfo,
|
|
}
|
|
envMonitorDeviceTypeInfo := &dal4.EnvMonitorDeviceTypeInfo{
|
|
DB: db,
|
|
}
|
|
bizEnvMonitorDeviceTypeInfo := &biz4.EnvMonitorDeviceTypeInfo{
|
|
Trans: trans,
|
|
EnvMonitorDeviceTypeInfoDAL: envMonitorDeviceTypeInfo,
|
|
}
|
|
apiEnvMonitorDeviceTypeInfo := &api4.EnvMonitorDeviceTypeInfo{
|
|
EnvMonitorDeviceTypeInfoBIZ: bizEnvMonitorDeviceTypeInfo,
|
|
}
|
|
envMonitorDevice := &dal4.EnvMonitorDevice{
|
|
DB: db,
|
|
}
|
|
envMonitorDeviceFishPond := &dal4.EnvMonitorDeviceFishPond{
|
|
DB: db,
|
|
}
|
|
envMonitorDeviceSensor := &dal4.EnvMonitorDeviceSensor{
|
|
DB: db,
|
|
}
|
|
bizEnvMonitorDevice := &biz4.EnvMonitorDevice{
|
|
Trans: trans,
|
|
EnvMonitorDeviceDAL: envMonitorDevice,
|
|
EnvMonitorDeviceFishPondDAL: envMonitorDeviceFishPond,
|
|
EnvMonitorDeviceSensorDAL: envMonitorDeviceSensor,
|
|
}
|
|
apiEnvMonitorDevice := &api4.EnvMonitorDevice{
|
|
EnvMonitorDeviceBIZ: bizEnvMonitorDevice,
|
|
}
|
|
bizEnvMonitorDeviceFishPond := &biz4.EnvMonitorDeviceFishPond{
|
|
Trans: trans,
|
|
EnvMonitorDeviceFishPondDAL: envMonitorDeviceFishPond,
|
|
}
|
|
apiEnvMonitorDeviceFishPond := &api4.EnvMonitorDeviceFishPond{
|
|
EnvMonitorDeviceFishPondBIZ: bizEnvMonitorDeviceFishPond,
|
|
}
|
|
envMonitorDeviceWarningConfig := &dal4.EnvMonitorDeviceWarningConfig{
|
|
DB: db,
|
|
}
|
|
bizEnvMonitorDeviceWarningConfig := &biz4.EnvMonitorDeviceWarningConfig{
|
|
Trans: trans,
|
|
EnvMonitorDeviceWarningConfigDAL: envMonitorDeviceWarningConfig,
|
|
}
|
|
apiEnvMonitorDeviceWarningConfig := &api4.EnvMonitorDeviceWarningConfig{
|
|
EnvMonitorDeviceWarningConfigBIZ: bizEnvMonitorDeviceWarningConfig,
|
|
}
|
|
bizEnvMonitorDeviceSensor := &biz4.EnvMonitorDeviceSensor{
|
|
Trans: trans,
|
|
EnvMonitorDeviceSensorDAL: envMonitorDeviceSensor,
|
|
}
|
|
apiEnvMonitorDeviceSensor := &api4.EnvMonitorDeviceSensor{
|
|
EnvMonitorDeviceSensorBIZ: bizEnvMonitorDeviceSensor,
|
|
}
|
|
envMonitorDeviceWarningLog := &dal4.EnvMonitorDeviceWarningLog{
|
|
DB: db,
|
|
}
|
|
bizEnvMonitorDeviceWarningLog := &biz4.EnvMonitorDeviceWarningLog{
|
|
Trans: trans,
|
|
EnvMonitorDeviceWarningLogDAL: envMonitorDeviceWarningLog,
|
|
}
|
|
apiEnvMonitorDeviceWarningLog := &api4.EnvMonitorDeviceWarningLog{
|
|
EnvMonitorDeviceWarningLogBIZ: bizEnvMonitorDeviceWarningLog,
|
|
}
|
|
envMonitor := &envmonitor.EnvMonitor{
|
|
DB: db,
|
|
EnvMonitorDeviceTypeInfoAPI: apiEnvMonitorDeviceTypeInfo,
|
|
EnvMonitorDeviceAPI: apiEnvMonitorDevice,
|
|
EnvMonitorDeviceFishPondAPI: apiEnvMonitorDeviceFishPond,
|
|
EnvMonitorDeviceWarningConfigAPI: apiEnvMonitorDeviceWarningConfig,
|
|
EnvMonitorDeviceSensorAPI: apiEnvMonitorDeviceSensor,
|
|
EnvMonitorDeviceWarningLogAPI: apiEnvMonitorDeviceWarningLog,
|
|
}
|
|
modsMods := &mods.Mods{
|
|
RBAC: rbacRBAC,
|
|
DIGITAL: digitalDIGITAL,
|
|
AutoControl: autoControl,
|
|
EnvMonitor: envMonitor,
|
|
}
|
|
injector := &Injector{
|
|
DB: db,
|
|
Cache: cacher,
|
|
Auth: auther,
|
|
M: modsMods,
|
|
}
|
|
return injector, func() {
|
|
cleanup3()
|
|
cleanup2()
|
|
cleanup()
|
|
}, nil
|
|
}
|