恢复数据库对象与redis对象的返回

This commit is contained in:
2025-11-30 16:03:50 +08:00
parent d454d8e143
commit fd37c5c301
4 changed files with 90 additions and 8 deletions

View File

@@ -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) {