feat: redis支持flushdb、菜单资源支持拖拽排序、禁用等

This commit is contained in:
meilin.huang
2023-06-15 19:18:29 +08:00
parent 445cf3716b
commit adc65439e4
26 changed files with 634 additions and 407 deletions

View File

@@ -148,7 +148,7 @@ func (r *Redis) Scan(rc *req.Ctx) {
func (r *Redis) TtlKey(rc *req.Ctx) {
ri, key := r.checkKeyAndGetRedisIns(rc)
ttl, err := ri.GetCmdable().TTL(context.Background(), key).Result()
biz.ErrIsNil(err, "ttl失败: %s")
biz.ErrIsNilAppendErr(err, "ttl失败: %s")
if ttl == -1 {
rc.ResData = -1
@@ -187,3 +187,10 @@ func (r *Redis) PersistKey(rc *req.Ctx) {
rc.ReqParam = fmt.Sprintf("%s -> 移除key[%s]的过期时间", ri.Info.GetLogDesc(), key)
ri.GetCmdable().Persist(context.Background(), key)
}
// 清空库
func (r *Redis) FlushDb(rc *req.Ctx) {
ri := r.getRedisIns(rc)
rc.ReqParam = fmt.Sprintf("%s -> flushdb", ri.Info.GetLogDesc())
ri.GetCmdable().FlushDB(context.Background())
}