refactor: redis hash类型使用hscan获取数据

This commit is contained in:
meilin.huang
2022-08-05 21:41:21 +08:00
parent e1afb1ed54
commit f2d9e7786d
10 changed files with 727 additions and 416 deletions

View File

@@ -64,9 +64,17 @@ func InitRedisRouter(router *gin.RouterGroup) {
ctx.NewReqCtxWithGin(c).Handle(rs.SetStringValue)
})
// 获取hash类型值
redis.GET(":id/hash-value", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).Handle(rs.GetHashValue)
// hscan
redis.GET(":id/hscan", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).Handle(rs.Hscan)
})
redis.GET(":id/hget", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).Handle(rs.Hget)
})
redis.DELETE(":id/hdel", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).Handle(rs.Hdel)
})
// 设置hash类型值