From ddb4aa8b6535f79c9bbc188db49a56d480a7ed88 Mon Sep 17 00:00:00 2001 From: gjs Date: Wed, 28 Oct 2026 14:09:26 +0800 Subject: [PATCH] add and fix apis --- .../internal/logic/wsClientStatusLogic.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/services/percutaneous/internal/logic/wsClientStatusLogic.go b/services/percutaneous/internal/logic/wsClientStatusLogic.go index 78336a9..c7352ba 100644 --- a/services/percutaneous/internal/logic/wsClientStatusLogic.go +++ b/services/percutaneous/internal/logic/wsClientStatusLogic.go @@ -48,16 +48,25 @@ func (l *WsClientStatusLogic) WsClientStatus(in *percutaneous.GetWsCodeRequest) if len(val) > utils.NumberTen { data := "ok" keys := []string{WsTypeApp, WsTypeOperation} - + ok := false for _, k := range keys { key = utils.MD5Encrypt(fmt.Sprintf("%s%s", dao.WsCode, k)) redisKey = pkgws.RedisKeyQRSession + key if err = pkgws.Publish(l.ctx, redisKey, pkgws.Success(data)); err != nil { l.Errorf("ws client publish: %v", err) + ok = false return l.fail(utils.Fail) } - redis.Client.Del(l.ctx, redisKey).Result() + ok = true } + if ok { + for _, k := range keys { + key = utils.MD5Encrypt(fmt.Sprintf("%s%s", dao.WsCode, k)) + redisKey = pkgws.RedisKeyQRSession + key + redis.Client.Del(l.ctx, redisKey).Result() + } + } + return l.ok(utils.NumberOne) }