deviceMsgManage

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package device 设备操作日志

Package repo 本文件是提供设备模型数据存储的信息

Package device 设备操作日志

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HubLog added in v0.5.1

type HubLog struct {
	ProductID  string    `json:"productID"`  // 产品id
	DeviceName string    `json:"deviceName"` // 设备名称
	Content    string    `json:"content"`    // 具体信息
	Topic      string    `json:"topic"`      // 主题
	Action     string    `json:"action"`     // 操作类型
	Timestamp  time.Time `json:"timestamp"`  // 操作时间
	RequestID  string    `json:"requestID"`  // 请求ID
	TranceID   string    `json:"tranceID"`   // 服务器端事务id
	ResultType int64     `json:"resultType"` // 请求结果状态,200为成功
}

type HubLogRepo

type HubLogRepo interface {
	InitProduct(ctx context.Context, productID string) error
	DropProduct(ctx context.Context, productID string) error
	DropDevice(ctx context.Context, productID string, deviceName string) error
	Insert(ctx context.Context, data *HubLog) error
}

type SDKLogRepo

type SDKLogRepo interface {
	InitProduct(ctx context.Context, productID string) error
	InitDevice(ctx context.Context, productID string, deviceName string) error
	DropProduct(ctx context.Context, productID string) error
	DropDevice(ctx context.Context, productID string, deviceName string) error
}

type SchemaDataRepo

type SchemaDataRepo interface {
	// InitProduct 初始化产品的物模型相关表及日志记录表
	InitProduct(ctx context.Context, t *schema.Model, productID string) error
	// DeleteProduct 删除产品时需要删除产品下的所有表
	DeleteProduct(ctx context.Context, t *schema.Model, productID string) error
	// InitDevice 创建设备时为设备创建单独的表
	InitDevice(ctx context.Context, t *schema.Model, productID string, deviceName string) error
	// DeleteDevice 删除设备时需要删除设备的所有表
	DeleteDevice(ctx context.Context, t *schema.Model, productID string, deviceName string) error
	// UpdateProduct 修改产品物模型 只支持新增和删除,不支持修改数据类型
	UpdateProduct(ctx context.Context, oldT *schema.Model, newt *schema.Model, productID string) error
	CreateProperty(ctx context.Context, p *schema.Property, productID string) error
	DeleteProperty(ctx context.Context, productID string, identifier string) error
	UpdateProperty(ctx context.Context, oldP *schema.Property, newP *schema.Property, productID string) error
}

Jump to

Keyboard shortcuts

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