devicemanagelogic

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2024 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RangeTypeAll = int64(iota)
	RangeTypeArea
	RangeTypeGroup
)
View Source
const (
	CountTypeStatus = "status"
	CountTypeType   = "type"
)
View Source
const (
	DeviceTransferToUser    = 1
	DeviceTransferToProject = 2
)

Variables

This section is empty.

Functions

func DeleteDeviceTimeData

func DeleteDeviceTimeData(ctx context.Context, svcCtx *svc.ServiceContext, productID, deviceName string) error

func FilterCanBindSubDevices

func FilterCanBindSubDevices(ctx context.Context, svcCtx *svc.ServiceContext, gateway *devices.Core, subDevices []*devices.Core, checkDevice CheckDevice) (ret []*devices.Core, err error)

func GenID

func GenID() uint32

func HandleOnlineFix

func HandleOnlineFix(ctx context.Context, svcCtx *svc.ServiceContext, insertList ...*deviceStatus.ConnectMsg) (err error)

func IsPhone added in v1.0.2

func IsPhone(mobile string) bool

识别手机号码

func Transfer

func Transfer()

Types

type CheckDevice

type CheckDevice int64
const (
	CheckDeviceExist CheckDevice = 1 << iota
	CheckDeviceType
	CheckDeviceStrict //严格模式
)

type DeviceCountLogic

type DeviceCountLogic struct {
	logx.Logger
	PiDB *relationDB.ProductInfoRepo
	DiDB *relationDB.DeviceInfoRepo
	// contains filtered or unexported fields
}

func NewDeviceCountLogic

func NewDeviceCountLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceCountLogic

func (*DeviceCountLogic) Count

func (l *DeviceCountLogic) Count(countTypes []string, f relationDB.DeviceFilter) (map[string]int64, error)

func (*DeviceCountLogic) DeviceCount

func (l *DeviceCountLogic) DeviceCount(in *dm.DeviceCountReq) (*dm.DeviceCountResp, error)

func (*DeviceCountLogic) FillFilter

func (l *DeviceCountLogic) FillFilter(rangeType int64, rangeID int64) (*relationDB.DeviceFilter, error)

type DeviceGatewayIndexLogic

type DeviceGatewayIndexLogic struct {
	logx.Logger
	GdDB *relationDB.GatewayDeviceRepo
	// contains filtered or unexported fields
}

func NewDeviceGatewayIndexLogic

func NewDeviceGatewayIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceGatewayIndexLogic

func (*DeviceGatewayIndexLogic) DeviceGatewayIndex

获取分组设备信息列表

type DeviceGatewayMultiCreateLogic

type DeviceGatewayMultiCreateLogic struct {
	logx.Logger
	PiDB *relationDB.ProductInfoRepo
	DiDB *relationDB.DeviceInfoRepo
	GdDB *relationDB.GatewayDeviceRepo
	// contains filtered or unexported fields
}

func NewDeviceGatewayMultiCreateLogic

func NewDeviceGatewayMultiCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceGatewayMultiCreateLogic

func (*DeviceGatewayMultiCreateLogic) DeviceGatewayMultiCreate

func (l *DeviceGatewayMultiCreateLogic) DeviceGatewayMultiCreate(in *dm.DeviceGatewayMultiCreateReq) (*dm.Empty, error)

创建分组设备

type DeviceGatewayMultiDeleteLogic

type DeviceGatewayMultiDeleteLogic struct {
	logx.Logger
	GdDB *relationDB.GatewayDeviceRepo
	// contains filtered or unexported fields
}

func NewDeviceGatewayMultiDeleteLogic

func NewDeviceGatewayMultiDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceGatewayMultiDeleteLogic

func (*DeviceGatewayMultiDeleteLogic) DeviceGatewayMultiDelete

func (l *DeviceGatewayMultiDeleteLogic) DeviceGatewayMultiDelete(in *dm.DeviceGatewayMultiSaveReq) (*dm.Empty, error)

删除分组设备

type DeviceGatewayMultiUpdateLogic

type DeviceGatewayMultiUpdateLogic struct {
	logx.Logger
	PiDB *relationDB.ProductInfoRepo
	DiDB *relationDB.DeviceInfoRepo
	GdDB *relationDB.GatewayDeviceRepo
	// contains filtered or unexported fields
}

func NewDeviceGatewayMultiUpdateLogic

func NewDeviceGatewayMultiUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceGatewayMultiUpdateLogic

func (*DeviceGatewayMultiUpdateLogic) DeviceGatewayMultiUpdate

func (l *DeviceGatewayMultiUpdateLogic) DeviceGatewayMultiUpdate(in *dm.DeviceGatewayMultiSaveReq) (*dm.Empty, error)

绑定网关下子设备设备

type DeviceInfoBindLogic

type DeviceInfoBindLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceInfoBindLogic

func NewDeviceInfoBindLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoBindLogic

func (*DeviceInfoBindLogic) DeviceInfoBind

func (l *DeviceInfoBindLogic) DeviceInfoBind(in *dm.DeviceInfoBindReq) (*dm.Empty, error)

type DeviceInfoCanBindLogic

type DeviceInfoCanBindLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceInfoCanBindLogic

func NewDeviceInfoCanBindLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoCanBindLogic

func (*DeviceInfoCanBindLogic) DeviceInfoCanBind

func (l *DeviceInfoCanBindLogic) DeviceInfoCanBind(in *dm.DeviceInfoCanBindReq) (*dm.Empty, error)

type DeviceInfoCountLogic

type DeviceInfoCountLogic struct {
	logx.Logger
	DiDB *relationDB.DeviceInfoRepo
	// contains filtered or unexported fields
}

func NewDeviceInfoCountLogic

func NewDeviceInfoCountLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoCountLogic

func (*DeviceInfoCountLogic) DeviceInfoCount

func (l *DeviceInfoCountLogic) DeviceInfoCount(in *dm.DeviceInfoCountReq) (*dm.DeviceInfoCount, error)

设备计数

type DeviceInfoCreateLogic

type DeviceInfoCreateLogic struct {
	logx.Logger
	PiDB *relationDB.ProductInfoRepo
	DiDB *relationDB.DeviceInfoRepo
	// contains filtered or unexported fields
}

func NewDeviceInfoCreateLogic

func NewDeviceInfoCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoCreateLogic

func (*DeviceInfoCreateLogic) CheckDevice

func (l *DeviceInfoCreateLogic) CheckDevice(in *dm.DeviceInfo) (bool, error)

发现返回true 没有返回false

func (*DeviceInfoCreateLogic) CheckProduct

func (l *DeviceInfoCreateLogic) CheckProduct(in *dm.DeviceInfo) (*dm.ProductInfo, error)

发现返回true 没有返回false

func (*DeviceInfoCreateLogic) DeviceInfoCreate

func (l *DeviceInfoCreateLogic) DeviceInfoCreate(in *dm.DeviceInfo) (resp *dm.Empty, err error)

新增设备

func (*DeviceInfoCreateLogic) InitDevice

func (l *DeviceInfoCreateLogic) InitDevice(in devices.Info) error

type DeviceInfoDeleteLogic

type DeviceInfoDeleteLogic struct {
	logx.Logger
	DiDB *relationDB.DeviceInfoRepo
	// contains filtered or unexported fields
}

func NewDeviceInfoDeleteLogic

func NewDeviceInfoDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoDeleteLogic

func (*DeviceInfoDeleteLogic) DeviceInfoDelete

func (l *DeviceInfoDeleteLogic) DeviceInfoDelete(in *dm.DeviceInfoDeleteReq) (*dm.Empty, error)

删除设备

type DeviceInfoIndexLogic

type DeviceInfoIndexLogic struct {
	logx.Logger
	DiDB *relationDB.DeviceInfoRepo
	// contains filtered or unexported fields
}

func NewDeviceInfoIndexLogic

func NewDeviceInfoIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoIndexLogic

func (*DeviceInfoIndexLogic) DeviceInfoIndex

获取设备信息列表

type DeviceInfoMultiBindLogic

type DeviceInfoMultiBindLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceInfoMultiBindLogic

func NewDeviceInfoMultiBindLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoMultiBindLogic

func (*DeviceInfoMultiBindLogic) DeviceInfoMultiBind

type DeviceInfoMultiUpdateLogic

type DeviceInfoMultiUpdateLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceInfoMultiUpdateLogic

func NewDeviceInfoMultiUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoMultiUpdateLogic

func (*DeviceInfoMultiUpdateLogic) DeviceInfoMultiUpdate

func (l *DeviceInfoMultiUpdateLogic) DeviceInfoMultiUpdate(in *dm.DeviceInfoMultiUpdateReq) (*dm.Empty, error)

批量更新设备状态

type DeviceInfoReadLogic

type DeviceInfoReadLogic struct {
	logx.Logger
	DiDB *relationDB.DeviceInfoRepo
	// contains filtered or unexported fields
}

func NewDeviceInfoReadLogic

func NewDeviceInfoReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoReadLogic

func (*DeviceInfoReadLogic) DeviceInfoRead

func (l *DeviceInfoReadLogic) DeviceInfoRead(in *dm.DeviceInfoReadReq) (*dm.DeviceInfo, error)

获取设备信息详情

type DeviceInfoUnbindLogic

type DeviceInfoUnbindLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceInfoUnbindLogic

func NewDeviceInfoUnbindLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoUnbindLogic

func (*DeviceInfoUnbindLogic) DeviceInfoUnbind

func (l *DeviceInfoUnbindLogic) DeviceInfoUnbind(in *dm.DeviceCore) (*dm.Empty, error)

type DeviceInfoUpdateLogic

type DeviceInfoUpdateLogic struct {
	logx.Logger
	PiDB *relationDB.ProductInfoRepo
	DiDB *relationDB.DeviceInfoRepo
	// contains filtered or unexported fields
}

func NewDeviceInfoUpdateLogic

func NewDeviceInfoUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoUpdateLogic

func (*DeviceInfoUpdateLogic) DeviceInfoUpdate

func (l *DeviceInfoUpdateLogic) DeviceInfoUpdate(in *dm.DeviceInfo) (*dm.Empty, error)

更新设备

func (*DeviceInfoUpdateLogic) SetDevicePoByDto

func (l *DeviceInfoUpdateLogic) SetDevicePoByDto(old *relationDB.DmDeviceInfo, data *dm.DeviceInfo) error

type DeviceModuleVersionIndexLogic

type DeviceModuleVersionIndexLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceModuleVersionIndexLogic

func NewDeviceModuleVersionIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceModuleVersionIndexLogic

func (*DeviceModuleVersionIndexLogic) DeviceModuleVersionIndex

type DeviceModuleVersionReadLogic

type DeviceModuleVersionReadLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceModuleVersionReadLogic

func NewDeviceModuleVersionReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceModuleVersionReadLogic

func (*DeviceModuleVersionReadLogic) DeviceModuleVersionRead

type DeviceMoveLogic

type DeviceMoveLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceMoveLogic

func NewDeviceMoveLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceMoveLogic

func (*DeviceMoveLogic) DeviceMove

func (l *DeviceMoveLogic) DeviceMove(in *dm.DeviceMoveReq) (*dm.Empty, error)

type DeviceOnlineMultiFixLogic

type DeviceOnlineMultiFixLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceOnlineMultiFixLogic

func NewDeviceOnlineMultiFixLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceOnlineMultiFixLogic

func (*DeviceOnlineMultiFixLogic) DeviceOnlineMultiFix

func (l *DeviceOnlineMultiFixLogic) DeviceOnlineMultiFix(in *dm.DeviceOnlineMultiFixReq) (*dm.Empty, error)

type DeviceProfileDeleteLogic

type DeviceProfileDeleteLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceProfileDeleteLogic

func NewDeviceProfileDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceProfileDeleteLogic

func (*DeviceProfileDeleteLogic) DeviceProfileDelete

func (l *DeviceProfileDeleteLogic) DeviceProfileDelete(in *dm.DeviceProfileReadReq) (*dm.Empty, error)

type DeviceProfileIndexLogic

type DeviceProfileIndexLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceProfileIndexLogic

func NewDeviceProfileIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceProfileIndexLogic

func (*DeviceProfileIndexLogic) DeviceProfileIndex

type DeviceProfileReadLogic

type DeviceProfileReadLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceProfileReadLogic

func NewDeviceProfileReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceProfileReadLogic

func (*DeviceProfileReadLogic) DeviceProfileRead

func (l *DeviceProfileReadLogic) DeviceProfileRead(in *dm.DeviceProfileReadReq) (*dm.DeviceProfile, error)

type DeviceProfileUpdateLogic

type DeviceProfileUpdateLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceProfileUpdateLogic

func NewDeviceProfileUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceProfileUpdateLogic

func (*DeviceProfileUpdateLogic) DeviceProfileUpdate

func (l *DeviceProfileUpdateLogic) DeviceProfileUpdate(in *dm.DeviceProfile) (*dm.Empty, error)

type DeviceSchemaCreateLogic added in v1.0.4

type DeviceSchemaCreateLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceSchemaCreateLogic added in v1.0.4

func NewDeviceSchemaCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceSchemaCreateLogic

func (*DeviceSchemaCreateLogic) DeviceSchemaCreate added in v1.0.4

func (l *DeviceSchemaCreateLogic) DeviceSchemaCreate(in *dm.DeviceSchema) (*dm.Empty, error)

新增设备

type DeviceSchemaIndexLogic added in v1.0.4

type DeviceSchemaIndexLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceSchemaIndexLogic added in v1.0.4

func NewDeviceSchemaIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceSchemaIndexLogic

func (*DeviceSchemaIndexLogic) DeviceSchemaIndex added in v1.0.4

获取设备物模型列表

type DeviceSchemaMultiCreateLogic added in v1.0.4

type DeviceSchemaMultiCreateLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceSchemaMultiCreateLogic added in v1.0.4

func NewDeviceSchemaMultiCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceSchemaMultiCreateLogic

func (*DeviceSchemaMultiCreateLogic) DeviceSchemaMultiCreate added in v1.0.4

func (l *DeviceSchemaMultiCreateLogic) DeviceSchemaMultiCreate(in *dm.DeviceSchemaMultiCreateReq) (*dm.Empty, error)

批量新增物模型,只新增没有的,已有的不处理

type DeviceSchemaMultiDeleteLogic added in v1.0.4

type DeviceSchemaMultiDeleteLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceSchemaMultiDeleteLogic added in v1.0.4

func NewDeviceSchemaMultiDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceSchemaMultiDeleteLogic

func (*DeviceSchemaMultiDeleteLogic) DeviceSchemaMultiDelete added in v1.0.4

func (l *DeviceSchemaMultiDeleteLogic) DeviceSchemaMultiDelete(in *dm.DeviceSchemaMultiDeleteReq) (*dm.Empty, error)

删除设备物模型

type DeviceSchemaTslReadLogic added in v1.0.4

type DeviceSchemaTslReadLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceSchemaTslReadLogic added in v1.0.4

func NewDeviceSchemaTslReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceSchemaTslReadLogic

func (*DeviceSchemaTslReadLogic) DeviceSchemaTslRead added in v1.0.4

type DeviceSchemaUpdateLogic added in v1.0.4

type DeviceSchemaUpdateLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceSchemaUpdateLogic added in v1.0.4

func NewDeviceSchemaUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceSchemaUpdateLogic

func (*DeviceSchemaUpdateLogic) DeviceSchemaUpdate added in v1.0.4

func (l *DeviceSchemaUpdateLogic) DeviceSchemaUpdate(in *dm.DeviceSchema) (*dm.Empty, error)

更新设备物模型

type DeviceTransferLogic

type DeviceTransferLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceTransferLogic

func NewDeviceTransferLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceTransferLogic

func (*DeviceTransferLogic) DeviceTransfer

func (l *DeviceTransferLogic) DeviceTransfer(in *dm.DeviceTransferReq) (*dm.Empty, error)

type DeviceTypeCountLogic

type DeviceTypeCountLogic struct {
	logx.Logger
	PiDB *relationDB.ProductInfoRepo
	DiDB *relationDB.DeviceInfoRepo
	// contains filtered or unexported fields
}

func NewDeviceTypeCountLogic

func NewDeviceTypeCountLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceTypeCountLogic

func (*DeviceTypeCountLogic) DeviceTypeCount

设备类型

type RootCheckLogic

type RootCheckLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewRootCheckLogic

func NewRootCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RootCheckLogic

func (*RootCheckLogic) RootCheck

func (l *RootCheckLogic) RootCheck(in *dm.RootCheckReq) (*dm.Empty, error)

鉴定是否是root账号(提供给mqtt broker)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL