lijian 4 роки тому
батько
коміт
7280967ce3
2 змінених файлів з 8 додано та 1 видалено
  1. 4 0
      pkg/ruleEngine/rule_chain.go
  2. 4 1
      services/registry/registry.go

+ 4 - 0
pkg/ruleEngine/rule_chain.go

@@ -6,6 +6,7 @@ const (
 	ruleChan EntityType = iota
 )
 
+// RuleChain 规则链对象
 type RuleChain struct {
 	TenantId    string
 	Name        string
@@ -16,6 +17,7 @@ type RuleChain struct {
 	ChainId     string
 }
 
+// RuleNode 规则节点对象,代表规则链中的一个组成节点
 type RuleNode struct {
 	RuleChainId string
 	Type        string
@@ -25,6 +27,8 @@ type RuleNode struct {
 	RuleNodeId  string
 }
 
+// Relation 节点关系
+// 用于描述节点之间的关系
 type Relation struct {
 	From              string
 	To                string

+ 4 - 1
services/registry/registry.go

@@ -51,6 +51,7 @@ func setProduct(target *models.Product, src *models.Product) {
 	target.VendorID = src.VendorID
 	target.CreatedAt = src.CreatedAt
 	target.UpdatedAt = src.UpdatedAt
+	target.RecordId = src.RecordId
 }
 
 func setApplication(target *models.Application, src *models.Application) {
@@ -295,7 +296,9 @@ func (r *Registry) RegisterDevice(args *rpcs.ArgsDeviceRegister, reply *models.D
 		return err
 	}
 
-	product := &models.Product{}
+	product := &models.Product{
+		RecordId:,
+	}
 	err = r.ValidateProduct(args.ProductKey, product)
 	if err != nil {
 		return err