From 69e82ec0fe770109adbc123c873d3d0c7e5858ca Mon Sep 17 00:00:00 2001 From: "DESKTOP-V763RJ7\\Administrator" <835606593@qq.com> Date: Thu, 8 Jan 2026 22:45:40 +0800 Subject: [PATCH] =?UTF-8?q?feat=20redis=20=E5=A2=9E=E5=8A=A0=20HDel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/redis/client.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/db/redis/client.go b/db/redis/client.go index 559890a..8683ddc 100644 --- a/db/redis/client.go +++ b/db/redis/client.go @@ -49,14 +49,14 @@ func (c *Client) Set(ctx context.Context, key string, value interface{}, expirat return c.cli.Set(ctx, key, value, expiration) } -func (c *Client) HSet(ctx context.Context, key string, values ...interface{}) *redis.IntCmd { - return c.cli.HSet(ctx, key, values) -} - func (c *Client) Get(ctx context.Context, key string) *redis.StringCmd { return c.cli.Get(ctx, key) } +func (c *Client) HSet(ctx context.Context, key string, values ...interface{}) *redis.IntCmd { + return c.cli.HSet(ctx, key, values...) +} + func (c *Client) HGet(ctx context.Context, key, field string) *redis.StringCmd { return c.cli.HGet(ctx, key, field) } @@ -65,6 +65,10 @@ func (c *Client) HGetAll(ctx context.Context, key string) *redis.MapStringString return c.cli.HGetAll(ctx, key) } +func (c *Client) HDel(ctx context.Context, key string, fields ...string) *redis.IntCmd { + return c.cli.HDel(ctx, key, fields...) +} + func (c *Client) Pipeline() redis.Pipeliner { return c.cli.Pipeline() }