File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ func HandleDeviceAdd(ctx Context, params interface{}) error {
2020 // Define structure for device add parameters
2121 type DeviceAddParams struct {
2222 Plugin string `json:"plugin"`
23+ ProductId string `json:"productId"`
2324 ModelKey string `json:"modelKey"`
2425 ModelHash string `json:"modelHash"`
2526 ConnectionKey string `json:"connectionKey"`
@@ -61,6 +62,10 @@ func HandleDeviceAdd(ctx Context, params interface{}) error {
6162 return fmt .Errorf ("failed to load model: %v" , err )
6263 }
6364 model .Name = addParams .ModelKey + "_" + computedHash
65+ //绑定产品ID
66+ modelAttr := model .Attributes
67+ modelAttr ["productId" ] = addParams .ProductId
68+ model .Attributes = modelAttr
6469 err = driverbox .CoreCache ().AddModel (addParams .Plugin , model )
6570 if err != nil {
6671 return err
You can’t perform that action at this time.
0 commit comments