feat: redis支持工单流程审批

This commit is contained in:
meilin.huang
2024-03-02 19:08:19 +08:00
parent 76475e807e
commit 49d3f988c9
93 changed files with 1107 additions and 1014 deletions

View File

@@ -2,6 +2,7 @@ package rdm
import (
"context"
"mayfly-go/pkg/errorx"
"mayfly-go/pkg/logx"
"github.com/redis/go-redis/v9"
@@ -32,6 +33,19 @@ func (r *RedisConn) Scan(cursor uint64, match string, count int64) ([]string, ui
return r.GetCmdable().Scan(context.Background(), cursor, match, count).Result()
}
// 执行redis命令
// 如: SET str value命令则args为['SET', 'str', 'val']
func (r *RedisConn) RunCmd(ctx context.Context, args ...any) (any, error) {
redisMode := r.Info.Mode
if redisMode == "" || redisMode == StandaloneMode || r.Info.Mode == SentinelMode {
return r.Cli.Do(ctx, args...).Result()
}
if redisMode == ClusterMode {
return r.ClusterCli.Do(ctx, args...).Result()
}
return nil, errorx.NewBiz("redis mode error")
}
func (r *RedisConn) Close() {
mode := r.Info.Mode
if mode == StandaloneMode || mode == SentinelMode {