pass account service as a param

This commit is contained in:
Carlosokumu 2024-10-08 00:03:29 +03:00
parent d7bfdc62e9
commit d01af48216
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953
3 changed files with 10 additions and 3 deletions

View File

@ -15,6 +15,7 @@ import (
"git.defalsify.org/vise.git/engine"
"git.defalsify.org/vise.git/logging"
"git.defalsify.org/vise.git/resource"
"git.grassecon.net/urdt/ussd/internal/handlers/server"
"git.grassecon.net/urdt/ussd/internal/handlers"
httpserver "git.grassecon.net/urdt/ussd/internal/http"
@ -127,7 +128,8 @@ func main() {
os.Exit(1)
}
hl, err := lhs.GetHandler()
accountService := server.AccountService{}
hl, err := lhs.GetHandler(&accountService)
if err != nil {
fmt.Fprintf(os.Stderr, err.Error())
os.Exit(1)

View File

@ -15,6 +15,7 @@ import (
"git.grassecon.net/urdt/ussd/internal/handlers"
"git.grassecon.net/urdt/ussd/internal/storage"
"git.grassecon.net/urdt/ussd/internal/handlers/server"
)
var (
@ -94,8 +95,9 @@ func main() {
lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs)
lhs.SetDataStore(&userdataStore)
accountService := server.AccountService{}
hl, err := lhs.GetHandler()
hl, err := lhs.GetHandler(&accountService)
if err != nil {
fmt.Fprintf(os.Stderr, err.Error())
os.Exit(1)

View File

@ -18,6 +18,7 @@ import (
"git.grassecon.net/urdt/ussd/internal/handlers"
httpserver "git.grassecon.net/urdt/ussd/internal/http"
"git.grassecon.net/urdt/ussd/internal/storage"
"git.grassecon.net/urdt/ussd/internal/handlers/server"
)
var (
@ -88,7 +89,9 @@ func main() {
os.Exit(1)
}
hl, err := lhs.GetHandler()
accountService := server.AccountService{}
hl, err := lhs.GetHandler(&accountService)
if err != nil {
fmt.Fprintf(os.Stderr, err.Error())
os.Exit(1)