From 4aeb99813f16281b4143627e19df97c8b166063a Mon Sep 17 00:00:00 2001 From: duanhf2012 Date: Wed, 25 Dec 2019 09:33:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Ehash=E5=80=BC=E8=87=AA?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sysmodule/RedisModule.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sysmodule/RedisModule.go b/sysmodule/RedisModule.go index f0f6dfc..6f7fa3e 100644 --- a/sysmodule/RedisModule.go +++ b/sysmodule/RedisModule.go @@ -1416,3 +1416,22 @@ func (slf *RedisModule) ListPop(key string, fromLeft, block bool, timeout int) ( } return b, nil } + + +func (slf *RedisModule) HincrbyHashInt(redisKey, hashKey string, value int) error { + if redisKey == "" || hashKey == "" { + return errors.New("Key Is Empty") + } + conn, err := slf.getConn() + if err != nil { + return err + } + defer conn.Close() + + _, retErr := conn.Do("HINCRBY", redisKey, hashKey, value) + if retErr != nil { + service.GetLogger().Printf(service.LEVER_ERROR, "HincrbyHashInt fail,reason:%v", retErr) + } + + return retErr + } \ No newline at end of file