add:
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"juwan-backend/app/users/rpc/internal/config"
|
||||
"juwan-backend/app/users/rpc/internal/models"
|
||||
"juwan-backend/app/users/rpc/internal/utils"
|
||||
"time"
|
||||
|
||||
"github.com/redis/go-redis/v9"
|
||||
@@ -15,6 +16,7 @@ type ServiceContext struct {
|
||||
Config config.Config
|
||||
UsersModel models.UsersModel
|
||||
RedisCluster *redis.ClusterClient
|
||||
JwtManager *utils.JwtManager
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
@@ -39,9 +41,13 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize JWT Manager
|
||||
jwtManager := utils.NewJwtManager(redisCluster, c.Jwt.SecretKey, c.Jwt.Issuer)
|
||||
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
UsersModel: models.NewUsersModel(conn, c.CacheConf),
|
||||
RedisCluster: redisCluster,
|
||||
JwtManager: jwtManager,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user