MSP-1070 migrate token service to token repo
This commit is contained in:
1 parent
5af15ed13a
commit
850abfd93c
9 files changed
+75
-63
No files matched your search
+2
-3
@@ -1,8 +1,6 @@
|
||||
package assembly
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/integration-system/isp-kit/db"
|
||||
"github.com/integration-system/isp-kit/http/httpcli"
|
||||
"github.com/integration-system/isp-kit/log"
|
||||
@@ -35,8 +33,9 @@ func (l Locator) Handler(cfg conf.Remote) isp.BackendServiceServer {
|
||||
sudirRepo := repository.NewSudir(l.httpCli, cfg.SudirAuth)
|
||||
roleRepo := repository.NewRole(l.db)
|
||||
userRepo := repository.NewUser(l.db)
|
||||
tokenRepo := repository.NewToken(l.db)
|
||||
|
||||
tokenService := service.NewToken(time.Second*time.Duration(cfg.ExpireSec), cfg.SecretKey)
|
||||
tokenService := service.NewToken(tokenRepo, cfg.ExpireSec)
|
||||
sudirService := service.NewSudir(cfg.SudirAuth, sudirRepo, roleRepo)
|
||||
userService := service.NewUser(tokenService, userRepo, roleRepo, l.logger)
|
||||
authService := service.NewAuth(userRepo, tokenService, sudirService, l.logger)
|
||||
|
||||
Reference in new issue
Block a user