mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-05-06 20:11:27 +08:00
fix 规则链错误
This commit is contained in:
@@ -24,9 +24,8 @@ func (r *RuleChainApi) GetNodeLabels(rc *restfulx.ReqCtx) {
|
||||
func (r *RuleChainApi) RuleChainTest(rc *restfulx.ReqCtx) {
|
||||
code := restfulx.QueryParam(rc, "code")
|
||||
instance, _ := rule_engine.NewRuleChainInstance([]byte(code))
|
||||
newMessage := message.NewMessage()
|
||||
newMessage.SetMetadata(message.NewMetadata())
|
||||
instance.StartRuleChain(context.Background(), newMessage)
|
||||
msg := message.NewMessage("1", message.TelemetryMes, message.Msg{"temperature": 60.4, "humidity": 32.5}, message.Metadata{})
|
||||
instance.StartRuleChain(context.Background(), msg)
|
||||
rc.ResData = []map[string]interface{}{}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user