|
@@ -1,13 +1,18 @@
|
|
|
package svc
|
|
|
|
|
|
-import "self-im-rtc/internal/config"
|
|
|
+import (
|
|
|
+ "github.com/zeromicro/go-zero/core/stores/redis"
|
|
|
+ "self-im-rtc/internal/config"
|
|
|
+)
|
|
|
|
|
|
type ServiceContext struct {
|
|
|
Config config.Config
|
|
|
+ Redis *redis.Redis
|
|
|
}
|
|
|
|
|
|
func NewServiceContext(c config.Config) *ServiceContext {
|
|
|
return &ServiceContext{
|
|
|
Config: c,
|
|
|
+ Redis: redis.MustNewRedis(c.RedisConf),
|
|
|
}
|
|
|
}
|