恢复数据库对象与redis对象的返回
This commit is contained in:
@@ -430,6 +430,14 @@ func (f *Factory) getRedisClient() (*redis.Client, error) {
|
||||
return client, nil
|
||||
}
|
||||
|
||||
// GetRedisClient 获取Redis客户端对象(已初始化)
|
||||
// 返回已初始化的Redis客户端对象,可直接使用
|
||||
// 注意:推荐使用 RedisGet、RedisSet、RedisDelete 等方法直接操作Redis
|
||||
// 如果需要使用Redis的高级功能(如Hash、List、Set等),可以使用此方法获取客户端对象
|
||||
func (f *Factory) GetRedisClient() (*redis.Client, error) {
|
||||
return f.getRedisClient()
|
||||
}
|
||||
|
||||
// RedisGet 获取Redis值(黑盒模式)
|
||||
// key: Redis键
|
||||
func (f *Factory) RedisGet(ctx context.Context, key string) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user