适配kit包的调整

Signed-off-by: lixxxww <941403820@qq.com>
This commit is contained in:
lixxxww
2024-01-23 12:21:01 +00:00
committed by Gitee
parent ebe33c1603
commit e9a187520c
3 changed files with 19 additions and 18 deletions

View File

@@ -1,25 +1,26 @@
package api
import (
"github.com/PandaXGO/PandaKit/model"
"github.com/PandaXGO/PandaKit/token"
"pandax/apps/system/api/form"
"pandax/apps/system/api/vo"
"pandax/apps/system/entity"
"pandax/kit/model"
"pandax/kit/token"
"github.com/dgrijalva/jwt-go"
"github.com/emicklei/go-restful/v3"
"github.com/kakuilan/kgo"
"github.com/mssola/user_agent"
"pandax/apps/system/api/form"
"pandax/apps/system/api/vo"
"pandax/apps/system/entity"
logEntity "pandax/apps/log/entity"
logServices "pandax/apps/log/services"
"github.com/PandaXGO/PandaKit/biz"
"github.com/PandaXGO/PandaKit/captcha"
filek "github.com/PandaXGO/PandaKit/file"
"github.com/PandaXGO/PandaKit/restfulx"
"github.com/PandaXGO/PandaKit/utils"
"pandax/apps/system/services"
"pandax/kit/biz"
"pandax/kit/captcha"
filek "pandax/kit/file"
"pandax/kit/restfulx"
"pandax/kit/utils"
"pandax/pkg/global"
"strings"
"time"
@@ -37,7 +38,7 @@ type UserApi struct {
// GenerateCaptcha 获取验证码
func (u *UserApi) GenerateCaptcha(request *restful.Request, response *restful.Response) {
id, image := captcha.Generate()
id, image, _ := captcha.Generate()
response.WriteEntity(vo.CaptchaVo{Base64Captcha: image, CaptchaId: id})
}

View File

@@ -26,7 +26,7 @@ type RpcRequest struct {
// RequestCmd 下发指令
func (rpc RpcRequest) RequestCmd(deviceId, rpcPayload string) error {
topic := fmt.Sprintf(RpcReqTopic, rpc.RequestId)
value, ok := MqttClient.Load(deviceId)
value, ok := Session.Load(deviceId)
if !ok {
return errors.New("为获取到设备的MQTT连接")
}
@@ -35,7 +35,7 @@ func (rpc RpcRequest) RequestCmd(deviceId, rpcPayload string) error {
func (rpc RpcRequest) Pub(deviceId, reqPayload string) error {
topic := fmt.Sprintf(RpcRespTopic, rpc.RequestId)
value, ok := MqttClient.Load(deviceId)
value, ok := Session.Load(deviceId)
if !ok {
return errors.New("为获取到设备的MQTT连接")
}

View File

@@ -38,23 +38,23 @@ func newInstanceWithManifest(m *manifest.Manifest) (*RuleChainInstance, error) {
return nil, err
}
r := &RuleChainInstance{
firstRuleNodeID: m.FirstRuleNodeID,
firstRuleNodeID: m.FirstRuleNodeId,
nodes: nodes,
}
return r, nil
}
func (c *RuleChainInstance) StartRuleChain(ctx context.Context, msg *message.Message) error {
debugChan := make(chan *message.DebugMessage, 100)
debugChan := make(chan *message.DebugData, 100)
endDebugChan := make(chan struct{})
go func() {
for {
select {
case debugMsg := <-debugChan:
ruleChainDebugData.Add(c.ruleID, debugMsg.NodeID, debugMsg)
ruleChainDebugData.Add(c.ruleID, debugMsg.NodeId, *debugMsg)
case <-endDebugChan:
logrus.Debugf("规则链%s,执行结束", msg.ID)
logrus.Debugf("规则链%s,执行结束", msg.Id)
return
}
}