mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-26 01:16:36 +08:00
feat: redis支持工单流程审批
This commit is contained in:
@@ -7,10 +7,8 @@ import (
|
||||
"mayfly-go/internal/redis/rdm"
|
||||
"mayfly-go/pkg/biz"
|
||||
"mayfly-go/pkg/req"
|
||||
"mayfly-go/pkg/utils/collx"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
@@ -133,39 +131,3 @@ func (r *Redis) MemoryUsage(rc *req.Ctx) {
|
||||
ri, key := r.checkKeyAndGetRedisConn(rc)
|
||||
rc.ResData = ri.GetCmdable().MemoryUsage(context.Background(), key).Val()
|
||||
}
|
||||
|
||||
func (r *Redis) DeleteKey(rc *req.Ctx) {
|
||||
ri, key := r.checkKeyAndGetRedisConn(rc)
|
||||
rc.ReqParam = collx.Kvs("redis", ri.Info, "key", key)
|
||||
ri.GetCmdable().Del(context.Background(), key)
|
||||
}
|
||||
|
||||
func (r *Redis) RenameKey(rc *req.Ctx) {
|
||||
form := req.BindJsonAndValid(rc, new(form.Rename))
|
||||
|
||||
ri := r.getRedisConn(rc)
|
||||
rc.ReqParam = collx.Kvs("redis", ri.Info, "rename", form)
|
||||
ri.GetCmdable().Rename(context.Background(), form.Key, form.NewKey)
|
||||
}
|
||||
|
||||
func (r *Redis) ExpireKey(rc *req.Ctx) {
|
||||
form := req.BindJsonAndValid(rc, new(form.Expire))
|
||||
|
||||
ri := r.getRedisConn(rc)
|
||||
rc.ReqParam = collx.Kvs("redis", ri.Info, "expire", form)
|
||||
ri.GetCmdable().Expire(context.Background(), form.Key, time.Duration(form.Seconds)*time.Second)
|
||||
}
|
||||
|
||||
// 移除过期时间
|
||||
func (r *Redis) PersistKey(rc *req.Ctx) {
|
||||
ri, key := r.checkKeyAndGetRedisConn(rc)
|
||||
rc.ReqParam = collx.Kvs("redis", ri.Info, "key", key)
|
||||
ri.GetCmdable().Persist(context.Background(), key)
|
||||
}
|
||||
|
||||
// 清空库
|
||||
func (r *Redis) FlushDb(rc *req.Ctx) {
|
||||
ri := r.getRedisConn(rc)
|
||||
rc.ReqParam = ri.Info
|
||||
ri.GetCmdable().FlushDB(context.Background())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user