Documentation ¶
Index ¶
- Constants
- Variables
- func CommonToSchemaDo(in []*DmCommonSchema) *schema.Model
- func Migrate(c conf.Database) error
- func NewShadowRepo(in any) shadow.Repo
- func ToActionDo(in *DmSchemaCore) *schema.Action
- func ToAffordancePo(in any) string
- func ToCommonParam(in *DmSchemaCore) schema.CommonParam
- func ToDeviceSchemaDo(productID string, in []*DmDeviceSchema) *schema.Model
- func ToEventDo(in *DmSchemaCore) *schema.Event
- func ToPropertyDo(in *DmSchemaCore) *schema.Property
- func ToSchemaDo(productID string, in []*DmSchemaInfo) *schema.Model
- func ToShadowDo(in *DmDeviceShadow) *shadow.Info
- func ToShadowsDo(in []*DmDeviceShadow) []*shadow.Info
- type CommonSchemaFilter
- type CommonSchemaRepo
- func (p CommonSchemaRepo) CountByFilter(ctx context.Context, f CommonSchemaFilter) (size int64, err error)
- func (p CommonSchemaRepo) DeleteByFilter(ctx context.Context, f CommonSchemaFilter) error
- func (p CommonSchemaRepo) FindByFilter(ctx context.Context, f CommonSchemaFilter, page *stores.PageInfo) ([]*DmCommonSchema, error)
- func (p CommonSchemaRepo) FindOneByFilter(ctx context.Context, f CommonSchemaFilter) (*DmCommonSchema, error)
- func (p CommonSchemaRepo) Insert(ctx context.Context, data *DmCommonSchema) error
- func (p CommonSchemaRepo) Update(ctx context.Context, data *DmCommonSchema) error
- type DeviceFilter
- type DeviceInfoRepo
- func (d DeviceInfoRepo) CountByFilter(ctx context.Context, f DeviceFilter) (size int64, err error)
- func (d DeviceInfoRepo) CountGroupByField(ctx context.Context, f DeviceFilter, columnName string) (map[string]int64, error)
- func (d DeviceInfoRepo) Delete(ctx context.Context, id int64) error
- func (d DeviceInfoRepo) FindByFilter(ctx context.Context, f DeviceFilter, page *stores.PageInfo) ([]*DmDeviceInfo, error)
- func (d DeviceInfoRepo) FindCoreByFilter(ctx context.Context, f DeviceFilter, page *stores.PageInfo) ([]devices.Core, error)
- func (d DeviceInfoRepo) FindOneByFilter(ctx context.Context, f DeviceFilter) (*DmDeviceInfo, error)
- func (d DeviceInfoRepo) FindProductIDsByFilter(ctx context.Context, f DeviceFilter) ([]string, error)
- func (d DeviceInfoRepo) Insert(ctx context.Context, data *DmDeviceInfo) error
- func (d DeviceInfoRepo) MultiUpdate(ctx context.Context, devices []*devices.Core, info *DmDeviceInfo, ...) error
- func (d DeviceInfoRepo) Update(ctx context.Context, data *DmDeviceInfo) error
- func (d DeviceInfoRepo) UpdateOfflineStatus(ctx context.Context, f DeviceFilter) error
- func (d DeviceInfoRepo) UpdateWithField(ctx context.Context, f DeviceFilter, updates map[string]any) error
- type DeviceModuleVersionFilter
- type DeviceModuleVersionRepo
- func (p DeviceModuleVersionRepo) CountByFilter(ctx context.Context, f DeviceModuleVersionFilter) (size int64, err error)
- func (p DeviceModuleVersionRepo) Delete(ctx context.Context, id int64) error
- func (p DeviceModuleVersionRepo) DeleteByFilter(ctx context.Context, f DeviceModuleVersionFilter) error
- func (p DeviceModuleVersionRepo) FindByFilter(ctx context.Context, f DeviceModuleVersionFilter, page *stores.PageInfo) ([]*DmDeviceModuleVersion, error)
- func (p DeviceModuleVersionRepo) FindOne(ctx context.Context, id int64) (*DmDeviceModuleVersion, error)
- func (p DeviceModuleVersionRepo) FindOneByFilter(ctx context.Context, f DeviceModuleVersionFilter) (*DmDeviceModuleVersion, error)
- func (p DeviceModuleVersionRepo) Insert(ctx context.Context, data *DmDeviceModuleVersion) error
- func (p DeviceModuleVersionRepo) MultiInsert(ctx context.Context, data []*DmDeviceModuleVersion) error
- func (p DeviceModuleVersionRepo) Update(ctx context.Context, data *DmDeviceModuleVersion) error
- type DeviceMsgCountFilter
- type DeviceMsgCountRepo
- func (p DeviceMsgCountRepo) CountByFilter(ctx context.Context, f DeviceMsgCountFilter) (size int64, err error)
- func (p DeviceMsgCountRepo) Delete(ctx context.Context, id int64) error
- func (p DeviceMsgCountRepo) DeleteByFilter(ctx context.Context, f DeviceMsgCountFilter) error
- func (p DeviceMsgCountRepo) FindByFilter(ctx context.Context, f DeviceMsgCountFilter, page *stores.PageInfo) ([]*DmDeviceMsgCount, error)
- func (p DeviceMsgCountRepo) FindOne(ctx context.Context, id int64) (*DmDeviceMsgCount, error)
- func (p DeviceMsgCountRepo) FindOneByFilter(ctx context.Context, f DeviceMsgCountFilter) (*DmDeviceMsgCount, error)
- func (p DeviceMsgCountRepo) Insert(ctx context.Context, data *DmDeviceMsgCount) error
- func (p DeviceMsgCountRepo) MultiInsert(ctx context.Context, data []*DmDeviceMsgCount) error
- func (p DeviceMsgCountRepo) Update(ctx context.Context, data *DmDeviceMsgCount) error
- func (d DeviceMsgCountRepo) UpdateWithField(ctx context.Context, f DeviceMsgCountFilter, updates map[string]any) error
- type DeviceProfileFilter
- type DeviceProfileRepo
- func (p DeviceProfileRepo) CountByFilter(ctx context.Context, f DeviceProfileFilter) (size int64, err error)
- func (p DeviceProfileRepo) Delete(ctx context.Context, id int64) error
- func (p DeviceProfileRepo) DeleteByFilter(ctx context.Context, f DeviceProfileFilter) error
- func (p DeviceProfileRepo) FindByFilter(ctx context.Context, f DeviceProfileFilter, page *stores.PageInfo) ([]*DmDeviceProfile, error)
- func (p DeviceProfileRepo) FindOne(ctx context.Context, id int64) (*DmDeviceProfile, error)
- func (p DeviceProfileRepo) FindOneByFilter(ctx context.Context, f DeviceProfileFilter) (*DmDeviceProfile, error)
- func (p DeviceProfileRepo) Insert(ctx context.Context, data *DmDeviceProfile) error
- func (p DeviceProfileRepo) MultiInsert(ctx context.Context, data []*DmDeviceProfile) error
- func (p DeviceProfileRepo) Update(ctx context.Context, data *DmDeviceProfile) error
- func (d DeviceProfileRepo) UpdateWithField(ctx context.Context, f DeviceProfileFilter, updates map[string]any) error
- type DeviceSchemaFilter
- type DeviceSchemaRepo
- func (p DeviceSchemaRepo) CountByFilter(ctx context.Context, f DeviceSchemaFilter) (size int64, err error)
- func (p DeviceSchemaRepo) DeleteByFilter(ctx context.Context, f DeviceSchemaFilter) error
- func (p DeviceSchemaRepo) FindByFilter(ctx context.Context, f DeviceSchemaFilter, page *stores.PageInfo) ([]*DmDeviceSchema, error)
- func (p DeviceSchemaRepo) FindOneByFilter(ctx context.Context, f DeviceSchemaFilter) (*DmDeviceSchema, error)
- func (p DeviceSchemaRepo) Insert(ctx context.Context, data *DmDeviceSchema) error
- func (p DeviceSchemaRepo) MultiInsert(ctx context.Context, data []*DmDeviceSchema) error
- func (p DeviceSchemaRepo) MultiInsert2(ctx context.Context, productID string, deviceName string, ...) error
- func (p DeviceSchemaRepo) MultiUpdate(ctx context.Context, productID string, deviceName string, ...) error
- func (p DeviceSchemaRepo) Update(ctx context.Context, data *DmDeviceSchema) error
- func (p DeviceSchemaRepo) UpdateTag(ctx context.Context, productIDs []string, identifiers []string, ...) error
- type DmCommonSchema
- type DmDeviceInfo
- type DmDeviceModuleVersion
- type DmDeviceMsgCount
- type DmDeviceProfile
- type DmDeviceSchema
- type DmDeviceShadow
- type DmExample
- type DmGatewayDevice
- type DmGroupDevice
- type DmGroupInfo
- type DmManufacturerInfo
- type DmOtaFirmwareDevice
- type DmOtaFirmwareFile
- type DmOtaFirmwareInfo
- type DmOtaFirmwareJob
- type DmOtaFirmwareJobDynamic
- type DmOtaFirmwareJobStatic
- type DmOtaModuleInfo
- type DmProductCategory
- type DmProductCategorySchema
- type DmProductCustom
- type DmProductID
- type DmProductInfo
- type DmProductRemoteConfig
- type DmProductSchema
- type DmProtocolInfo
- type DmProtocolService
- type DmSchemaCore
- type DmSchemaInfo
- type DmUserDeviceCollect
- type DmUserDeviceShare
- type ExampleFilter
- type ExampleRepo
- func (p ExampleRepo) CountByFilter(ctx context.Context, f ExampleFilter) (size int64, err error)
- func (p ExampleRepo) Delete(ctx context.Context, id int64) error
- func (p ExampleRepo) DeleteByFilter(ctx context.Context, f ExampleFilter) error
- func (p ExampleRepo) FindByFilter(ctx context.Context, f ExampleFilter, page *stores.PageInfo) ([]*DmExample, error)
- func (p ExampleRepo) FindOne(ctx context.Context, id int64) (*DmExample, error)
- func (p ExampleRepo) FindOneByFilter(ctx context.Context, f ExampleFilter) (*DmExample, error)
- func (p ExampleRepo) Insert(ctx context.Context, data *DmExample) error
- func (p ExampleRepo) MultiInsert(ctx context.Context, data []*DmExample) error
- func (p ExampleRepo) Update(ctx context.Context, data *DmExample) error
- func (d ExampleRepo) UpdateWithField(ctx context.Context, f ExampleFilter, updates map[string]any) error
- type GatewayDeviceFilter
- type GatewayDeviceRepo
- func (g GatewayDeviceRepo) CountByFilter(ctx context.Context, f GatewayDeviceFilter) (size int64, err error)
- func (m GatewayDeviceRepo) DeleteDevAll(ctx context.Context, dev devices.Core) error
- func (g GatewayDeviceRepo) FindByFilter(ctx context.Context, f GatewayDeviceFilter, page *stores.PageInfo) ([]*DmGatewayDevice, error)
- func (p GatewayDeviceRepo) FindOneByFilter(ctx context.Context, f GatewayDeviceFilter) (*DmGatewayDevice, error)
- func (m GatewayDeviceRepo) MultiDelete(ctx context.Context, gateway *devices.Core, subDevice []*devices.Core) error
- func (m GatewayDeviceRepo) MultiInsert(ctx context.Context, gateway *devices.Core, subDevice []*devices.Core) error
- type GroupDeviceFilter
- type GroupDeviceRepo
- func (p GroupDeviceRepo) CountByFilter(ctx context.Context, f GroupDeviceFilter) (size int64, err error)
- func (p GroupDeviceRepo) DeleteByFilter(ctx context.Context, f GroupDeviceFilter) error
- func (p GroupDeviceRepo) FindByFilter(ctx context.Context, f GroupDeviceFilter, page *stores.PageInfo) ([]*DmGroupDevice, error)
- func (p GroupDeviceRepo) FindOneByFilter(ctx context.Context, f GroupDeviceFilter) (*DmGroupDevice, error)
- func (m GroupDeviceRepo) MultiDelete(ctx context.Context, groupID int64, data []*devices.Core) error
- func (m GroupDeviceRepo) MultiInsert(ctx context.Context, data []*DmGroupDevice) error
- func (p GroupDeviceRepo) MultiUpdate(ctx context.Context, groupID int64, devices []*DmGroupDevice) error
- type GroupInfoFilter
- type GroupInfoRepo
- func (p GroupInfoRepo) CountByFilter(ctx context.Context, f GroupInfoFilter) (size int64, err error)
- func (p GroupInfoRepo) Delete(ctx context.Context, id int64) error
- func (g GroupInfoRepo) DeleteByFilter(ctx context.Context, f GroupInfoFilter) error
- func (p GroupInfoRepo) FindByFilter(ctx context.Context, f GroupInfoFilter, page *stores.PageInfo) ([]*DmGroupInfo, error)
- func (p GroupInfoRepo) FindOne(ctx context.Context, id int64) (*DmGroupInfo, error)
- func (g GroupInfoRepo) FindOneByFilter(ctx context.Context, f GroupInfoFilter) (*DmGroupInfo, error)
- func (g GroupInfoRepo) Insert(ctx context.Context, data *DmGroupInfo) error
- func (g GroupInfoRepo) Update(ctx context.Context, data *DmGroupInfo) error
- func (g GroupInfoRepo) UpdateGroupDeviceCount(ctx context.Context, id int64) error
- func (d GroupInfoRepo) UpdateWithField(ctx context.Context, f GroupInfoFilter, updates map[string]any) error
- type OtaFirmwareDeviceFilter
- type OtaFirmwareDeviceRepo
- func (p OtaFirmwareDeviceRepo) BatchUpdateField(ctx context.Context, f OtaFirmwareDeviceFilter, ...) error
- func (p OtaFirmwareDeviceRepo) CountByFilter(ctx context.Context, f OtaFirmwareDeviceFilter) (size int64, err error)
- func (p OtaFirmwareDeviceRepo) Delete(ctx context.Context, id int64) error
- func (p OtaFirmwareDeviceRepo) DeleteByFilter(ctx context.Context, f OtaFirmwareDeviceFilter) error
- func (p OtaFirmwareDeviceRepo) FindByFilter(ctx context.Context, f OtaFirmwareDeviceFilter, page *stores.PageInfo) ([]*DmOtaFirmwareDevice, error)
- func (p OtaFirmwareDeviceRepo) FindByFilters(ctx context.Context, f []OtaFirmwareDeviceFilter, page *stores.PageInfo) ([]*DmOtaFirmwareDevice, error)
- func (p OtaFirmwareDeviceRepo) FindOne(ctx context.Context, id int64) (*DmOtaFirmwareDevice, error)
- func (p OtaFirmwareDeviceRepo) FindOneByFilter(ctx context.Context, f OtaFirmwareDeviceFilter) (*DmOtaFirmwareDevice, error)
- func (p OtaFirmwareDeviceRepo) Insert(ctx context.Context, data *DmOtaFirmwareDevice) error
- func (p OtaFirmwareDeviceRepo) MultiInsert(ctx context.Context, data []*DmOtaFirmwareDevice) error
- func (p OtaFirmwareDeviceRepo) Update(ctx context.Context, data *DmOtaFirmwareDevice) error
- func (p OtaFirmwareDeviceRepo) UpdateStatusByFilter(ctx context.Context, f OtaFirmwareDeviceFilter, status int64, detail string) error
- func (p OtaFirmwareDeviceRepo) UpdateStatusByFilters(ctx context.Context, f []OtaFirmwareDeviceFilter, status int64, detail string) error
- type OtaFirmwareFileFilter
- type OtaFirmwareFileRepo
- func (p OtaFirmwareFileRepo) CountByFilter(ctx context.Context, f OtaFirmwareFileFilter) (size int64, err error)
- func (g OtaFirmwareFileRepo) Delete(ctx context.Context, id int64) error
- func (g OtaFirmwareFileRepo) DeleteByFilter(ctx context.Context, f OtaFirmwareFileFilter) error
- func (p OtaFirmwareFileRepo) FindByFilter(ctx context.Context, f OtaFirmwareFileFilter, page *stores.PageInfo) ([]*DmOtaFirmwareFile, error)
- func (g OtaFirmwareFileRepo) FindOne(ctx context.Context, id int64) (*DmOtaFirmwareFile, error)
- func (g OtaFirmwareFileRepo) FindOneByFilter(ctx context.Context, f OtaFirmwareFileFilter) (*DmOtaFirmwareFile, error)
- func (g OtaFirmwareFileRepo) Insert(ctx context.Context, data *DmOtaFirmwareFile) error
- func (m OtaFirmwareFileRepo) MultiInsert(ctx context.Context, data []*DmOtaFirmwareFile) error
- func (g OtaFirmwareFileRepo) Update(ctx context.Context, data *DmOtaFirmwareFile) error
- type OtaFirmwareInfoFilter
- type OtaFirmwareInfoRepo
- func (p OtaFirmwareInfoRepo) CountByFilter(ctx context.Context, f OtaFirmwareInfoFilter) (size int64, err error)
- func (g OtaFirmwareInfoRepo) Delete(ctx context.Context, id int64) error
- func (g OtaFirmwareInfoRepo) DeleteByFilter(ctx context.Context, f OtaFirmwareInfoFilter) error
- func (p OtaFirmwareInfoRepo) FindByFilter(ctx context.Context, f OtaFirmwareInfoFilter, page *stores.PageInfo) ([]*DmOtaFirmwareInfo, error)
- func (g OtaFirmwareInfoRepo) FindOne(ctx context.Context, id int64) (*DmOtaFirmwareInfo, error)
- func (g OtaFirmwareInfoRepo) FindOneByFilter(ctx context.Context, f OtaFirmwareInfoFilter) (*DmOtaFirmwareInfo, error)
- func (g OtaFirmwareInfoRepo) Insert(ctx context.Context, data *DmOtaFirmwareInfo) error
- func (m OtaFirmwareInfoRepo) MultiInsert(ctx context.Context, data []*DmOtaFirmwareInfo) error
- func (g OtaFirmwareInfoRepo) Update(ctx context.Context, data *DmOtaFirmwareInfo) error
- type OtaJobFilter
- type OtaJobRepo
- func (p OtaJobRepo) CountByFilter(ctx context.Context, f OtaJobFilter) (size int64, err error)
- func (p OtaJobRepo) Delete(ctx context.Context, id int64) error
- func (p OtaJobRepo) DeleteByFilter(ctx context.Context, f OtaJobFilter) error
- func (p OtaJobRepo) FindByFilter(ctx context.Context, f OtaJobFilter, page *stores.PageInfo) ([]*DmOtaFirmwareJob, error)
- func (p OtaJobRepo) FindOne(ctx context.Context, id int64) (*DmOtaFirmwareJob, error)
- func (p OtaJobRepo) FindOneByFilter(ctx context.Context, f OtaJobFilter) (*DmOtaFirmwareJob, error)
- func (p OtaJobRepo) Insert(ctx context.Context, data *DmOtaFirmwareJob) error
- func (p OtaJobRepo) MultiInsert(ctx context.Context, data []*DmOtaFirmwareJob) error
- func (p OtaJobRepo) Update(ctx context.Context, data *DmOtaFirmwareJob) error
- type OtaModuleInfoFilter
- type OtaModuleInfoRepo
- func (p OtaModuleInfoRepo) CountByFilter(ctx context.Context, f OtaModuleInfoFilter) (size int64, err error)
- func (p OtaModuleInfoRepo) Delete(ctx context.Context, id int64) error
- func (p OtaModuleInfoRepo) DeleteByFilter(ctx context.Context, f OtaModuleInfoFilter) error
- func (p OtaModuleInfoRepo) FindByFilter(ctx context.Context, f OtaModuleInfoFilter, page *stores.PageInfo) ([]*DmOtaModuleInfo, error)
- func (p OtaModuleInfoRepo) FindOne(ctx context.Context, id int64) (*DmOtaModuleInfo, error)
- func (p OtaModuleInfoRepo) FindOneByFilter(ctx context.Context, f OtaModuleInfoFilter) (*DmOtaModuleInfo, error)
- func (p OtaModuleInfoRepo) Insert(ctx context.Context, data *DmOtaModuleInfo) error
- func (p OtaModuleInfoRepo) MultiInsert(ctx context.Context, data []*DmOtaModuleInfo) error
- func (p OtaModuleInfoRepo) Update(ctx context.Context, data *DmOtaModuleInfo) error
- type ProductCategoryFilter
- type ProductCategoryRepo
- func (p ProductCategoryRepo) CountByFilter(ctx context.Context, f ProductCategoryFilter) (size int64, err error)
- func (p ProductCategoryRepo) Delete(ctx context.Context, id int64) error
- func (p ProductCategoryRepo) DeleteByFilter(ctx context.Context, f ProductCategoryFilter) error
- func (p ProductCategoryRepo) FindByFilter(ctx context.Context, f ProductCategoryFilter, page *stores.PageInfo) ([]*DmProductCategory, error)
- func (p ProductCategoryRepo) FindOne(ctx context.Context, id int64) (*DmProductCategory, error)
- func (p ProductCategoryRepo) FindOneByFilter(ctx context.Context, f ProductCategoryFilter) (*DmProductCategory, error)
- func (p ProductCategoryRepo) Insert(ctx context.Context, data *DmProductCategory) error
- func (p ProductCategoryRepo) MultiInsert(ctx context.Context, data []*DmProductCategory) error
- func (p ProductCategoryRepo) Update(ctx context.Context, data *DmProductCategory) error
- func (d ProductCategoryRepo) UpdateWithField(ctx context.Context, f ProductCategoryFilter, updates map[string]any) error
- type ProductCategorySchemaFilter
- type ProductCategorySchemaRepo
- func (p ProductCategorySchemaRepo) CountByFilter(ctx context.Context, f ProductCategorySchemaFilter) (size int64, err error)
- func (p ProductCategorySchemaRepo) Delete(ctx context.Context, id int64) error
- func (p ProductCategorySchemaRepo) DeleteByFilter(ctx context.Context, f ProductCategorySchemaFilter) error
- func (p ProductCategorySchemaRepo) FindByFilter(ctx context.Context, f ProductCategorySchemaFilter, page *stores.PageInfo) ([]*DmProductCategorySchema, error)
- func (p ProductCategorySchemaRepo) FindOne(ctx context.Context, id int64) (*DmProductCategorySchema, error)
- func (p ProductCategorySchemaRepo) FindOneByFilter(ctx context.Context, f ProductCategorySchemaFilter) (*DmProductCategorySchema, error)
- func (p ProductCategorySchemaRepo) Insert(ctx context.Context, data *DmProductCategorySchema) error
- func (p ProductCategorySchemaRepo) MultiInsert(ctx context.Context, data []*DmProductCategorySchema) error
- func (p ProductCategorySchemaRepo) MultiUpdate(ctx context.Context, productCategoryID int64, identifiers []string) error
- func (p ProductCategorySchemaRepo) Update(ctx context.Context, data *DmProductCategorySchema) error
- type ProductCustomRepo
- type ProductCustomUi
- type ProductFilter
- type ProductIDFilter
- type ProductIDRepo
- func (p ProductIDRepo) CountByFilter(ctx context.Context, f ProductIDFilter) (size int64, err error)
- func (p ProductIDRepo) Delete(ctx context.Context, id int64) error
- func (p ProductIDRepo) DeleteByFilter(ctx context.Context, f ProductIDFilter) error
- func (p ProductIDRepo) FindByFilter(ctx context.Context, f ProductIDFilter, page *stores.PageInfo) ([]*DmProductID, error)
- func (p ProductIDRepo) FindOne(ctx context.Context, id int64) (*DmProductID, error)
- func (p ProductIDRepo) FindOneByFilter(ctx context.Context, f ProductIDFilter) (*DmProductID, error)
- func (p ProductIDRepo) GenID(ctx context.Context) (int64, error)
- func (p ProductIDRepo) Insert(ctx context.Context, data *DmProductID) error
- func (p ProductIDRepo) MultiInsert(ctx context.Context, data []*DmProductID) error
- func (p ProductIDRepo) Update(ctx context.Context, data *DmProductID) error
- func (d ProductIDRepo) UpdateWithField(ctx context.Context, f ProductIDFilter, updates map[string]any) error
- type ProductInfoRepo
- func (p ProductInfoRepo) CountByFilter(ctx context.Context, f ProductFilter) (size int64, err error)
- func (p ProductInfoRepo) DeleteByFilter(ctx context.Context, f ProductFilter) error
- func (p ProductInfoRepo) FindByFilter(ctx context.Context, f ProductFilter, page *stores.PageInfo) ([]*DmProductInfo, error)
- func (p ProductInfoRepo) FindOneByFilter(ctx context.Context, f ProductFilter) (*DmProductInfo, error)
- func (p ProductInfoRepo) Insert(ctx context.Context, data *DmProductInfo) error
- func (p ProductInfoRepo) Update(ctx context.Context, data *DmProductInfo) error
- type ProductRemoteConfigRepo
- func (p ProductRemoteConfigRepo) CountByFilter(ctx context.Context, f RemoteConfigFilter) (size int64, err error)
- func (p ProductRemoteConfigRepo) DeleteByFilter(ctx context.Context, f RemoteConfigFilter) error
- func (p ProductRemoteConfigRepo) FindByFilter(ctx context.Context, f RemoteConfigFilter, page *stores.PageInfo) ([]*DmProductRemoteConfig, error)
- func (p ProductRemoteConfigRepo) FindOneByFilter(ctx context.Context, f RemoteConfigFilter) (*DmProductRemoteConfig, error)
- func (p ProductRemoteConfigRepo) Insert(ctx context.Context, data *DmProductRemoteConfig) error
- func (p ProductRemoteConfigRepo) Update(ctx context.Context, data *DmProductRemoteConfig) error
- type ProductSchemaFilter
- type ProductSchemaOldFilter
- type ProductSchemaOldRepo
- func (p ProductSchemaOldRepo) CountByFilter(ctx context.Context, f ProductSchemaFilter) (size int64, err error)
- func (p ProductSchemaOldRepo) DeleteByFilter(ctx context.Context, f ProductSchemaFilter) error
- func (p ProductSchemaOldRepo) FindByFilter(ctx context.Context, f ProductSchemaFilter, page *stores.PageInfo) ([]*DmProductSchema, error)
- func (p ProductSchemaOldRepo) FindOneByFilter(ctx context.Context, f ProductSchemaFilter) (*DmProductSchema, error)
- func (p ProductSchemaOldRepo) FindProductIDByFilter(ctx context.Context, f ProductSchemaFilter) ([]string, error)
- func (p ProductSchemaOldRepo) Insert(ctx context.Context, data *DmProductSchema) error
- func (p ProductSchemaOldRepo) MultiInsert(ctx context.Context, data []*DmProductSchema) error
- func (p ProductSchemaOldRepo) MultiUpdate(ctx context.Context, productID string, schemaInfo *schema.Model) error
- func (p ProductSchemaOldRepo) Update(ctx context.Context, data *DmProductSchema) error
- func (p ProductSchemaOldRepo) UpdateTag(ctx context.Context, productIDs []string, identifiers []string, ...) error
- func (p ProductSchemaOldRepo) UpdateWithCommon(ctx context.Context, common *DmCommonSchema) error
- type ProductSchemaRepo
- func (p ProductSchemaRepo) CountByFilter(ctx context.Context, f ProductSchemaFilter) (size int64, err error)
- func (p ProductSchemaRepo) DeleteByFilter(ctx context.Context, f ProductSchemaFilter) error
- func (p ProductSchemaRepo) FindByFilter(ctx context.Context, f ProductSchemaFilter, page *stores.PageInfo) ([]*DmSchemaInfo, error)
- func (p ProductSchemaRepo) FindOneByFilter(ctx context.Context, f ProductSchemaFilter) (*DmSchemaInfo, error)
- func (p ProductSchemaRepo) FindProductIDByFilter(ctx context.Context, f ProductSchemaFilter) ([]string, error)
- func (p ProductSchemaRepo) Insert(ctx context.Context, data *DmSchemaInfo) error
- func (p ProductSchemaRepo) MultiInsert(ctx context.Context, data []*DmSchemaInfo) error
- func (p ProductSchemaRepo) MultiUpdate(ctx context.Context, productID string, schemaInfo *schema.Model) error
- func (p ProductSchemaRepo) Update(ctx context.Context, data *DmSchemaInfo) error
- func (p ProductSchemaRepo) UpdateTag(ctx context.Context, productIDs []string, identifiers []string, ...) error
- func (p ProductSchemaRepo) UpdateWithCommon(ctx context.Context, common *DmCommonSchema) error
- type ProtocolInfoFilter
- type ProtocolInfoRepo
- func (p ProtocolInfoRepo) CountByFilter(ctx context.Context, f ProtocolInfoFilter) (size int64, err error)
- func (p ProtocolInfoRepo) Delete(ctx context.Context, id int64) error
- func (p ProtocolInfoRepo) DeleteByFilter(ctx context.Context, f ProtocolInfoFilter) error
- func (p ProtocolInfoRepo) FindByFilter(ctx context.Context, f ProtocolInfoFilter, page *stores.PageInfo) ([]*DmProtocolInfo, error)
- func (p ProtocolInfoRepo) FindOne(ctx context.Context, id int64) (*DmProtocolInfo, error)
- func (p ProtocolInfoRepo) FindOneByFilter(ctx context.Context, f ProtocolInfoFilter) (*DmProtocolInfo, error)
- func (p ProtocolInfoRepo) Insert(ctx context.Context, data *DmProtocolInfo) error
- func (p ProtocolInfoRepo) MultiInsert(ctx context.Context, data []*DmProtocolInfo) error
- func (p ProtocolInfoRepo) Update(ctx context.Context, data *DmProtocolInfo) error
- type ProtocolServiceFilter
- type ProtocolServiceRepo
- func (p ProtocolServiceRepo) CountByFilter(ctx context.Context, f ProtocolServiceFilter) (size int64, err error)
- func (p ProtocolServiceRepo) Delete(ctx context.Context, id int64) error
- func (p ProtocolServiceRepo) DeleteByFilter(ctx context.Context, f ProtocolServiceFilter) error
- func (p ProtocolServiceRepo) DownStatus(ctx context.Context) error
- func (p ProtocolServiceRepo) FindByFilter(ctx context.Context, f ProtocolServiceFilter, page *stores.PageInfo) ([]*DmProtocolService, error)
- func (p ProtocolServiceRepo) FindOne(ctx context.Context, id int64) (*DmProtocolService, error)
- func (p ProtocolServiceRepo) FindOneByFilter(ctx context.Context, f ProtocolServiceFilter) (*DmProtocolService, error)
- func (p ProtocolServiceRepo) Insert(ctx context.Context, data *DmProtocolService) error
- func (p ProtocolServiceRepo) MultiInsert(ctx context.Context, data []*DmProtocolService) error
- func (p ProtocolServiceRepo) Update(ctx context.Context, data *DmProtocolService) error
- type RemoteConfigFilter
- type SchemaInfoFilter
- type SchemaInfoRepo
- func (p SchemaInfoRepo) CountByFilter(ctx context.Context, f SchemaInfoFilter) (size int64, err error)
- func (p SchemaInfoRepo) DeleteByFilter(ctx context.Context, f SchemaInfoFilter) error
- func (p SchemaInfoRepo) FindByFilter(ctx context.Context, f SchemaInfoFilter, page *stores.PageInfo) ([]*DmSchemaInfo, error)
- func (p SchemaInfoRepo) FindOneByFilter(ctx context.Context, f SchemaInfoFilter) (*DmSchemaInfo, error)
- func (p SchemaInfoRepo) Insert(ctx context.Context, data *DmSchemaInfo) error
- func (p SchemaInfoRepo) MultiInsert(ctx context.Context, data []*DmSchemaInfo) error
- func (p SchemaInfoRepo) MultiInsert2(ctx context.Context, productID string, deviceName string, ...) error
- func (p SchemaInfoRepo) MultiUpdate(ctx context.Context, productID string, deviceName string, ...) error
- func (p SchemaInfoRepo) Update(ctx context.Context, data *DmSchemaInfo) error
- func (p SchemaInfoRepo) UpdateTag(ctx context.Context, productIDs []string, identifiers []string, ...) error
- type ShadowRepo
- type SharePerm
- type UserDeviceCollectFilter
- type UserDeviceCollectRepo
- func (p UserDeviceCollectRepo) CountByFilter(ctx context.Context, f UserDeviceCollectFilter) (size int64, err error)
- func (p UserDeviceCollectRepo) Delete(ctx context.Context, id int64) error
- func (p UserDeviceCollectRepo) DeleteByFilter(ctx context.Context, f UserDeviceCollectFilter) error
- func (p UserDeviceCollectRepo) FindByFilter(ctx context.Context, f UserDeviceCollectFilter, page *stores.PageInfo) ([]*DmUserDeviceCollect, error)
- func (p UserDeviceCollectRepo) FindOne(ctx context.Context, id int64) (*DmUserDeviceCollect, error)
- func (p UserDeviceCollectRepo) FindOneByFilter(ctx context.Context, f UserDeviceCollectFilter) (*DmUserDeviceCollect, error)
- func (p UserDeviceCollectRepo) Insert(ctx context.Context, data *DmUserDeviceCollect) error
- func (p UserDeviceCollectRepo) MultiInsert(ctx context.Context, data []*DmUserDeviceCollect) error
- func (p UserDeviceCollectRepo) Update(ctx context.Context, data *DmUserDeviceCollect) error
- func (d UserDeviceCollectRepo) UpdateWithField(ctx context.Context, f UserDeviceCollectFilter, updates map[string]any) error
- type UserDeviceShareFilter
- type UserDeviceShareRepo
- func (p UserDeviceShareRepo) CountByFilter(ctx context.Context, f UserDeviceShareFilter) (size int64, err error)
- func (p UserDeviceShareRepo) Delete(ctx context.Context, id int64) error
- func (p UserDeviceShareRepo) DeleteByFilter(ctx context.Context, f UserDeviceShareFilter) error
- func (p UserDeviceShareRepo) FindByFilter(ctx context.Context, f UserDeviceShareFilter, page *stores.PageInfo) ([]*DmUserDeviceShare, error)
- func (p UserDeviceShareRepo) FindOne(ctx context.Context, id int64) (*DmUserDeviceShare, error)
- func (p UserDeviceShareRepo) FindOneByFilter(ctx context.Context, f UserDeviceShareFilter) (*DmUserDeviceShare, error)
- func (p UserDeviceShareRepo) Insert(ctx context.Context, data *DmUserDeviceShare) error
- func (p UserDeviceShareRepo) MultiInsert(ctx context.Context, data []*DmUserDeviceShare) error
- func (p UserDeviceShareRepo) Update(ctx context.Context, data *DmUserDeviceShare) error
- func (d UserDeviceShareRepo) UpdateWithField(ctx context.Context, f UserDeviceShareFilter, updates map[string]any) error
Constants ¶
const ()
Variables ¶
var ( MigrateProtocolInfo = []DmProtocolInfo{{ID: 3, Name: "iThings标准协议", Code: "iThings", TransProtocol: "mqtt", EtcdKey: "dg.rpc"}} MigrateProductCategory = []DmProductCategory{ {ID: 3, Name: "照明设备", ParentID: def.RootNode, IDPath: "3-"}, {ID: 4, Name: "空调设备", ParentID: def.RootNode, IDPath: "4-"}, {ID: 5, Name: "风扇设备", ParentID: def.RootNode, IDPath: "5-"}, {ID: 6, Name: "传感器设备", ParentID: def.RootNode, IDPath: "6-"}, } MigrateManufacturerInfo = []DmManufacturerInfo{ { ID: 1, Name: "iThings", Desc: "欢迎加入", Phone: "166666666", }, } )
Functions ¶
func CommonToSchemaDo ¶
func CommonToSchemaDo(in []*DmCommonSchema) *schema.Model
func NewShadowRepo ¶
func ToActionDo ¶
func ToActionDo(in *DmSchemaCore) *schema.Action
func ToAffordancePo ¶
func ToCommonParam ¶
func ToCommonParam(in *DmSchemaCore) schema.CommonParam
func ToDeviceSchemaDo ¶ added in v1.0.4
func ToDeviceSchemaDo(productID string, in []*DmDeviceSchema) *schema.Model
func ToEventDo ¶
func ToEventDo(in *DmSchemaCore) *schema.Event
func ToPropertyDo ¶
func ToPropertyDo(in *DmSchemaCore) *schema.Property
func ToSchemaDo ¶
func ToSchemaDo(productID string, in []*DmSchemaInfo) *schema.Model
func ToShadowDo ¶
func ToShadowDo(in *DmDeviceShadow) *shadow.Info
func ToShadowsDo ¶
func ToShadowsDo(in []*DmDeviceShadow) []*shadow.Info
Types ¶
type CommonSchemaFilter ¶
type CommonSchemaRepo ¶
type CommonSchemaRepo struct {
// contains filtered or unexported fields
}
func NewCommonSchemaRepo ¶
func NewCommonSchemaRepo(in any) *CommonSchemaRepo
func (CommonSchemaRepo) CountByFilter ¶
func (p CommonSchemaRepo) CountByFilter(ctx context.Context, f CommonSchemaFilter) (size int64, err error)
func (CommonSchemaRepo) DeleteByFilter ¶
func (p CommonSchemaRepo) DeleteByFilter(ctx context.Context, f CommonSchemaFilter) error
func (CommonSchemaRepo) FindByFilter ¶
func (p CommonSchemaRepo) FindByFilter(ctx context.Context, f CommonSchemaFilter, page *stores.PageInfo) ([]*DmCommonSchema, error)
func (CommonSchemaRepo) FindOneByFilter ¶
func (p CommonSchemaRepo) FindOneByFilter(ctx context.Context, f CommonSchemaFilter) (*DmCommonSchema, error)
func (CommonSchemaRepo) Insert ¶
func (p CommonSchemaRepo) Insert(ctx context.Context, data *DmCommonSchema) error
func (CommonSchemaRepo) Update ¶
func (p CommonSchemaRepo) Update(ctx context.Context, data *DmCommonSchema) error
type DeviceFilter ¶
type DeviceFilter struct { TenantCode string TenantCodes []string ProjectIDs []int64 ProductID string ProductIDs []string AreaIDs []int64 NotAreaIDs []int64 DeviceName string DeviceNames []string Tags map[string]string LastLoginTime *def.TimeRange IsOnline int64 Status def.DeviceStatus Statuses []def.DeviceStatus Range int64 Position stores.Point DeviceAlias string Versions []string NotVersion string Cores []*devices.Core Gateway *devices.Core Iccid string WithProduct bool ProductCategoryID int64 ProductCategoryIDs []int64 CollectType def.SelectType WithManufacturer bool DeviceType int64 DeviceTypes []int64 GroupID int64 ParentGroupID int64 GroupName string GroupIDs []int64 UserID int64 UserIDs []int64 NotGroupID int64 NotAreaID int64 Distributor *stores.IDPathFilter RatedPower *stores.Cmp ExpTime *stores.Cmp AreaIDPath string HasOwner int64 //是否被人拥有 NotOtaJobID int64 NeedConfirmJobID int64 NeedConfirmVersion string NetType int64 }
type DeviceInfoRepo ¶
type DeviceInfoRepo struct {
// contains filtered or unexported fields
}
func NewDeviceInfoRepo ¶
func NewDeviceInfoRepo(in any) *DeviceInfoRepo
func (DeviceInfoRepo) CountByFilter ¶
func (d DeviceInfoRepo) CountByFilter(ctx context.Context, f DeviceFilter) (size int64, err error)
func (DeviceInfoRepo) CountGroupByField ¶
func (d DeviceInfoRepo) CountGroupByField(ctx context.Context, f DeviceFilter, columnName string) (map[string]int64, error)
func (DeviceInfoRepo) FindByFilter ¶
func (d DeviceInfoRepo) FindByFilter(ctx context.Context, f DeviceFilter, page *stores.PageInfo) ([]*DmDeviceInfo, error)
func (DeviceInfoRepo) FindCoreByFilter ¶
func (d DeviceInfoRepo) FindCoreByFilter(ctx context.Context, f DeviceFilter, page *stores.PageInfo) ([]devices.Core, error)
func (DeviceInfoRepo) FindOneByFilter ¶
func (d DeviceInfoRepo) FindOneByFilter(ctx context.Context, f DeviceFilter) (*DmDeviceInfo, error)
func (DeviceInfoRepo) FindProductIDsByFilter ¶
func (d DeviceInfoRepo) FindProductIDsByFilter(ctx context.Context, f DeviceFilter) ([]string, error)
func (DeviceInfoRepo) Insert ¶
func (d DeviceInfoRepo) Insert(ctx context.Context, data *DmDeviceInfo) error
func (DeviceInfoRepo) MultiUpdate ¶
func (d DeviceInfoRepo) MultiUpdate(ctx context.Context, devices []*devices.Core, info *DmDeviceInfo, columns ...string) error
func (DeviceInfoRepo) Update ¶
func (d DeviceInfoRepo) Update(ctx context.Context, data *DmDeviceInfo) error
func (DeviceInfoRepo) UpdateOfflineStatus ¶
func (d DeviceInfoRepo) UpdateOfflineStatus(ctx context.Context, f DeviceFilter) error
func (DeviceInfoRepo) UpdateWithField ¶
func (d DeviceInfoRepo) UpdateWithField(ctx context.Context, f DeviceFilter, updates map[string]any) error
type DeviceModuleVersionRepo ¶
type DeviceModuleVersionRepo struct {
// contains filtered or unexported fields
}
func NewDeviceModuleVersionRepo ¶
func NewDeviceModuleVersionRepo(in any) *DeviceModuleVersionRepo
func (DeviceModuleVersionRepo) CountByFilter ¶
func (p DeviceModuleVersionRepo) CountByFilter(ctx context.Context, f DeviceModuleVersionFilter) (size int64, err error)
func (DeviceModuleVersionRepo) Delete ¶
func (p DeviceModuleVersionRepo) Delete(ctx context.Context, id int64) error
func (DeviceModuleVersionRepo) DeleteByFilter ¶
func (p DeviceModuleVersionRepo) DeleteByFilter(ctx context.Context, f DeviceModuleVersionFilter) error
func (DeviceModuleVersionRepo) FindByFilter ¶
func (p DeviceModuleVersionRepo) FindByFilter(ctx context.Context, f DeviceModuleVersionFilter, page *stores.PageInfo) ([]*DmDeviceModuleVersion, error)
func (DeviceModuleVersionRepo) FindOne ¶
func (p DeviceModuleVersionRepo) FindOne(ctx context.Context, id int64) (*DmDeviceModuleVersion, error)
func (DeviceModuleVersionRepo) FindOneByFilter ¶
func (p DeviceModuleVersionRepo) FindOneByFilter(ctx context.Context, f DeviceModuleVersionFilter) (*DmDeviceModuleVersion, error)
func (DeviceModuleVersionRepo) Insert ¶
func (p DeviceModuleVersionRepo) Insert(ctx context.Context, data *DmDeviceModuleVersion) error
func (DeviceModuleVersionRepo) MultiInsert ¶
func (p DeviceModuleVersionRepo) MultiInsert(ctx context.Context, data []*DmDeviceModuleVersion) error
批量插入 LightStrategyDevice 记录
func (DeviceModuleVersionRepo) Update ¶
func (p DeviceModuleVersionRepo) Update(ctx context.Context, data *DmDeviceModuleVersion) error
type DeviceMsgCountFilter ¶
type DeviceMsgCountFilter struct { }
type DeviceMsgCountRepo ¶
type DeviceMsgCountRepo struct {
// contains filtered or unexported fields
}
func NewDeviceMsgCountRepo ¶
func NewDeviceMsgCountRepo(in any) *DeviceMsgCountRepo
func (DeviceMsgCountRepo) CountByFilter ¶
func (p DeviceMsgCountRepo) CountByFilter(ctx context.Context, f DeviceMsgCountFilter) (size int64, err error)
func (DeviceMsgCountRepo) Delete ¶
func (p DeviceMsgCountRepo) Delete(ctx context.Context, id int64) error
func (DeviceMsgCountRepo) DeleteByFilter ¶
func (p DeviceMsgCountRepo) DeleteByFilter(ctx context.Context, f DeviceMsgCountFilter) error
func (DeviceMsgCountRepo) FindByFilter ¶
func (p DeviceMsgCountRepo) FindByFilter(ctx context.Context, f DeviceMsgCountFilter, page *stores.PageInfo) ([]*DmDeviceMsgCount, error)
func (DeviceMsgCountRepo) FindOne ¶
func (p DeviceMsgCountRepo) FindOne(ctx context.Context, id int64) (*DmDeviceMsgCount, error)
func (DeviceMsgCountRepo) FindOneByFilter ¶
func (p DeviceMsgCountRepo) FindOneByFilter(ctx context.Context, f DeviceMsgCountFilter) (*DmDeviceMsgCount, error)
func (DeviceMsgCountRepo) Insert ¶
func (p DeviceMsgCountRepo) Insert(ctx context.Context, data *DmDeviceMsgCount) error
func (DeviceMsgCountRepo) MultiInsert ¶
func (p DeviceMsgCountRepo) MultiInsert(ctx context.Context, data []*DmDeviceMsgCount) error
批量插入 LightStrategyDevice 记录
func (DeviceMsgCountRepo) Update ¶
func (p DeviceMsgCountRepo) Update(ctx context.Context, data *DmDeviceMsgCount) error
func (DeviceMsgCountRepo) UpdateWithField ¶
func (d DeviceMsgCountRepo) UpdateWithField(ctx context.Context, f DeviceMsgCountFilter, updates map[string]any) error
type DeviceProfileFilter ¶
type DeviceProfileRepo ¶
type DeviceProfileRepo struct {
// contains filtered or unexported fields
}
func NewDeviceProfileRepo ¶
func NewDeviceProfileRepo(in any) *DeviceProfileRepo
func (DeviceProfileRepo) CountByFilter ¶
func (p DeviceProfileRepo) CountByFilter(ctx context.Context, f DeviceProfileFilter) (size int64, err error)
func (DeviceProfileRepo) Delete ¶
func (p DeviceProfileRepo) Delete(ctx context.Context, id int64) error
func (DeviceProfileRepo) DeleteByFilter ¶
func (p DeviceProfileRepo) DeleteByFilter(ctx context.Context, f DeviceProfileFilter) error
func (DeviceProfileRepo) FindByFilter ¶
func (p DeviceProfileRepo) FindByFilter(ctx context.Context, f DeviceProfileFilter, page *stores.PageInfo) ([]*DmDeviceProfile, error)
func (DeviceProfileRepo) FindOne ¶
func (p DeviceProfileRepo) FindOne(ctx context.Context, id int64) (*DmDeviceProfile, error)
func (DeviceProfileRepo) FindOneByFilter ¶
func (p DeviceProfileRepo) FindOneByFilter(ctx context.Context, f DeviceProfileFilter) (*DmDeviceProfile, error)
func (DeviceProfileRepo) Insert ¶
func (p DeviceProfileRepo) Insert(ctx context.Context, data *DmDeviceProfile) error
func (DeviceProfileRepo) MultiInsert ¶
func (p DeviceProfileRepo) MultiInsert(ctx context.Context, data []*DmDeviceProfile) error
批量插入 LightStrategyDevice 记录
func (DeviceProfileRepo) Update ¶
func (p DeviceProfileRepo) Update(ctx context.Context, data *DmDeviceProfile) error
func (DeviceProfileRepo) UpdateWithField ¶
func (d DeviceProfileRepo) UpdateWithField(ctx context.Context, f DeviceProfileFilter, updates map[string]any) error
type DeviceSchemaFilter ¶ added in v1.0.4
type DeviceSchemaFilter struct { ID int64 ProductID string //产品id 必填 DeviceName string //设备ID Type int64 //物模型类型 1:property属性 2:event事件 3:action行为 Types []int64 Tag schema.Tag //过滤条件: 物模型标签 1:自定义 2:可选 3:必选 Tags []schema.Tag Identifiers []string //过滤标识符列表 Name string IsCanSceneLinkage int64 FuncGroup int64 UserPerm int64 PropertyMode string ControlMode int64 ProductSceneMode string WithProductSchema bool }
type DeviceSchemaRepo ¶ added in v1.0.4
type DeviceSchemaRepo struct {
// contains filtered or unexported fields
}
func NewDeviceSchemaRepo ¶ added in v1.0.4
func NewDeviceSchemaRepo(in any) *DeviceSchemaRepo
func (DeviceSchemaRepo) CountByFilter ¶ added in v1.0.4
func (p DeviceSchemaRepo) CountByFilter(ctx context.Context, f DeviceSchemaFilter) (size int64, err error)
func (DeviceSchemaRepo) DeleteByFilter ¶ added in v1.0.4
func (p DeviceSchemaRepo) DeleteByFilter(ctx context.Context, f DeviceSchemaFilter) error
func (DeviceSchemaRepo) FindByFilter ¶ added in v1.0.4
func (p DeviceSchemaRepo) FindByFilter(ctx context.Context, f DeviceSchemaFilter, page *stores.PageInfo) ([]*DmDeviceSchema, error)
func (DeviceSchemaRepo) FindOneByFilter ¶ added in v1.0.4
func (p DeviceSchemaRepo) FindOneByFilter(ctx context.Context, f DeviceSchemaFilter) (*DmDeviceSchema, error)
func (DeviceSchemaRepo) Insert ¶ added in v1.0.4
func (p DeviceSchemaRepo) Insert(ctx context.Context, data *DmDeviceSchema) error
func (DeviceSchemaRepo) MultiInsert ¶ added in v1.0.4
func (p DeviceSchemaRepo) MultiInsert(ctx context.Context, data []*DmDeviceSchema) error
批量插入 LightStrategyDevice 记录
func (DeviceSchemaRepo) MultiInsert2 ¶ added in v1.0.4
func (p DeviceSchemaRepo) MultiInsert2(ctx context.Context, productID string, deviceName string, schemaInfo *schema.Model) error
批量插入 LightStrategyDevice 记录
func (DeviceSchemaRepo) MultiUpdate ¶ added in v1.0.4
func (DeviceSchemaRepo) Update ¶ added in v1.0.4
func (p DeviceSchemaRepo) Update(ctx context.Context, data *DmDeviceSchema) error
type DmCommonSchema ¶
type DmCommonSchema struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` DmSchemaCore stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:identifier"` }
通用物模型表
func (*DmCommonSchema) TableName ¶
func (m *DmCommonSchema) TableName() string
type DmDeviceInfo ¶
type DmDeviceInfo struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` TenantCode stores.TenantCode `gorm:"column:tenant_code;index;type:VARCHAR(50);NOT NULL"` // 租户编码 ProjectID stores.ProjectID `gorm:"column:project_id;index:project_id_area_id;type:bigint;default:0;NOT NULL"` // 项目ID(雪花ID) AreaID stores.AreaID `gorm:"column:area_id;index:project_id_area_id;type:bigint;default:0;NOT NULL"` // 项目区域ID(雪花ID) AreaIDPath stores.AreaIDPath `gorm:"column:area_id_path;type:varchar(100);default:'';NOT NULL"` // 项目区域ID路径(雪花ID) ProductID string `gorm:"column:product_id;type:varchar(100);uniqueIndex:product_id_deviceName;NOT NULL"` // 产品id DeviceName string `gorm:"column:device_name;uniqueIndex:product_id_deviceName;type:varchar(100);NOT NULL"` // 设备名称 DeviceAlias string `gorm:"column:device_alias;type:varchar(100);NOT NULL"` // 设备别名 Position stores.Point `gorm:"column:position;NOT NULL"` // 设备的位置(默认百度坐标系BD09) RatedPower int64 `gorm:"column:rated_power;index;type:bigint;NOT NULL;default:0"` // 额定功率:单位w/h Secret string `gorm:"column:secret;type:varchar(50);NOT NULL"` // 设备秘钥 Cert string `gorm:"column:cert;type:varchar(512);NOT NULL"` // 设备证书 Imei string `gorm:"column:imei;type:varchar(25);NOT NULL"` // IMEI号信息 Mac string `gorm:"column:mac;type:varchar(17);NOT NULL"` // MAC号信息 DeviceType int64 `gorm:"column:device_type;index;type:smallint;default:1"` // 设备类型:1:设备,2:网关,3:子设备 Version string `gorm:"column:version;index;type:varchar(64);NOT NULL"` // 固件版本 //ModuleVersion map[string]string `gorm:"column:module_version;type:json;serializer:json;NOT NULL;default:'{}'"` // 所有模块的版本 HardInfo string `gorm:"column:hard_info;type:varchar(64);NOT NULL"` // 模组硬件型号 SoftInfo string `gorm:"column:soft_info;type:varchar(64);NOT NULL"` // 模组软件版本 MobileOperator int64 `gorm:"column:mobile_operator;type:smallint;default:1;NOT NULL"` // 移动运营商:1)移动 2)联通 3)电信 4)广电 Phone sql.NullString `gorm:"column:phone;type:varchar(20)"` // 手机号 Iccid sql.NullString `gorm:"column:iccid;type:varchar(20)"` // SIM卡卡号 Address string `gorm:"column:address;type:varchar(512);default:''"` // 所在地址 Adcode string `gorm:"column:adcode;type:varchar(125);default:''"` // 地区编码 Tags map[string]string `gorm:"column:tags;type:json;serializer:json;NOT NULL;default:'{}'"` // 设备标签 SchemaAlias map[string]string `gorm:"column:schema_alias;type:json;serializer:json;NOT NULL;default:'{}'"` // 设备物模型别名,如果是结构体类型则key为xxx.xxx Rssi int64 `gorm:"column:rssi;type:bigint;default:0;NOT NULL"` // 设备信号(信号极好[-55— 0],信号好[-70— -55],信号一般[-85— -70],信号差[-100— -85]) ProtocolConf map[string]string `gorm:"column:protocol_conf;type:json;serializer:json;NOT NULL;default:'{}'"` // 自定义协议配置 IsOnline int64 `gorm:"column:is_online;type:smallint;default:2;NOT NULL"` // 是否在线,1是2否 FirstLogin sql.NullTime `gorm:"column:first_login"` // 激活时间 FirstBind sql.NullTime `gorm:"column:first_bind"` // 首次绑定事件 LastLogin sql.NullTime `gorm:"column:last_login"` // 最后上线时间 LogLevel int64 `gorm:"column:log_level;type:smallint;default:1;NOT NULL"` // 日志级别:1)关闭 2)错误 3)告警 4)信息 5)调试 UserID int64 `gorm:"column:user_id;type:BIGINT;default:1"` // 用户id Status def.DeviceStatus `gorm:"column:status;index;type:smallint;default:1;NOT NULL"` // 设备状态 1-未激活,2-在线,3-离线 4-异常(频繁上下线,告警中) 5-禁用 IsEnable int64 `gorm:"column:is_enable;index;type:smallint;default:1;"` // 是否启用: 1:是 2:否 ExpTime sql.NullTime `gorm:"column:exp_time"` // 过期时间,为0不限制 NeedConfirmJobID int64 `gorm:"column:need_confirm_job_id;type:smallint;default:0;"` // 需要app确认升级的任务ID,为0是没有 NeedConfirmVersion string `gorm:"column:need_confirm_version;type:varchar(128);default:'';"` // 待确认升级的版本 LastIp string `gorm:"column:last_ip;type:varchar(128);default:'';"` // 最后登录的ip地址 stores.NoDelTime Desc string `gorm:"column:desc;type:varchar(200)"` // 描述 Distributor stores.IDPathWithUpdate `gorm:"embedded;embeddedPrefix:distributor_"` // 代理的id,如果为空,则未参与分销 DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:product_id_deviceName"` ProductInfo *DmProductInfo `gorm:"foreignKey:ProductID;references:ProductID"` // 添加外键 }
设备信息表
func (*DmDeviceInfo) AfterDelete ¶
func (u *DmDeviceInfo) AfterDelete(tx *gorm.DB) (err error)
func (*DmDeviceInfo) TableName ¶
func (m *DmDeviceInfo) TableName() string
type DmDeviceModuleVersion ¶
type DmDeviceModuleVersion struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;type:varchar(100);uniqueIndex:product_id_deviceName;NOT NULL"` // 产品id DeviceName string `gorm:"column:device_name;uniqueIndex:product_id_deviceName;type:varchar(100);NOT NULL"` // 设备名称 ModuleCode string `gorm:"column:module_code;type:varchar(64);uniqueIndex:product_id_deviceName"` // 固件名称 Version string `gorm:"column:version;type:varchar(64);NOT NULL;uniqueIndex:product_id_deviceName"` // 固件版本 stores.NoDelTime }
func (*DmDeviceModuleVersion) TableName ¶
func (m *DmDeviceModuleVersion) TableName() string
type DmDeviceMsgCount ¶
type DmDeviceMsgCount struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` Type deviceLog.MsgType `gorm:"column:type;index;type:VARCHAR(50);uniqueIndex:date_type;NOT NULL"` // 消息类型 Num int64 `gorm:"column:num;type:bigint;default:0"` //数量 Date time.Time `gorm:"column:date;NOT NULL;uniqueIndex:date_type"` //统计的日期 stores.OnlyTime }
设备信息表
func (*DmDeviceMsgCount) TableName ¶
func (m *DmDeviceMsgCount) TableName() string
type DmDeviceProfile ¶
type DmDeviceProfile struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` TenantCode stores.TenantCode `gorm:"column:tenant_code;type:VARCHAR(50);NOT NULL;uniqueIndex:tc_un;"` // 租户编码 ProductID string `gorm:"column:product_id;type:varchar(100);uniqueIndex:tc_un;NOT NULL"` // 产品id DeviceName string `gorm:"column:device_name;uniqueIndex:tc_un;type:varchar(100);NOT NULL"` // 设备名称 Code string `gorm:"column:code;type:VARCHAR(50);uniqueIndex:tc_un;NOT NULL"` //配置code Params string `gorm:"column:params;type:text;NOT NULL"` stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:tc_un;"` }
用户配置表
func (*DmDeviceProfile) TableName ¶
func (m *DmDeviceProfile) TableName() string
type DmDeviceSchema ¶ added in v1.0.2
type DmDeviceSchema struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;uniqueIndex:identifier;index:product_id_type;type:varchar(100);NOT NULL"` // 产品id DeviceName string `gorm:"column:device_name;uniqueIndex:identifier;index:product_id_type;type:varchar(100);default:null"` // 产品id DmSchemaCore stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:identifier"` }
产品物模型表
func (*DmDeviceSchema) TableName ¶ added in v1.0.2
func (m *DmDeviceSchema) TableName() string
type DmDeviceShadow ¶
type DmDeviceShadow struct { ID int64 `gorm:"column:id;type:BIGINT;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;uniqueIndex:pi_dn_di;type:varchar(100);NOT NULL"` DeviceName string `gorm:"column:device_name;uniqueIndex:pi_dn_di;type:VARCHAR(100);NOT NULL"` DataID string `gorm:"column:data_id;uniqueIndex:pi_dn_di;type:VARCHAR(100);NOT NULL"` Value string `gorm:"column:value;type:VARCHAR(100);default:NULL"` UpdatedDeviceTime sql.NullTime `gorm:"column:updated_device_time;"` stores.OnlyTime }
设备影子表
func ToShadowPo ¶
func ToShadowPo(info *shadow.Info) *DmDeviceShadow
func (*DmDeviceShadow) TableName ¶
func (m *DmDeviceShadow) TableName() string
type DmExample ¶
type DmExample struct {
ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` // id编号
}
type DmGatewayDevice ¶
type DmGatewayDevice struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` GatewayProductID string `gorm:"column:gateway_product_id;type:varchar(100);NOT NULL"` // 网关产品id GatewayDeviceName string `gorm:"column:gateway_device_name;type:varchar(100);NOT NULL"` // 网关设备名称 ProductID string `gorm:"column:product_id;uniqueIndex:gpi_pdn_pi_dn;type:varchar(100);NOT NULL"` // 子设备产品id DeviceName string `gorm:"column:device_name;uniqueIndex:gpi_pdn_pi_dn;type:varchar(100);NOT NULL"` // 子设备名称 stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:gpi_pdn_pi_dn"` Device *DmDeviceInfo `gorm:"foreignKey:ProductID,DeviceName;references:ProductID,DeviceName"` Gateway *DmDeviceInfo `gorm:"foreignKey:ProductID,DeviceName;references:GatewayProductID,GatewayDeviceName"` }
网关与子设备关系表
func (*DmGatewayDevice) TableName ¶
func (m *DmGatewayDevice) TableName() string
type DmGroupDevice ¶
type DmGroupDevice struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` TenantCode stores.TenantCode `gorm:"column:tenant_code;index;type:VARCHAR(50);NOT NULL"` // 租户编码 ProjectID stores.ProjectID `gorm:"column:project_id;index;type:bigint;default:0;NOT NULL"` // 项目ID(雪花ID) AreaID stores.AreaID `gorm:"column:area_id;index:project_id_area_id;type:bigint;default:0;NOT NULL"` // 项目区域ID(雪花ID) GroupID int64 `gorm:"column:group_id;uniqueIndex:group_id_product_id_device_name;type:bigint;NOT NULL"` // 分组ID ProductID string `gorm:"column:product_id;uniqueIndex:group_id_product_id_device_name;type:varchar(100);NOT NULL"` // 产品id DeviceName string `gorm:"column:device_name;uniqueIndex:group_id_product_id_device_name;type:varchar(100);NOT NULL"` // 设备名称 stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:group_id_product_id_device_name"` ProductInfo *DmProductInfo `gorm:"foreignKey:ProductID;references:ProductID"` Device *DmDeviceInfo `gorm:"foreignKey:ProductID,DeviceName;references:ProductID,DeviceName"` }
分组与设备关系表
func (*DmGroupDevice) TableName ¶
func (m *DmGroupDevice) TableName() string
type DmGroupInfo ¶
type DmGroupInfo struct { ID int64 `gorm:"column:id;primary_key;AUTO_INCREMENT;type:bigint"` // 分组ID TenantCode stores.TenantCode `gorm:"column:tenant_code;uniqueIndex:tc_ac;default:default;type:VARCHAR(50);NOT NULL"` // 租户编码 ProjectID stores.ProjectID `gorm:"column:project_id;uniqueIndex:tc_ac;type:bigint;default:2;NOT NULL"` // 项目ID(雪花ID) AreaID stores.AreaID `gorm:"column:area_id;uniqueIndex:tc_ac;type:bigint;default:2;NOT NULL"` // 项目区域ID(雪花ID) ParentID int64 `gorm:"column:parent_id;type:bigint;default:0;NOT NULL"` // 父组ID 0-根组 IDPath string `gorm:"column:id_path;type:varchar(100);NOT NULL"` // 1-2-3-的格式记录顶级区域到当前区域的路径 IsLeaf int64 `gorm:"column:is_leaf;type:bigint;default:1;NOT NULL"` //是否是叶子节点 ProductID string `gorm:"column:product_id;type:varchar(100);default:'';NOT NULL"` // 产品id,为空则不限定分组内的产品类型 Name string `gorm:"column:name;uniqueIndex:tc_ac;default:'';type:varchar(100);NOT NULL"` // 分组名称 Desc string `gorm:"column:desc;type:varchar(200);default:''"` // 描述 Tags map[string]string `gorm:"column:tags;type:json;serializer:json;NOT NULL;default:'{}'"` // 分组标签 stores.NoDelTime DeviceCount int64 `gorm:"column:device_count;type:bigint;default:0;"` //设备数量统计 DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:tc_ac"` ProductInfo *DmProductInfo `gorm:"foreignKey:ProductID;references:ProductID"` }
设备分组信息表
func (*DmGroupInfo) TableName ¶
func (m *DmGroupInfo) TableName() string
type DmManufacturerInfo ¶
type DmManufacturerInfo struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` Name string `gorm:"column:name;uniqueIndex:pn;type:varchar(100);NOT NULL"` // 协议名称 Desc string `gorm:"column:desc;type:varchar(200)"` // 描述 Phone string `gorm:"column:phone;type:varchar(200);default:null"` //联系电话 stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:pn"` }
func (*DmManufacturerInfo) TableName ¶
func (m *DmManufacturerInfo) TableName() string
type DmOtaFirmwareDevice ¶
type DmOtaFirmwareDevice struct { ID int64 `gorm:"column:id;type:BIGINT;primary_key;AUTO_INCREMENT"` FirmwareID int64 `gorm:"column:firmware_id;uniqueIndex:tc_un"` // 升级包ID SrcVersion string `gorm:"column:src_version;type:varchar(125)"` // 设备的原固件版本 DestVersion string `gorm:"column:dest_version;type:varchar(125)"` // 设备的目标固件版本 JobID int64 `gorm:"column:job_id;uniqueIndex:tc_un;type:BIGINT" ` // 升级批次ID ProductID string `gorm:"column:product_id;type:varchar(20);uniqueIndex:tc_un"` // 设备所属产品的productID DeviceName string `gorm:"column:device_name;type:varchar(100);uniqueIndex:tc_un" ` // 设备名称 Step int64 `gorm:"column:step;type:BIGINT"` // 当前的升级进度 0-100% -1:升级失败。-2:下载失败。-3:校验失败。-4:烧写失败。 Detail string `gorm:"column:detail;type:varchar(256)"` //详情 Status msgOta.DeviceStatus `gorm:"column:status;index;type:BIGINT"` // 设备升级作业状态。1:待确认。 2:待推送。 3:已推送。 4:升级中。 5:升级成功 6: 升级失败. 7:已取消 PushTime sql.NullTime `gorm:"column:push_time"` //推送时间 LastFailureTime sql.NullTime `gorm:"column:last_failure_time"` //最后失败时间 stores.NoDelTime RetryCount int64 `gorm:"column:retry_count;default:0"` // 自动重试次数 DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:tc_un;"` Job *DmOtaFirmwareJob `gorm:"foreignKey:JobID;references:ID"` Firmware *DmOtaFirmwareInfo `gorm:"foreignKey:FirmwareID;references:ID"` Files []*DmOtaFirmwareFile `gorm:"foreignKey:FirmwareID;references:FirmwareID"` }
func (*DmOtaFirmwareDevice) TableName ¶
func (m *DmOtaFirmwareDevice) TableName() string
type DmOtaFirmwareFile ¶
type DmOtaFirmwareFile struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` Name string `gorm:"column:name;type:varchar(64)"` // 附件名称 FirmwareID int64 `gorm:"column:firmware_id;type:bigint;NOT NULL"` // 固件id Size int64 `gorm:"column:size;type:bigint;NOT NULL"` // 文件大小单位bit FilePath string `gorm:"column:file_path;type:varchar(256);NOT NULL"` // 文件路径,拿来下载文件 Signature string `gorm:"column:signature;type:char(32);NOT NULL"` // 签名值 FileMd5 string `gorm:"column:file_md5;type:char(32);NOT NULL"` stores.Time }
升级包附件列表
func (*DmOtaFirmwareFile) TableName ¶
func (m *DmOtaFirmwareFile) TableName() string
type DmOtaFirmwareInfo ¶
type DmOtaFirmwareInfo struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;type:varchar(100);uniqueIndex:tc_un;NOT NULL"` // 产品id Version string `gorm:"column:version;type:varchar(64);uniqueIndex:tc_un"` // 固件版本 SrcVersion string `gorm:"column:src_version;type:varchar(64)"` // 待升级版本号 Name string `gorm:"column:name;type:varchar(64)"` // 固件名称 ModuleCode string `gorm:"column:module_code;type:varchar(64)"` // 固件名称 Desc string `gorm:"column:desc;type:varchar(200)"` // 描述 Status int64 `gorm:"column:status;type:bigint;NOT NULL"` //升级包状态,-1:不需要验证,0:未验证,1:已验证,2:验证中,3:验证失败 TotalSize int64 `gorm:"column:total_size;type:bigint;NOT NULL"` // 升级包总大小 IsDiff int64 `gorm:"column:is_diff;type:smallint;default:1;NOT NULL"` // 是否差分包,1:整包,2:差分 SignMethod string `gorm:"column:sign_method;type:varchar(20);NOT NULL"` // 签名方式:MD5/SHA256 Extra string `gorm:"column:extra;type:varchar(256)"` // 自定义推送参数 IsNeedToVerify int64 `gorm:"column:is_need_to_verify;type:smallint;default:2;NOT NULL"` // 是否需要验证 Files []*DmOtaFirmwareFile `gorm:"foreignKey:FirmwareID;references:ID"` Jobs []*DmOtaFirmwareJob `gorm:"foreignKey:FirmwareID;references:ID"` stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:tc_un;"` }
产品固件升级包信息表
func (*DmOtaFirmwareInfo) TableName ¶
func (m *DmOtaFirmwareInfo) TableName() string
type DmOtaFirmwareJob ¶
type DmOtaFirmwareJob struct { ID int64 `gorm:"column:id;type:BIGINT;primary_key;AUTO_INCREMENT"` FirmwareID int64 `gorm:"column:firmware_id"` // 升级包ID,升级包的唯一标识符。 ProductID string `gorm:"column:product_id;type:varchar(100);NOT NULL"` // 产品id Type int64 `gorm:"column:type"` // 升级包所属产品的JobType。 验证升级包:1 批量升级:2 Status int64 `gorm:"column:status"` // 批次状态,计划中:1 执行中:2 已完成:3 已取消:4 UpgradeType msgOta.UpgradeType `gorm:"column:upgrade_type"` // 升级策略,1-静态,2-动态 /* 待升级版本号列表。 发起全量升级(TargetSelection=ALL)和灰度升级(TargetSelection=GRAY)任务时,可以传入该参数。 使用差分升级包发起全量升级和灰度升级任务时,该参数值需指定为差分升级包的待升级版本号(SrcVersion)。 发起定向升级(TargetSelection=SPECIFIC)或分组升级(TargetSelection=GROUP)任务时,不能传入该参数。 可以调用 QueryDeviceDetail ,查看设备 OTA 模块版本号(FirmwareVersion)。 列表中不能有重复的版本号。 最多可传入 10 个版本号。 */ SrcVersions []string `gorm:"column:src_versions;type:json;serializer:json"` // 待升级版本号列表。最多可传入10个版本号。用逗号分隔多个版本号 RetryInterval int64 `gorm:"column:retry_interval"` // 设备升级失败后,自动重试的时间间隔,单位为分钟。 动态升级 静态升级 RetryCount int64 `gorm:"column:retry_count"` // 自动重试次数。1/2/5次 动态升级 静态升级 TimeoutInMinutes int64 `gorm:"column:timeout_in_minutes"` // 设备升级超时时间,单位为分钟。 动态升级 静态升级 MaximumPerMinute int64 `gorm:"column:maximum_per_minute"` // 每分钟最多向多少个设备推送升级包下载URL。 动态升级 静态升级 /* 是否覆盖之前的升级任务。取值: 2(默认):不覆盖。若设备已有升级任务,则只执行已有任务。 1:覆盖。设备只执行新的升级任务。此时 MultiModuleMode 不能传入 true。 动态升级 静态升级 */ IsOverwriteMode int64 `gorm:"column:is_overwrite_mode;default:2"` // 是否覆盖之前的升级任务。取值:2(不覆盖)、1(覆盖)。 /* 物联网平台是否主动向设备推送升级任务。 1(默认):是。批次任务创建完成后,物联网平台主动将升级任务,直接推送给升级范围内的在线设备。 此时,设备仍可主动向物联网平台发起请求,来获取 OTA 升级任务信息。 2:否。设备必须通过向物联网平台发起请求,来获取 OTA 升级任务信息。 动态升级 */ IsNeedPush int64 `gorm:"column:is_need_push"` // 物联网平台是否主动向设备推送升级任务。 /* 如需自主控制设备 OTA 升级时,可配置此参数,通过手机 App 来控制,设备是否可进行 OTA 升级。手机 App 需您自行开发。 2(默认):否。直接按照 NeedPush 设置,获取 OTA 升级任务信息。 1:是。设备无法获取 OTA 升级任务,需 App 侧确认 OTA 升级后,才能按照 NeedPush 设置,获取 OTA 升级任务信息。 */ IsNeedConfirm int64 `gorm:"is_need_confirm"` TargetSelection int64 `gorm:"column:target_selection;type:bigint;default:1"` //升级范围。 1:全量升级。 2:定向升级。 3:灰度升级。 4:分组升级 5: 区域升级 TargetID int64 `gorm:"column:target_id;type:bigint;default:0"` Dynamic DmOtaFirmwareJobDynamic `gorm:"embedded"` Static DmOtaFirmwareJobStatic `gorm:"embedded"` Firmware *DmOtaFirmwareInfo `gorm:"foreignKey:FirmwareID;references:ID"` Files []*DmOtaFirmwareFile `gorm:"foreignKey:FirmwareID;references:FirmwareID"` stores.Time }
DMOTAjob 表示OTA升级任务的信息
func (*DmOtaFirmwareJob) TableName ¶
func (m *DmOtaFirmwareJob) TableName() string
type DmOtaFirmwareJobDynamic ¶
type DmOtaFirmwareJobDynamic struct { /* 动态升级模式。取值范围: 1(默认):除了升级当前满足升级条件的设备,还将持续检查设备是否满足升级条件,对满足升级条件的设备进行升级。 2:仅对后续上报新版本号的设备生效。 动态升级 */ DynamicMode int64 `gorm:"column:dynamic_mode"` // }
type DmOtaFirmwareJobStatic ¶
type DmOtaFirmwareJobStatic struct { /* 定向升级的设备名称列表。 使用差分升级包进行定向升级时,要升级的设备的当前 OTA 模块版本号需与差分升级包的待升级版本号(SrcVersion)相同。 可以调用 QueryDeviceDetail ,查看设备 OTA 模块版本号(FirmwareVersion)。 列表中的设备所属的产品必须与升级包所属产品一致。 列表中不能有重复的设备名称。 最多可传入 200 个设备名称。 静态升级 */ TargetDeviceNames []string `gorm:"column:target_device_names;type:json;serializer:json"` // 定向升级的设备名称列表。最多可传入200个设备名称。以逗号分隔 /* 指定结束升级的时间。 结束时间距发起时间(ScheduleTime)最少 1 小时,最多为 30 天。取值为 13 位毫秒值时间戳。 不传入该参数,则表示不会强制结束升级。 静态升级 */ ScheduleFinishTime int64 `gorm:"column:schedule_finish_time"` // 指定结束升级的时间,单位为毫秒。 /* 指定发起 OTA 升级的时间。 定时时间范围需为当前时间的 5 分钟后至 7 天内。取值为秒时间戳。 不传入该参数,则表示立即升级。 静态升级 */ ScheduleTime int64 `gorm:"column:schedule_time"` }
type DmOtaModuleInfo ¶
type DmOtaModuleInfo struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;uniqueIndex:tc_un;type:varchar(20)" ` // 设备所属产品的productID Code string `gorm:"column:code;uniqueIndex:tc_un;type:varchar(64)"` Name string `gorm:"column:name;type:varchar(64)"` // 固件名称 Desc string `gorm:"column:desc;type:varchar(200)"` // 描述 stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:tc_un;"` }
产品固件升级包信息表
func (*DmOtaModuleInfo) TableName ¶
func (m *DmOtaModuleInfo) TableName() string
type DmProductCategory ¶
type DmProductCategory struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` Name string `gorm:"column:name;uniqueIndex:pn;type:varchar(100);NOT NULL"` // 产品品类名称 Desc string `gorm:"column:desc;type:varchar(200)"` // 描述 HeadImg string `gorm:"column:head_img;type:varchar(200)"` // 图片 ParentID int64 `gorm:"column:parent_id;type:bigint;NOT NULL"` // 上级区域ID(雪花ID) IDPath string `gorm:"column:id_path;type:varchar(100);NOT NULL"` // 1-2-3-的格式记录顶级区域到当前区域的路径 IsLeaf int64 `gorm:"column:is_leaf;type:bigint;default:1;NOT NULL"` //是否是叶子节点 DeviceCount int64 `gorm:"column:device_count;type:bigint;default:0"` //该产品品类下的设备数量统计 stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:pn"` }
func (*DmProductCategory) TableName ¶
func (m *DmProductCategory) TableName() string
type DmProductCategorySchema ¶
type DmProductCategorySchema struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductCategoryID int64 `gorm:"column:product_category_id;uniqueIndex:pn;type:bigint;NOT NULL"` // 产品品类id Identifier string `gorm:"column:identifier;type:varchar(200);uniqueIndex:pn"` // 标识符的id stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:pn"` }
func (*DmProductCategorySchema) TableName ¶
func (m *DmProductCategorySchema) TableName() string
type DmProductCustom ¶
type DmProductCustom struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;uniqueIndex:pn;type:varchar(100);NOT NULL"` // 产品id ScriptLang int64 `gorm:"column:script_lang;type:smallint;default:1"` // 脚本语言类型 1:JavaScript 2:lua 3:python CustomTopics []*productCustom.CustomTopic `gorm:"column:custom_topics;type:json"` // 自定义topic数组 TransformScript string `gorm:"column:transform_script;type:text"` // 协议转换脚本 LoginAuthScript string `gorm:"column:login_auth_script;type:text"` // 登录认证脚本 stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:pn"` ProductInfo *DmProductInfo `gorm:"foreignKey:ProductID;references:ProductID"` }
产品自定义协议表
func (*DmProductCustom) TableName ¶
func (m *DmProductCustom) TableName() string
type DmProductID ¶
type DmProductID struct {
ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"`
}
func (*DmProductID) TableName ¶
func (m *DmProductID) TableName() string
type DmProductInfo ¶
type DmProductInfo struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;type:varchar(100);uniqueIndex:pd;NOT NULL"` // 产品id ProductName string `gorm:"column:product_name;type:varchar(100);NOT NULL"` // 产品名称 ProductImg string `gorm:"column:product_img;type:varchar(200)"` // 产品图片 ProductType int64 `gorm:"column:product_type;type:smallint;default:1"` // 产品状态:1:开发中,2:审核中,3:已发布 AuthMode int64 `gorm:"column:auth_mode;type:smallint;default:1"` // 认证方式:1:账密认证,2:秘钥认证 DeviceType int64 `gorm:"column:device_type;index;type:smallint;default:1"` // 设备类型:1:设备,2:网关,3:子设备 CategoryID int64 `gorm:"column:category_id;type:integer;default:2"` // 产品品类 2:未分类 NetType int64 `gorm:"column:net_type;type:smallint;default:1"` // 通讯方式:1:其他,2:wi-fi,3:2G/3G/4G,4:5G,5:BLE,6:LoRaWAN ProtocolCode string `gorm:"column:protocol_code;type:varchar(100);default:iThings"` // 协议code,默认iThings iThings,iThings-thingsboard,wumei,aliyun,huaweiyun,tuya AutoRegister int64 `gorm:"column:auto_register;type:smallint;default:1"` // 动态注册:1:关闭,2:打开,3:打开并自动创建设备 DeviceSchemaMode int64 `gorm:"column:device_schema_mode;type:smallint;default:1"` // 设备物模型模式:1:关闭,2:设备自动创建3: 设备自动创建及上报无定义自动创建 Secret string `gorm:"column:secret;type:varchar(50)"` // 动态注册产品秘钥 Desc string `gorm:"column:desc;type:varchar(200)"` // 描述 TrialTime int64 `gorm:"column:trial_time"` //试用时间(单位为天,为0不限制) Status devices.ProductStatus `gorm:"column:status;type:smallint;default:1"` SceneMode string `gorm:"column:scene_mode;type:varchar(20);default:rw"` // 场景模式 读写类型: r(只读) rw(可读可写) none(不参与场景) Tags map[string]string `gorm:"column:tags;type:json;serializer:json;NOT NULL;default:'{}'"` // 产品标签 ProtocolConf map[string]string `gorm:"column:protocol_conf;type:json;serializer:json;NOT NULL;default:'{}'"` // 自定义协议配置 stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;uniqueIndex:pd"` Category *DmProductCategory `gorm:"foreignKey:ID;references:CategoryID"` // 添加外键 Protocol *DmProtocolInfo `gorm:"foreignKey:Code;references:ProtocolCode"` //Devices []*DmDeviceInfo `gorm:"foreignKey:ProductID;references:ProductID"` // 添加外键 CustomUi map[string]*ProductCustomUi `gorm:"column:customUi;type:json;serializer:json;NOT NULL;default:'{}'"` }
产品信息表
func (*DmProductInfo) TableName ¶
func (m *DmProductInfo) TableName() string
type DmProductRemoteConfig ¶
type DmProductRemoteConfig struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;uniqueIndex:pn;type:varchar(100);NOT NULL"` // 产品id Content string `gorm:"column:content;type:json;NOT NULL"` // 配置内容 stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:pn"` ProductInfo *DmProductInfo `gorm:"foreignKey:ProductID;references:ProductID"` }
产品远程配置表
func (*DmProductRemoteConfig) TableName ¶
func (m *DmProductRemoteConfig) TableName() string
type DmProductSchema ¶
type DmProductSchema struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;uniqueIndex:identifier;index:product_id_type;type:varchar(100);NOT NULL"` // 产品id DmSchemaCore stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:identifier"` ProductInfo *DmProductInfo `gorm:"foreignKey:ProductID;references:ProductID"` }
产品物模型表
func (*DmProductSchema) TableName ¶
func (m *DmProductSchema) TableName() string
type DmProtocolInfo ¶
type DmProtocolInfo struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` Name string `gorm:"column:name;uniqueIndex:pn;type:varchar(100);NOT NULL"` // 协议名称 Code string `gorm:"column:code;uniqueIndex:pc;type:varchar(100);default:iThings"` // iThings,iThings-thingsboard,wumei,aliyun,huaweiyun,tuya TransProtocol string `gorm:"column:trans_protocol;type:varchar(100);default:mqtt"` // 传输协议: mqtt,tcp,udp Desc string `gorm:"column:desc;type:varchar(200)"` // 描述 ConfigFields protocol.ConfigFields `gorm:"column:config_fields;type:json;serializer:json;NOT NULL;default:'[]'"` // 需要配置的字段列表,没有可以不传 ConfigInfos protocol.ConfigInfos `gorm:"column:config_infos;type:json;serializer:json;NOT NULL;default:'[]'"` // 配置列表 Endpoints []string `gorm:"column:endpoints;type:json;serializer:json;NOT NULL;default:'[]'"` // 协议端点,如果填写了优先使用该字段 EtcdKey string `gorm:"column:etcd_key;type:varchar(200);default:null"` // 服务etcd发现的key etcd key stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:pc;uniqueIndex:pn"` }
自定义协议表
func (*DmProtocolInfo) TableName ¶
func (m *DmProtocolInfo) TableName() string
type DmProtocolService ¶ added in v1.0.2
type DmProtocolService struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` Code string `gorm:"column:code;uniqueIndex:pc;type:varchar(100);default:iThings"` // Ip string `gorm:"column:ip;uniqueIndex:pc;type:varchar(100);not null"` // Port int64 `gorm:"column:port;uniqueIndex:pc;type:varchar(200)"` // Status int64 `gorm:"column:status;type:bigint;default:2"` stores.NoDelTime }
func (*DmProtocolService) TableName ¶ added in v1.0.2
func (m *DmProtocolService) TableName() string
type DmSchemaCore ¶
type DmSchemaCore struct { Tag schema.Tag `gorm:"column:tag;type:smallint;default:1"` // 物模型标签 1:自定义 2:可选 3:必选 必选不可删除 Type int64 `gorm:"column:type;index:product_id_type;type:smallint;default:1"` // 物模型类型 1:property属性 2:event事件 3:action行为 Identifier string `gorm:"column:identifier;uniqueIndex:identifier;type:varchar(100);NOT NULL"` // 标识符 ExtendConfig string `gorm:"column:extend_config;type:text"` //拓展参数 Required int64 `gorm:"column:required;type:smallint;default:2"` // 是否必须,1是 2否 Name string `gorm:"column:name;type:varchar(100);NOT NULL"` // 功能名称 Desc string `gorm:"column:desc;type:varchar(200)"` // 描述 IsCanSceneLinkage int64 `gorm:"column:is_can_scene_linkage;type:smallint;default:1"` // 是否放到场景联动中 FuncGroup int64 `gorm:"column:func_group;type:smallint;default:1"` // 功能分类: 1:普通功能 2:系统功能 ControlMode int64 `gorm:"column:control_mode;type:smallint;default:1"` //控制模式: 1: 可以群控,可以单控 2:只能单控 UserPerm int64 `gorm:"column:user_auth;type:smallint;default:3"` //用户权限操作: 1:r(只读) 3:rw(可读可写) IsHistory int64 `gorm:"column:is_history;type:smallint;default:1"` // 是否存储历史记录 Affordance string `gorm:"column:affordance;type:json;NOT NULL"` // 各类型的自定义功能定义 Order int64 `gorm:"column:order;type:BIGINT;default:1;NOT NULL"` // 左侧table排序序号 }
func ToActionPo ¶
func ToActionPo(in *schema.Action) DmSchemaCore
func ToEventPo ¶
func ToEventPo(in *schema.Event) DmSchemaCore
func ToPropertyPo ¶
func ToPropertyPo(in *schema.Property) DmSchemaCore
type DmSchemaInfo ¶ added in v1.0.5
type DmSchemaInfo struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` ProductID string `gorm:"column:product_id;uniqueIndex:identifier;index:product_id_type;type:varchar(100);NOT NULL"` // 产品id DeviceName sql.NullString `gorm:"column:device_name;uniqueIndex:identifier;index:product_id_type;type:varchar(100);default:null"` // 产品id DmSchemaCore stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:identifier"` }
产品物模型表
func (*DmSchemaInfo) TableName ¶ added in v1.0.5
func (m *DmSchemaInfo) TableName() string
type DmUserDeviceCollect ¶
type DmUserDeviceCollect struct { ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` TenantCode stores.TenantCode `gorm:"column:tenant_code;index;type:VARCHAR(50);NOT NULL"` // 租户编码 ProjectID stores.ProjectID `gorm:"column:project_id;type:bigint;default:0;NOT NULL"` // 项目ID(雪花ID) UserID int64 `gorm:"column:user_id;type:BIGINT;uniqueIndex:product_id_deviceName;NOT NULL"` // 问题提出的用户 ProductID string `gorm:"column:product_id;type:varchar(100);uniqueIndex:product_id_deviceName;NOT NULL"` // 产品id DeviceName string `gorm:"column:device_name;uniqueIndex:product_id_deviceName;type:varchar(100);NOT NULL"` // 设备名称 stores.NoDelTime DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;uniqueIndex:product_id_deviceName"` }
func (*DmUserDeviceCollect) TableName ¶
func (m *DmUserDeviceCollect) TableName() string
type DmUserDeviceShare ¶
type DmUserDeviceShare struct {}
func (*DmUserDeviceShare) TableName ¶
func (m *DmUserDeviceShare) TableName() string
type ExampleFilter ¶
type ExampleFilter struct { }
type ExampleRepo ¶
type ExampleRepo struct {
// contains filtered or unexported fields
}
func NewExampleRepo ¶
func NewExampleRepo(in any) *ExampleRepo
func (ExampleRepo) CountByFilter ¶
func (p ExampleRepo) CountByFilter(ctx context.Context, f ExampleFilter) (size int64, err error)
func (ExampleRepo) DeleteByFilter ¶
func (p ExampleRepo) DeleteByFilter(ctx context.Context, f ExampleFilter) error
func (ExampleRepo) FindByFilter ¶
func (p ExampleRepo) FindByFilter(ctx context.Context, f ExampleFilter, page *stores.PageInfo) ([]*DmExample, error)
func (ExampleRepo) FindOneByFilter ¶
func (p ExampleRepo) FindOneByFilter(ctx context.Context, f ExampleFilter) (*DmExample, error)
func (ExampleRepo) MultiInsert ¶
func (p ExampleRepo) MultiInsert(ctx context.Context, data []*DmExample) error
批量插入 LightStrategyDevice 记录
func (ExampleRepo) UpdateWithField ¶
func (d ExampleRepo) UpdateWithField(ctx context.Context, f ExampleFilter, updates map[string]any) error
type GatewayDeviceFilter ¶
type GatewayDeviceRepo ¶
type GatewayDeviceRepo struct {
// contains filtered or unexported fields
}
func NewGatewayDeviceRepo ¶
func NewGatewayDeviceRepo(in any) *GatewayDeviceRepo
func (GatewayDeviceRepo) CountByFilter ¶
func (g GatewayDeviceRepo) CountByFilter(ctx context.Context, f GatewayDeviceFilter) (size int64, err error)
func (GatewayDeviceRepo) DeleteDevAll ¶
func (GatewayDeviceRepo) FindByFilter ¶
func (g GatewayDeviceRepo) FindByFilter(ctx context.Context, f GatewayDeviceFilter, page *stores.PageInfo) ([]*DmGatewayDevice, error)
func (GatewayDeviceRepo) FindOneByFilter ¶
func (p GatewayDeviceRepo) FindOneByFilter(ctx context.Context, f GatewayDeviceFilter) (*DmGatewayDevice, error)
func (GatewayDeviceRepo) MultiDelete ¶
func (m GatewayDeviceRepo) MultiDelete(ctx context.Context, gateway *devices.Core, subDevice []*devices.Core) error
批量插入 LightStrategyDevice 记录
func (GatewayDeviceRepo) MultiInsert ¶
type GroupDeviceFilter ¶
type GroupDeviceRepo ¶
type GroupDeviceRepo struct {
// contains filtered or unexported fields
}
func NewGroupDeviceRepo ¶
func NewGroupDeviceRepo(in any) *GroupDeviceRepo
func (GroupDeviceRepo) CountByFilter ¶
func (p GroupDeviceRepo) CountByFilter(ctx context.Context, f GroupDeviceFilter) (size int64, err error)
func (GroupDeviceRepo) DeleteByFilter ¶
func (p GroupDeviceRepo) DeleteByFilter(ctx context.Context, f GroupDeviceFilter) error
func (GroupDeviceRepo) FindByFilter ¶
func (p GroupDeviceRepo) FindByFilter(ctx context.Context, f GroupDeviceFilter, page *stores.PageInfo) ([]*DmGroupDevice, error)
func (GroupDeviceRepo) FindOneByFilter ¶
func (p GroupDeviceRepo) FindOneByFilter(ctx context.Context, f GroupDeviceFilter) (*DmGroupDevice, error)
func (GroupDeviceRepo) MultiDelete ¶
func (m GroupDeviceRepo) MultiDelete(ctx context.Context, groupID int64, data []*devices.Core) error
批量插入 LightStrategyDevice 记录
func (GroupDeviceRepo) MultiInsert ¶
func (m GroupDeviceRepo) MultiInsert(ctx context.Context, data []*DmGroupDevice) error
批量插入 LightStrategyDevice 记录
func (GroupDeviceRepo) MultiUpdate ¶
func (p GroupDeviceRepo) MultiUpdate(ctx context.Context, groupID int64, devices []*DmGroupDevice) error
type GroupInfoFilter ¶
type GroupInfoRepo ¶
type GroupInfoRepo struct {
// contains filtered or unexported fields
}
func NewGroupInfoRepo ¶
func NewGroupInfoRepo(in any) *GroupInfoRepo
func (GroupInfoRepo) CountByFilter ¶
func (p GroupInfoRepo) CountByFilter(ctx context.Context, f GroupInfoFilter) (size int64, err error)
func (GroupInfoRepo) DeleteByFilter ¶
func (g GroupInfoRepo) DeleteByFilter(ctx context.Context, f GroupInfoFilter) error
func (GroupInfoRepo) FindByFilter ¶
func (p GroupInfoRepo) FindByFilter(ctx context.Context, f GroupInfoFilter, page *stores.PageInfo) ([]*DmGroupInfo, error)
func (GroupInfoRepo) FindOne ¶
func (p GroupInfoRepo) FindOne(ctx context.Context, id int64) (*DmGroupInfo, error)
func (GroupInfoRepo) FindOneByFilter ¶
func (g GroupInfoRepo) FindOneByFilter(ctx context.Context, f GroupInfoFilter) (*DmGroupInfo, error)
func (GroupInfoRepo) Insert ¶
func (g GroupInfoRepo) Insert(ctx context.Context, data *DmGroupInfo) error
func (GroupInfoRepo) Update ¶
func (g GroupInfoRepo) Update(ctx context.Context, data *DmGroupInfo) error
func (GroupInfoRepo) UpdateGroupDeviceCount ¶
func (g GroupInfoRepo) UpdateGroupDeviceCount(ctx context.Context, id int64) error
func (GroupInfoRepo) UpdateWithField ¶
func (d GroupInfoRepo) UpdateWithField(ctx context.Context, f GroupInfoFilter, updates map[string]any) error
type OtaFirmwareDeviceFilter ¶
type OtaFirmwareDeviceFilter struct { IDs []int64 FirmwareID int64 JobID int64 ProductID string DeviceName string DeviceNames []string WithScheduleTime bool //Msg int64 Statues []int64 SrcVersion string DestVersion string WithFirmware bool WithJob bool WithFiles bool IsOnline int64 LastLogin time.Time RetryCount *stores.Cmp PushTime *stores.Cmp LastFailureTime *stores.Cmp }
type OtaFirmwareDeviceRepo ¶
type OtaFirmwareDeviceRepo struct {
// contains filtered or unexported fields
}
func NewOtaFirmwareDeviceRepo ¶
func NewOtaFirmwareDeviceRepo(in any) *OtaFirmwareDeviceRepo
func (OtaFirmwareDeviceRepo) BatchUpdateField ¶
func (p OtaFirmwareDeviceRepo) BatchUpdateField(ctx context.Context, f OtaFirmwareDeviceFilter, updateData map[string]interface{}) error
批量更新
func (OtaFirmwareDeviceRepo) CountByFilter ¶
func (p OtaFirmwareDeviceRepo) CountByFilter(ctx context.Context, f OtaFirmwareDeviceFilter) (size int64, err error)
func (OtaFirmwareDeviceRepo) Delete ¶
func (p OtaFirmwareDeviceRepo) Delete(ctx context.Context, id int64) error
func (OtaFirmwareDeviceRepo) DeleteByFilter ¶
func (p OtaFirmwareDeviceRepo) DeleteByFilter(ctx context.Context, f OtaFirmwareDeviceFilter) error
func (OtaFirmwareDeviceRepo) FindByFilter ¶
func (p OtaFirmwareDeviceRepo) FindByFilter(ctx context.Context, f OtaFirmwareDeviceFilter, page *stores.PageInfo) ([]*DmOtaFirmwareDevice, error)
func (OtaFirmwareDeviceRepo) FindByFilters ¶ added in v1.0.4
func (p OtaFirmwareDeviceRepo) FindByFilters(ctx context.Context, f []OtaFirmwareDeviceFilter, page *stores.PageInfo) ([]*DmOtaFirmwareDevice, error)
func (OtaFirmwareDeviceRepo) FindOne ¶
func (p OtaFirmwareDeviceRepo) FindOne(ctx context.Context, id int64) (*DmOtaFirmwareDevice, error)
func (OtaFirmwareDeviceRepo) FindOneByFilter ¶
func (p OtaFirmwareDeviceRepo) FindOneByFilter(ctx context.Context, f OtaFirmwareDeviceFilter) (*DmOtaFirmwareDevice, error)
func (OtaFirmwareDeviceRepo) Insert ¶
func (p OtaFirmwareDeviceRepo) Insert(ctx context.Context, data *DmOtaFirmwareDevice) error
func (OtaFirmwareDeviceRepo) MultiInsert ¶
func (p OtaFirmwareDeviceRepo) MultiInsert(ctx context.Context, data []*DmOtaFirmwareDevice) error
批量插入 LightStrategyDevice 记录
func (OtaFirmwareDeviceRepo) Update ¶
func (p OtaFirmwareDeviceRepo) Update(ctx context.Context, data *DmOtaFirmwareDevice) error
func (OtaFirmwareDeviceRepo) UpdateStatusByFilter ¶
func (p OtaFirmwareDeviceRepo) UpdateStatusByFilter(ctx context.Context, f OtaFirmwareDeviceFilter, status int64, detail string) error
func (OtaFirmwareDeviceRepo) UpdateStatusByFilters ¶ added in v1.0.4
func (p OtaFirmwareDeviceRepo) UpdateStatusByFilters(ctx context.Context, f []OtaFirmwareDeviceFilter, status int64, detail string) error
type OtaFirmwareFileFilter ¶
type OtaFirmwareFileRepo ¶
type OtaFirmwareFileRepo struct {
// contains filtered or unexported fields
}
func NewOtaFirmwareFileRepo ¶
func NewOtaFirmwareFileRepo(in any) *OtaFirmwareFileRepo
func (OtaFirmwareFileRepo) CountByFilter ¶
func (p OtaFirmwareFileRepo) CountByFilter(ctx context.Context, f OtaFirmwareFileFilter) (size int64, err error)
func (OtaFirmwareFileRepo) Delete ¶
func (g OtaFirmwareFileRepo) Delete(ctx context.Context, id int64) error
func (OtaFirmwareFileRepo) DeleteByFilter ¶
func (g OtaFirmwareFileRepo) DeleteByFilter(ctx context.Context, f OtaFirmwareFileFilter) error
func (OtaFirmwareFileRepo) FindByFilter ¶
func (p OtaFirmwareFileRepo) FindByFilter(ctx context.Context, f OtaFirmwareFileFilter, page *stores.PageInfo) ([]*DmOtaFirmwareFile, error)
func (OtaFirmwareFileRepo) FindOne ¶
func (g OtaFirmwareFileRepo) FindOne(ctx context.Context, id int64) (*DmOtaFirmwareFile, error)
func (OtaFirmwareFileRepo) FindOneByFilter ¶
func (g OtaFirmwareFileRepo) FindOneByFilter(ctx context.Context, f OtaFirmwareFileFilter) (*DmOtaFirmwareFile, error)
func (OtaFirmwareFileRepo) Insert ¶
func (g OtaFirmwareFileRepo) Insert(ctx context.Context, data *DmOtaFirmwareFile) error
func (OtaFirmwareFileRepo) MultiInsert ¶
func (m OtaFirmwareFileRepo) MultiInsert(ctx context.Context, data []*DmOtaFirmwareFile) error
批量插入 LightStrategyDevice 记录
func (OtaFirmwareFileRepo) Update ¶
func (g OtaFirmwareFileRepo) Update(ctx context.Context, data *DmOtaFirmwareFile) error
type OtaFirmwareInfoFilter ¶
type OtaFirmwareInfoRepo ¶
type OtaFirmwareInfoRepo struct {
// contains filtered or unexported fields
}
func NewOtaFirmwareInfoRepo ¶
func NewOtaFirmwareInfoRepo(in any) *OtaFirmwareInfoRepo
func (OtaFirmwareInfoRepo) CountByFilter ¶
func (p OtaFirmwareInfoRepo) CountByFilter(ctx context.Context, f OtaFirmwareInfoFilter) (size int64, err error)
func (OtaFirmwareInfoRepo) Delete ¶
func (g OtaFirmwareInfoRepo) Delete(ctx context.Context, id int64) error
func (OtaFirmwareInfoRepo) DeleteByFilter ¶
func (g OtaFirmwareInfoRepo) DeleteByFilter(ctx context.Context, f OtaFirmwareInfoFilter) error
func (OtaFirmwareInfoRepo) FindByFilter ¶
func (p OtaFirmwareInfoRepo) FindByFilter(ctx context.Context, f OtaFirmwareInfoFilter, page *stores.PageInfo) ([]*DmOtaFirmwareInfo, error)
func (OtaFirmwareInfoRepo) FindOne ¶
func (g OtaFirmwareInfoRepo) FindOne(ctx context.Context, id int64) (*DmOtaFirmwareInfo, error)
func (OtaFirmwareInfoRepo) FindOneByFilter ¶
func (g OtaFirmwareInfoRepo) FindOneByFilter(ctx context.Context, f OtaFirmwareInfoFilter) (*DmOtaFirmwareInfo, error)
func (OtaFirmwareInfoRepo) Insert ¶
func (g OtaFirmwareInfoRepo) Insert(ctx context.Context, data *DmOtaFirmwareInfo) error
func (OtaFirmwareInfoRepo) MultiInsert ¶
func (m OtaFirmwareInfoRepo) MultiInsert(ctx context.Context, data []*DmOtaFirmwareInfo) error
批量插入 LightStrategyDevice 记录
func (OtaFirmwareInfoRepo) Update ¶
func (g OtaFirmwareInfoRepo) Update(ctx context.Context, data *DmOtaFirmwareInfo) error
type OtaJobFilter ¶
type OtaJobRepo ¶
type OtaJobRepo struct {
// contains filtered or unexported fields
}
func NewOtaJobRepo ¶
func NewOtaJobRepo(in any) *OtaJobRepo
func (OtaJobRepo) CountByFilter ¶
func (p OtaJobRepo) CountByFilter(ctx context.Context, f OtaJobFilter) (size int64, err error)
func (OtaJobRepo) DeleteByFilter ¶
func (p OtaJobRepo) DeleteByFilter(ctx context.Context, f OtaJobFilter) error
func (OtaJobRepo) FindByFilter ¶
func (p OtaJobRepo) FindByFilter(ctx context.Context, f OtaJobFilter, page *stores.PageInfo) ([]*DmOtaFirmwareJob, error)
func (OtaJobRepo) FindOne ¶
func (p OtaJobRepo) FindOne(ctx context.Context, id int64) (*DmOtaFirmwareJob, error)
func (OtaJobRepo) FindOneByFilter ¶
func (p OtaJobRepo) FindOneByFilter(ctx context.Context, f OtaJobFilter) (*DmOtaFirmwareJob, error)
func (OtaJobRepo) Insert ¶
func (p OtaJobRepo) Insert(ctx context.Context, data *DmOtaFirmwareJob) error
func (OtaJobRepo) MultiInsert ¶
func (p OtaJobRepo) MultiInsert(ctx context.Context, data []*DmOtaFirmwareJob) error
批量插入 LightStrategyDevice 记录
func (OtaJobRepo) Update ¶
func (p OtaJobRepo) Update(ctx context.Context, data *DmOtaFirmwareJob) error
type OtaModuleInfoFilter ¶
type OtaModuleInfoRepo ¶
type OtaModuleInfoRepo struct {
// contains filtered or unexported fields
}
func NewOtaModuleInfoRepo ¶
func NewOtaModuleInfoRepo(in any) *OtaModuleInfoRepo
func (OtaModuleInfoRepo) CountByFilter ¶
func (p OtaModuleInfoRepo) CountByFilter(ctx context.Context, f OtaModuleInfoFilter) (size int64, err error)
func (OtaModuleInfoRepo) Delete ¶
func (p OtaModuleInfoRepo) Delete(ctx context.Context, id int64) error
func (OtaModuleInfoRepo) DeleteByFilter ¶
func (p OtaModuleInfoRepo) DeleteByFilter(ctx context.Context, f OtaModuleInfoFilter) error
func (OtaModuleInfoRepo) FindByFilter ¶
func (p OtaModuleInfoRepo) FindByFilter(ctx context.Context, f OtaModuleInfoFilter, page *stores.PageInfo) ([]*DmOtaModuleInfo, error)
func (OtaModuleInfoRepo) FindOne ¶
func (p OtaModuleInfoRepo) FindOne(ctx context.Context, id int64) (*DmOtaModuleInfo, error)
func (OtaModuleInfoRepo) FindOneByFilter ¶
func (p OtaModuleInfoRepo) FindOneByFilter(ctx context.Context, f OtaModuleInfoFilter) (*DmOtaModuleInfo, error)
func (OtaModuleInfoRepo) Insert ¶
func (p OtaModuleInfoRepo) Insert(ctx context.Context, data *DmOtaModuleInfo) error
func (OtaModuleInfoRepo) MultiInsert ¶
func (p OtaModuleInfoRepo) MultiInsert(ctx context.Context, data []*DmOtaModuleInfo) error
批量插入 LightStrategyDevice 记录
func (OtaModuleInfoRepo) Update ¶
func (p OtaModuleInfoRepo) Update(ctx context.Context, data *DmOtaModuleInfo) error
type ProductCategoryFilter ¶
type ProductCategoryRepo ¶
type ProductCategoryRepo struct {
// contains filtered or unexported fields
}
func NewProductCategoryRepo ¶
func NewProductCategoryRepo(in any) *ProductCategoryRepo
func (ProductCategoryRepo) CountByFilter ¶
func (p ProductCategoryRepo) CountByFilter(ctx context.Context, f ProductCategoryFilter) (size int64, err error)
func (ProductCategoryRepo) Delete ¶
func (p ProductCategoryRepo) Delete(ctx context.Context, id int64) error
func (ProductCategoryRepo) DeleteByFilter ¶
func (p ProductCategoryRepo) DeleteByFilter(ctx context.Context, f ProductCategoryFilter) error
func (ProductCategoryRepo) FindByFilter ¶
func (p ProductCategoryRepo) FindByFilter(ctx context.Context, f ProductCategoryFilter, page *stores.PageInfo) ([]*DmProductCategory, error)
func (ProductCategoryRepo) FindOne ¶
func (p ProductCategoryRepo) FindOne(ctx context.Context, id int64) (*DmProductCategory, error)
func (ProductCategoryRepo) FindOneByFilter ¶
func (p ProductCategoryRepo) FindOneByFilter(ctx context.Context, f ProductCategoryFilter) (*DmProductCategory, error)
func (ProductCategoryRepo) Insert ¶
func (p ProductCategoryRepo) Insert(ctx context.Context, data *DmProductCategory) error
func (ProductCategoryRepo) MultiInsert ¶
func (p ProductCategoryRepo) MultiInsert(ctx context.Context, data []*DmProductCategory) error
批量插入 LightStrategyDevice 记录
func (ProductCategoryRepo) Update ¶
func (p ProductCategoryRepo) Update(ctx context.Context, data *DmProductCategory) error
func (ProductCategoryRepo) UpdateWithField ¶
func (d ProductCategoryRepo) UpdateWithField(ctx context.Context, f ProductCategoryFilter, updates map[string]any) error
type ProductCategorySchemaRepo ¶
type ProductCategorySchemaRepo struct {
// contains filtered or unexported fields
}
func NewProductCategorySchemaRepo ¶
func NewProductCategorySchemaRepo(in any) *ProductCategorySchemaRepo
func (ProductCategorySchemaRepo) CountByFilter ¶
func (p ProductCategorySchemaRepo) CountByFilter(ctx context.Context, f ProductCategorySchemaFilter) (size int64, err error)
func (ProductCategorySchemaRepo) Delete ¶
func (p ProductCategorySchemaRepo) Delete(ctx context.Context, id int64) error
func (ProductCategorySchemaRepo) DeleteByFilter ¶
func (p ProductCategorySchemaRepo) DeleteByFilter(ctx context.Context, f ProductCategorySchemaFilter) error
func (ProductCategorySchemaRepo) FindByFilter ¶
func (p ProductCategorySchemaRepo) FindByFilter(ctx context.Context, f ProductCategorySchemaFilter, page *stores.PageInfo) ([]*DmProductCategorySchema, error)
func (ProductCategorySchemaRepo) FindOne ¶
func (p ProductCategorySchemaRepo) FindOne(ctx context.Context, id int64) (*DmProductCategorySchema, error)
func (ProductCategorySchemaRepo) FindOneByFilter ¶
func (p ProductCategorySchemaRepo) FindOneByFilter(ctx context.Context, f ProductCategorySchemaFilter) (*DmProductCategorySchema, error)
func (ProductCategorySchemaRepo) Insert ¶
func (p ProductCategorySchemaRepo) Insert(ctx context.Context, data *DmProductCategorySchema) error
func (ProductCategorySchemaRepo) MultiInsert ¶
func (p ProductCategorySchemaRepo) MultiInsert(ctx context.Context, data []*DmProductCategorySchema) error
批量插入 LightStrategyDevice 记录
func (ProductCategorySchemaRepo) MultiUpdate ¶
func (ProductCategorySchemaRepo) Update ¶
func (p ProductCategorySchemaRepo) Update(ctx context.Context, data *DmProductCategorySchema) error
type ProductCustomRepo ¶
type ProductCustomRepo struct {
// contains filtered or unexported fields
}
func NewProductCustomRepo ¶
func NewProductCustomRepo(in any) *ProductCustomRepo
func (ProductCustomRepo) FindOneByProductID ¶
func (p ProductCustomRepo) FindOneByProductID(ctx context.Context, productID string) (*DmProductCustom, error)
func (ProductCustomRepo) Insert ¶
func (p ProductCustomRepo) Insert(ctx context.Context, data *DmProductCustom) error
func (ProductCustomRepo) Update ¶
func (p ProductCustomRepo) Update(ctx context.Context, data *DmProductCustom) error
type ProductCustomUi ¶
type ProductFilter ¶
type ProductFilter struct { DeviceType int64 DeviceTypes []int64 ProductName string ProductIDs []string ProductNames []string Tags map[string]string ProtocolConf map[string]string WithProtocol bool WithCategory bool ProtocolCode string CategoryIDs []int64 SceneMode string SceneModes []string Status devices.ProductStatus Statuses []devices.ProductStatus AreaID int64 NetType int64 }
type ProductIDFilter ¶
type ProductIDFilter struct { }
type ProductIDRepo ¶
type ProductIDRepo struct {
// contains filtered or unexported fields
}
func NewProductIDRepo ¶
func NewProductIDRepo(in any) *ProductIDRepo
func (ProductIDRepo) CountByFilter ¶
func (p ProductIDRepo) CountByFilter(ctx context.Context, f ProductIDFilter) (size int64, err error)
func (ProductIDRepo) DeleteByFilter ¶
func (p ProductIDRepo) DeleteByFilter(ctx context.Context, f ProductIDFilter) error
func (ProductIDRepo) FindByFilter ¶
func (p ProductIDRepo) FindByFilter(ctx context.Context, f ProductIDFilter, page *stores.PageInfo) ([]*DmProductID, error)
func (ProductIDRepo) FindOne ¶
func (p ProductIDRepo) FindOne(ctx context.Context, id int64) (*DmProductID, error)
func (ProductIDRepo) FindOneByFilter ¶
func (p ProductIDRepo) FindOneByFilter(ctx context.Context, f ProductIDFilter) (*DmProductID, error)
func (ProductIDRepo) Insert ¶
func (p ProductIDRepo) Insert(ctx context.Context, data *DmProductID) error
func (ProductIDRepo) MultiInsert ¶
func (p ProductIDRepo) MultiInsert(ctx context.Context, data []*DmProductID) error
批量插入 LightStrategyDevice 记录
func (ProductIDRepo) Update ¶
func (p ProductIDRepo) Update(ctx context.Context, data *DmProductID) error
func (ProductIDRepo) UpdateWithField ¶
func (d ProductIDRepo) UpdateWithField(ctx context.Context, f ProductIDFilter, updates map[string]any) error
type ProductInfoRepo ¶
type ProductInfoRepo struct {
// contains filtered or unexported fields
}
func NewProductInfoRepo ¶
func NewProductInfoRepo(in any) *ProductInfoRepo
func (ProductInfoRepo) CountByFilter ¶
func (p ProductInfoRepo) CountByFilter(ctx context.Context, f ProductFilter) (size int64, err error)
func (ProductInfoRepo) DeleteByFilter ¶
func (p ProductInfoRepo) DeleteByFilter(ctx context.Context, f ProductFilter) error
func (ProductInfoRepo) FindByFilter ¶
func (p ProductInfoRepo) FindByFilter(ctx context.Context, f ProductFilter, page *stores.PageInfo) ([]*DmProductInfo, error)
func (ProductInfoRepo) FindOneByFilter ¶
func (p ProductInfoRepo) FindOneByFilter(ctx context.Context, f ProductFilter) (*DmProductInfo, error)
func (ProductInfoRepo) Insert ¶
func (p ProductInfoRepo) Insert(ctx context.Context, data *DmProductInfo) error
func (ProductInfoRepo) Update ¶
func (p ProductInfoRepo) Update(ctx context.Context, data *DmProductInfo) error
type ProductRemoteConfigRepo ¶
type ProductRemoteConfigRepo struct {
// contains filtered or unexported fields
}
func NewProductRemoteConfigRepo ¶
func NewProductRemoteConfigRepo(in any) *ProductRemoteConfigRepo
func (ProductRemoteConfigRepo) CountByFilter ¶
func (p ProductRemoteConfigRepo) CountByFilter(ctx context.Context, f RemoteConfigFilter) (size int64, err error)
func (ProductRemoteConfigRepo) DeleteByFilter ¶
func (p ProductRemoteConfigRepo) DeleteByFilter(ctx context.Context, f RemoteConfigFilter) error
func (ProductRemoteConfigRepo) FindByFilter ¶
func (p ProductRemoteConfigRepo) FindByFilter(ctx context.Context, f RemoteConfigFilter, page *stores.PageInfo) ([]*DmProductRemoteConfig, error)
func (ProductRemoteConfigRepo) FindOneByFilter ¶
func (p ProductRemoteConfigRepo) FindOneByFilter(ctx context.Context, f RemoteConfigFilter) (*DmProductRemoteConfig, error)
func (ProductRemoteConfigRepo) Insert ¶
func (p ProductRemoteConfigRepo) Insert(ctx context.Context, data *DmProductRemoteConfig) error
func (ProductRemoteConfigRepo) Update ¶
func (p ProductRemoteConfigRepo) Update(ctx context.Context, data *DmProductRemoteConfig) error
type ProductSchemaFilter ¶
type ProductSchemaFilter struct { ID int64 ProductID string //产品id 必填 ProductIDs []string //产品id列表 Type int64 //物模型类型 1:property属性 2:event事件 3:action行为 Types []int64 Tag schema.Tag //过滤条件: 物模型标签 1:自定义 2:可选 3:必选 Tags []schema.Tag Identifiers []string //过滤标识符列表 Name string IsCanSceneLinkage int64 FuncGroup int64 UserPerm int64 PropertyMode string ControlMode int64 ProductSceneMode string }
type ProductSchemaOldFilter ¶ added in v1.0.5
type ProductSchemaOldFilter struct { ID int64 ProductID string //产品id 必填 ProductIDs []string //产品id列表 Type int64 //物模型类型 1:property属性 2:event事件 3:action行为 Types []int64 Tag schema.Tag //过滤条件: 物模型标签 1:自定义 2:可选 3:必选 Tags []schema.Tag Identifiers []string //过滤标识符列表 Name string IsCanSceneLinkage int64 FuncGroup int64 UserPerm int64 PropertyMode string ControlMode int64 ProductSceneMode string }
type ProductSchemaOldRepo ¶ added in v1.0.5
type ProductSchemaOldRepo struct {
// contains filtered or unexported fields
}
func NewProductSchemaOldRepo ¶ added in v1.0.5
func NewProductSchemaOldRepo(in any) *ProductSchemaOldRepo
func (ProductSchemaOldRepo) CountByFilter ¶ added in v1.0.5
func (p ProductSchemaOldRepo) CountByFilter(ctx context.Context, f ProductSchemaFilter) (size int64, err error)
func (ProductSchemaOldRepo) DeleteByFilter ¶ added in v1.0.5
func (p ProductSchemaOldRepo) DeleteByFilter(ctx context.Context, f ProductSchemaFilter) error
func (ProductSchemaOldRepo) FindByFilter ¶ added in v1.0.5
func (p ProductSchemaOldRepo) FindByFilter(ctx context.Context, f ProductSchemaFilter, page *stores.PageInfo) ([]*DmProductSchema, error)
func (ProductSchemaOldRepo) FindOneByFilter ¶ added in v1.0.5
func (p ProductSchemaOldRepo) FindOneByFilter(ctx context.Context, f ProductSchemaFilter) (*DmProductSchema, error)
func (ProductSchemaOldRepo) FindProductIDByFilter ¶ added in v1.0.5
func (p ProductSchemaOldRepo) FindProductIDByFilter(ctx context.Context, f ProductSchemaFilter) ([]string, error)
func (ProductSchemaOldRepo) Insert ¶ added in v1.0.5
func (p ProductSchemaOldRepo) Insert(ctx context.Context, data *DmProductSchema) error
func (ProductSchemaOldRepo) MultiInsert ¶ added in v1.0.5
func (p ProductSchemaOldRepo) MultiInsert(ctx context.Context, data []*DmProductSchema) error
批量插入 LightStrategyDevice 记录
func (ProductSchemaOldRepo) MultiUpdate ¶ added in v1.0.5
func (ProductSchemaOldRepo) Update ¶ added in v1.0.5
func (p ProductSchemaOldRepo) Update(ctx context.Context, data *DmProductSchema) error
func (ProductSchemaOldRepo) UpdateWithCommon ¶ added in v1.0.5
func (p ProductSchemaOldRepo) UpdateWithCommon(ctx context.Context, common *DmCommonSchema) error
type ProductSchemaRepo ¶
type ProductSchemaRepo struct {
// contains filtered or unexported fields
}
func NewProductSchemaRepo ¶
func NewProductSchemaRepo(in any) *ProductSchemaRepo
func (ProductSchemaRepo) CountByFilter ¶
func (p ProductSchemaRepo) CountByFilter(ctx context.Context, f ProductSchemaFilter) (size int64, err error)
func (ProductSchemaRepo) DeleteByFilter ¶
func (p ProductSchemaRepo) DeleteByFilter(ctx context.Context, f ProductSchemaFilter) error
func (ProductSchemaRepo) FindByFilter ¶
func (p ProductSchemaRepo) FindByFilter(ctx context.Context, f ProductSchemaFilter, page *stores.PageInfo) ([]*DmSchemaInfo, error)
func (ProductSchemaRepo) FindOneByFilter ¶
func (p ProductSchemaRepo) FindOneByFilter(ctx context.Context, f ProductSchemaFilter) (*DmSchemaInfo, error)
func (ProductSchemaRepo) FindProductIDByFilter ¶
func (p ProductSchemaRepo) FindProductIDByFilter(ctx context.Context, f ProductSchemaFilter) ([]string, error)
func (ProductSchemaRepo) Insert ¶
func (p ProductSchemaRepo) Insert(ctx context.Context, data *DmSchemaInfo) error
func (ProductSchemaRepo) MultiInsert ¶
func (p ProductSchemaRepo) MultiInsert(ctx context.Context, data []*DmSchemaInfo) error
批量插入 LightStrategyDevice 记录
func (ProductSchemaRepo) MultiUpdate ¶
func (ProductSchemaRepo) Update ¶
func (p ProductSchemaRepo) Update(ctx context.Context, data *DmSchemaInfo) error
func (ProductSchemaRepo) UpdateWithCommon ¶
func (p ProductSchemaRepo) UpdateWithCommon(ctx context.Context, common *DmCommonSchema) error
type ProtocolInfoFilter ¶
type ProtocolInfoRepo ¶
type ProtocolInfoRepo struct {
// contains filtered or unexported fields
}
func NewProtocolInfoRepo ¶
func NewProtocolInfoRepo(in any) *ProtocolInfoRepo
func (ProtocolInfoRepo) CountByFilter ¶
func (p ProtocolInfoRepo) CountByFilter(ctx context.Context, f ProtocolInfoFilter) (size int64, err error)
func (ProtocolInfoRepo) Delete ¶
func (p ProtocolInfoRepo) Delete(ctx context.Context, id int64) error
func (ProtocolInfoRepo) DeleteByFilter ¶
func (p ProtocolInfoRepo) DeleteByFilter(ctx context.Context, f ProtocolInfoFilter) error
func (ProtocolInfoRepo) FindByFilter ¶
func (p ProtocolInfoRepo) FindByFilter(ctx context.Context, f ProtocolInfoFilter, page *stores.PageInfo) ([]*DmProtocolInfo, error)
func (ProtocolInfoRepo) FindOne ¶
func (p ProtocolInfoRepo) FindOne(ctx context.Context, id int64) (*DmProtocolInfo, error)
func (ProtocolInfoRepo) FindOneByFilter ¶
func (p ProtocolInfoRepo) FindOneByFilter(ctx context.Context, f ProtocolInfoFilter) (*DmProtocolInfo, error)
func (ProtocolInfoRepo) Insert ¶
func (p ProtocolInfoRepo) Insert(ctx context.Context, data *DmProtocolInfo) error
func (ProtocolInfoRepo) MultiInsert ¶
func (p ProtocolInfoRepo) MultiInsert(ctx context.Context, data []*DmProtocolInfo) error
批量插入 LightStrategyDevice 记录
func (ProtocolInfoRepo) Update ¶
func (p ProtocolInfoRepo) Update(ctx context.Context, data *DmProtocolInfo) error
type ProtocolServiceFilter ¶ added in v1.0.2
type ProtocolServiceRepo ¶ added in v1.0.2
type ProtocolServiceRepo struct {
// contains filtered or unexported fields
}
func NewProtocolServiceRepo ¶ added in v1.0.2
func NewProtocolServiceRepo(in any) *ProtocolServiceRepo
func (ProtocolServiceRepo) CountByFilter ¶ added in v1.0.2
func (p ProtocolServiceRepo) CountByFilter(ctx context.Context, f ProtocolServiceFilter) (size int64, err error)
func (ProtocolServiceRepo) Delete ¶ added in v1.0.2
func (p ProtocolServiceRepo) Delete(ctx context.Context, id int64) error
func (ProtocolServiceRepo) DeleteByFilter ¶ added in v1.0.2
func (p ProtocolServiceRepo) DeleteByFilter(ctx context.Context, f ProtocolServiceFilter) error
func (ProtocolServiceRepo) DownStatus ¶ added in v1.0.2
func (p ProtocolServiceRepo) DownStatus(ctx context.Context) error
func (ProtocolServiceRepo) FindByFilter ¶ added in v1.0.2
func (p ProtocolServiceRepo) FindByFilter(ctx context.Context, f ProtocolServiceFilter, page *stores.PageInfo) ([]*DmProtocolService, error)
func (ProtocolServiceRepo) FindOne ¶ added in v1.0.2
func (p ProtocolServiceRepo) FindOne(ctx context.Context, id int64) (*DmProtocolService, error)
func (ProtocolServiceRepo) FindOneByFilter ¶ added in v1.0.2
func (p ProtocolServiceRepo) FindOneByFilter(ctx context.Context, f ProtocolServiceFilter) (*DmProtocolService, error)
func (ProtocolServiceRepo) Insert ¶ added in v1.0.2
func (p ProtocolServiceRepo) Insert(ctx context.Context, data *DmProtocolService) error
func (ProtocolServiceRepo) MultiInsert ¶ added in v1.0.2
func (p ProtocolServiceRepo) MultiInsert(ctx context.Context, data []*DmProtocolService) error
批量插入 LightStrategyDevice 记录
func (ProtocolServiceRepo) Update ¶ added in v1.0.2
func (p ProtocolServiceRepo) Update(ctx context.Context, data *DmProtocolService) error
type RemoteConfigFilter ¶
type RemoteConfigFilter struct {
ProductID string
}
type SchemaInfoFilter ¶ added in v1.0.5
type SchemaInfoFilter struct { ID int64 ProductID string //产品id 必填 DeviceName string //设备ID Type int64 //物模型类型 1:property属性 2:event事件 3:action行为 Types []int64 Tag schema.Tag //过滤条件: 物模型标签 1:自定义 2:可选 3:必选 Tags []schema.Tag Identifiers []string //过滤标识符列表 Name string IsCanSceneLinkage int64 FuncGroup int64 UserPerm int64 PropertyMode string ControlMode int64 ProductSceneMode string }
type SchemaInfoRepo ¶ added in v1.0.5
type SchemaInfoRepo struct {
// contains filtered or unexported fields
}
func NewSchemaInfoRepo ¶ added in v1.0.5
func NewSchemaInfoRepo(in any) *SchemaInfoRepo
func (SchemaInfoRepo) CountByFilter ¶ added in v1.0.5
func (p SchemaInfoRepo) CountByFilter(ctx context.Context, f SchemaInfoFilter) (size int64, err error)
func (SchemaInfoRepo) DeleteByFilter ¶ added in v1.0.5
func (p SchemaInfoRepo) DeleteByFilter(ctx context.Context, f SchemaInfoFilter) error
func (SchemaInfoRepo) FindByFilter ¶ added in v1.0.5
func (p SchemaInfoRepo) FindByFilter(ctx context.Context, f SchemaInfoFilter, page *stores.PageInfo) ([]*DmSchemaInfo, error)
func (SchemaInfoRepo) FindOneByFilter ¶ added in v1.0.5
func (p SchemaInfoRepo) FindOneByFilter(ctx context.Context, f SchemaInfoFilter) (*DmSchemaInfo, error)
func (SchemaInfoRepo) Insert ¶ added in v1.0.5
func (p SchemaInfoRepo) Insert(ctx context.Context, data *DmSchemaInfo) error
func (SchemaInfoRepo) MultiInsert ¶ added in v1.0.5
func (p SchemaInfoRepo) MultiInsert(ctx context.Context, data []*DmSchemaInfo) error
批量插入 LightStrategyDevice 记录
func (SchemaInfoRepo) MultiInsert2 ¶ added in v1.0.5
func (p SchemaInfoRepo) MultiInsert2(ctx context.Context, productID string, deviceName string, schemaInfo *schema.Model) error
批量插入 LightStrategyDevice 记录
func (SchemaInfoRepo) MultiUpdate ¶ added in v1.0.5
func (SchemaInfoRepo) Update ¶ added in v1.0.5
func (p SchemaInfoRepo) Update(ctx context.Context, data *DmSchemaInfo) error
type ShadowRepo ¶
type ShadowRepo struct {
// contains filtered or unexported fields
}
func (*ShadowRepo) FindByFilter ¶
func (*ShadowRepo) MultiDelete ¶
func (*ShadowRepo) MultiUpdate ¶
type UserDeviceCollectFilter ¶
type UserDeviceCollectRepo ¶
type UserDeviceCollectRepo struct {
// contains filtered or unexported fields
}
func NewUserDeviceCollectRepo ¶
func NewUserDeviceCollectRepo(in any) *UserDeviceCollectRepo
func (UserDeviceCollectRepo) CountByFilter ¶
func (p UserDeviceCollectRepo) CountByFilter(ctx context.Context, f UserDeviceCollectFilter) (size int64, err error)
func (UserDeviceCollectRepo) Delete ¶
func (p UserDeviceCollectRepo) Delete(ctx context.Context, id int64) error
func (UserDeviceCollectRepo) DeleteByFilter ¶
func (p UserDeviceCollectRepo) DeleteByFilter(ctx context.Context, f UserDeviceCollectFilter) error
func (UserDeviceCollectRepo) FindByFilter ¶
func (p UserDeviceCollectRepo) FindByFilter(ctx context.Context, f UserDeviceCollectFilter, page *stores.PageInfo) ([]*DmUserDeviceCollect, error)
func (UserDeviceCollectRepo) FindOne ¶
func (p UserDeviceCollectRepo) FindOne(ctx context.Context, id int64) (*DmUserDeviceCollect, error)
func (UserDeviceCollectRepo) FindOneByFilter ¶
func (p UserDeviceCollectRepo) FindOneByFilter(ctx context.Context, f UserDeviceCollectFilter) (*DmUserDeviceCollect, error)
func (UserDeviceCollectRepo) Insert ¶
func (p UserDeviceCollectRepo) Insert(ctx context.Context, data *DmUserDeviceCollect) error
func (UserDeviceCollectRepo) MultiInsert ¶
func (p UserDeviceCollectRepo) MultiInsert(ctx context.Context, data []*DmUserDeviceCollect) error
批量插入 LightStrategyDevice 记录
func (UserDeviceCollectRepo) Update ¶
func (p UserDeviceCollectRepo) Update(ctx context.Context, data *DmUserDeviceCollect) error
func (UserDeviceCollectRepo) UpdateWithField ¶
func (d UserDeviceCollectRepo) UpdateWithField(ctx context.Context, f UserDeviceCollectFilter, updates map[string]any) error
type UserDeviceShareFilter ¶
type UserDeviceShareFilter struct {}
type UserDeviceShareRepo ¶
type UserDeviceShareRepo struct {
// contains filtered or unexported fields
}
func NewUserDeviceShareRepo ¶
func NewUserDeviceShareRepo(in any) *UserDeviceShareRepo
func (UserDeviceShareRepo) CountByFilter ¶
func (p UserDeviceShareRepo) CountByFilter(ctx context.Context, f UserDeviceShareFilter) (size int64, err error)
func (UserDeviceShareRepo) Delete ¶
func (p UserDeviceShareRepo) Delete(ctx context.Context, id int64) error
func (UserDeviceShareRepo) DeleteByFilter ¶
func (p UserDeviceShareRepo) DeleteByFilter(ctx context.Context, f UserDeviceShareFilter) error
func (UserDeviceShareRepo) FindByFilter ¶
func (p UserDeviceShareRepo) FindByFilter(ctx context.Context, f UserDeviceShareFilter, page *stores.PageInfo) ([]*DmUserDeviceShare, error)
func (UserDeviceShareRepo) FindOne ¶
func (p UserDeviceShareRepo) FindOne(ctx context.Context, id int64) (*DmUserDeviceShare, error)
func (UserDeviceShareRepo) FindOneByFilter ¶
func (p UserDeviceShareRepo) FindOneByFilter(ctx context.Context, f UserDeviceShareFilter) (*DmUserDeviceShare, error)
func (UserDeviceShareRepo) Insert ¶
func (p UserDeviceShareRepo) Insert(ctx context.Context, data *DmUserDeviceShare) error
func (UserDeviceShareRepo) MultiInsert ¶
func (p UserDeviceShareRepo) MultiInsert(ctx context.Context, data []*DmUserDeviceShare) error
批量插入 LightStrategyDevice 记录
func (UserDeviceShareRepo) Update ¶
func (p UserDeviceShareRepo) Update(ctx context.Context, data *DmUserDeviceShare) error
func (UserDeviceShareRepo) UpdateWithField ¶
func (d UserDeviceShareRepo) UpdateWithField(ctx context.Context, f UserDeviceShareFilter, updates map[string]any) error
Source Files ¶
- assemble.go
- commonSchema.go
- deviceInfo.go
- deviceModuleVersion.go
- deviceMsgCount.go
- deviceProfile.go
- deviceSchema.go
- example.go
- gatewayDevice.go
- groupDevice.go
- groupInfo.go
- model.go
- modelMigrate.go
- modelOta.go
- modelUser.go
- otaFirmware.go
- otaFirmwareDevice.go
- otaFirmwareFile.go
- otaFirmwareJob.go
- otaModuleInfo.go
- productCategory.go
- productCategorySchema.go
- productCustom.go
- productID.go
- productInfo.go
- productRemoteConfig.go
- productSchema.go
- productSchemaOld.go
- protocolInfo.go
- protocolService.go
- schemaInfo.go
- shadow.go
- userDeviceCollect.go
- userDeviceShare.go