Documentation ¶
Index ¶
- Constants
- func DeleteDeviceTimeData(ctx context.Context, svcCtx *svc.ServiceContext, productID, deviceName string) error
- func FilterCanBindSubDevices(ctx context.Context, svcCtx *svc.ServiceContext, gateway *devices.Core, ...) (ret []*devices.Core, err error)
- func GenID() uint32
- func HandleOnlineFix(ctx context.Context, svcCtx *svc.ServiceContext, ...) (err error)
- func IsPhone(mobile string) bool
- func Transfer()
- type CheckDevice
- type DeviceCountLogic
- func (l *DeviceCountLogic) Count(countTypes []string, f relationDB.DeviceFilter) (map[string]int64, error)
- func (l *DeviceCountLogic) DeviceCount(in *dm.DeviceCountReq) (*dm.DeviceCountResp, error)
- func (l *DeviceCountLogic) FillFilter(rangeType int64, rangeID int64) (*relationDB.DeviceFilter, error)
- type DeviceGatewayIndexLogic
- type DeviceGatewayMultiCreateLogic
- type DeviceGatewayMultiDeleteLogic
- type DeviceGatewayMultiUpdateLogic
- type DeviceInfoBindLogic
- type DeviceInfoCanBindLogic
- type DeviceInfoCountLogic
- type DeviceInfoCreateLogic
- func (l *DeviceInfoCreateLogic) CheckDevice(in *dm.DeviceInfo) (bool, error)
- func (l *DeviceInfoCreateLogic) CheckProduct(in *dm.DeviceInfo) (*dm.ProductInfo, error)
- func (l *DeviceInfoCreateLogic) DeviceInfoCreate(in *dm.DeviceInfo) (resp *dm.Empty, err error)
- func (l *DeviceInfoCreateLogic) InitDevice(in devices.Info) error
- type DeviceInfoDeleteLogic
- type DeviceInfoIndexLogic
- type DeviceInfoMultiBindLogic
- type DeviceInfoMultiUpdateLogic
- type DeviceInfoReadLogic
- type DeviceInfoUnbindLogic
- type DeviceInfoUpdateLogic
- type DeviceModuleVersionIndexLogic
- type DeviceModuleVersionReadLogic
- type DeviceMoveLogic
- type DeviceOnlineMultiFixLogic
- type DeviceProfileDeleteLogic
- type DeviceProfileIndexLogic
- type DeviceProfileReadLogic
- type DeviceProfileUpdateLogic
- type DeviceSchemaCreateLogic
- type DeviceSchemaIndexLogic
- type DeviceSchemaMultiCreateLogic
- type DeviceSchemaMultiDeleteLogic
- type DeviceSchemaTslReadLogic
- type DeviceSchemaUpdateLogic
- type DeviceTransferLogic
- type DeviceTypeCountLogic
- type RootCheckLogic
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 FilterCanBindSubDevices ¶
func HandleOnlineFix ¶
func HandleOnlineFix(ctx context.Context, svcCtx *svc.ServiceContext, insertList ...*deviceStatus.ConnectMsg) (err error)
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 ¶
func (l *DeviceGatewayIndexLogic) DeviceGatewayIndex(in *dm.DeviceGatewayIndexReq) (*dm.DeviceGatewayIndexResp, error)
获取分组设备信息列表
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 ¶
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 ¶
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 ¶
func (l *DeviceInfoIndexLogic) DeviceInfoIndex(in *dm.DeviceInfoIndexReq) (*dm.DeviceInfoIndexResp, error)
获取设备信息列表
type DeviceInfoMultiBindLogic ¶
func NewDeviceInfoMultiBindLogic ¶
func NewDeviceInfoMultiBindLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceInfoMultiBindLogic
func (*DeviceInfoMultiBindLogic) DeviceInfoMultiBind ¶
func (l *DeviceInfoMultiBindLogic) DeviceInfoMultiBind(in *dm.DeviceInfoMultiBindReq) (*dm.DeviceInfoMultiBindResp, error)
type DeviceInfoMultiUpdateLogic ¶
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 ¶
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 ¶
func NewDeviceModuleVersionIndexLogic ¶
func NewDeviceModuleVersionIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceModuleVersionIndexLogic
func (*DeviceModuleVersionIndexLogic) DeviceModuleVersionIndex ¶
func (l *DeviceModuleVersionIndexLogic) DeviceModuleVersionIndex(in *dm.DeviceModuleVersionIndexReq) (*dm.DeviceModuleVersionIndexResp, error)
type DeviceModuleVersionReadLogic ¶
func NewDeviceModuleVersionReadLogic ¶
func NewDeviceModuleVersionReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceModuleVersionReadLogic
func (*DeviceModuleVersionReadLogic) DeviceModuleVersionRead ¶
func (l *DeviceModuleVersionReadLogic) DeviceModuleVersionRead(in *dm.DeviceModuleVersionReadReq) (*dm.DeviceModuleVersion, error)
type DeviceMoveLogic ¶
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 ¶
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 ¶
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 ¶
func NewDeviceProfileIndexLogic ¶
func NewDeviceProfileIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceProfileIndexLogic
func (*DeviceProfileIndexLogic) DeviceProfileIndex ¶
func (l *DeviceProfileIndexLogic) DeviceProfileIndex(in *dm.DeviceProfileIndexReq) (*dm.DeviceProfileIndexResp, error)
type DeviceProfileReadLogic ¶
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 ¶
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
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
func NewDeviceSchemaIndexLogic ¶ added in v1.0.4
func NewDeviceSchemaIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceSchemaIndexLogic
func (*DeviceSchemaIndexLogic) DeviceSchemaIndex ¶ added in v1.0.4
func (l *DeviceSchemaIndexLogic) DeviceSchemaIndex(in *dm.DeviceSchemaIndexReq) (*dm.DeviceSchemaIndexResp, error)
获取设备物模型列表
type DeviceSchemaMultiCreateLogic ¶ added in v1.0.4
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
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
func NewDeviceSchemaTslReadLogic ¶ added in v1.0.4
func NewDeviceSchemaTslReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceSchemaTslReadLogic
func (*DeviceSchemaTslReadLogic) DeviceSchemaTslRead ¶ added in v1.0.4
func (l *DeviceSchemaTslReadLogic) DeviceSchemaTslRead(in *dm.DeviceSchemaTslReadReq) (*dm.DeviceSchemaTslReadResp, error)
type DeviceSchemaUpdateLogic ¶ added in v1.0.4
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 ¶
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 ¶
func (l *DeviceTypeCountLogic) DeviceTypeCount(in *dm.DeviceTypeCountReq) (*dm.DeviceTypeCountResp, error)
设备类型
type RootCheckLogic ¶
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)
Source Files ¶
- deviceCountLogic.go
- deviceGatewayIndexLogic.go
- deviceGatewayMultiCreateLogic.go
- deviceGatewayMultiDeleteLogic.go
- deviceGatewayMultiUpdateLogic.go
- deviceInfoBindLogic.go
- deviceInfoCanBindLogic.go
- deviceInfoCountLogic.go
- deviceInfoCreateLogic.go
- deviceInfoDeleteLogic.go
- deviceInfoIndexLogic.go
- deviceInfoMultiBindLogic.go
- deviceInfoMultiUpdateLogic.go
- deviceInfoReadLogic.go
- deviceInfoUnbindLogic.go
- deviceInfoUpdateLogic.go
- deviceModuleVersionIndexLogic.go
- deviceModuleVersionReadLogic.go
- deviceMoveLogic.go
- deviceOnlineMultiFixLogic.go
- deviceProfileDeleteLogic.go
- deviceProfileIndexLogic.go
- deviceProfileReadLogic.go
- deviceProfileUpdateLogic.go
- deviceSchemaCreateLogic.go
- deviceSchemaIndexLogic.go
- deviceSchemaMultiCreateLogic.go
- deviceSchemaMultiDeleteLogic.go
- deviceSchemaTslReadLogic.go
- deviceSchemaUpdateLogic.go
- deviceTransferLogic.go
- deviceTypeCountLogic.go
- rootCheckLogic.go
Click to show internal directories.
Click to hide internal directories.