Fixed: logger name in modules

This commit is contained in:
Aleksandr Soloshenko 2024-02-01 09:27:14 +07:00
parent 32ea8f0762
commit 26bc24e08a
6 changed files with 20 additions and 11 deletions

View File

@ -33,10 +33,10 @@ Content-Type: application/json
Authorization: Basic {{credentials}}
{
"message": "17wc9/ZRf1l84LHkEK3hgA==.aH1XrMHAeMyF4PeiavV3dk8o2fP0nSo92IqseLQfg14=",
"message": "$aes-256-cbc/pbkdf2-sha1$i=75000$pb+tpPcF0nabV46wDeDMig==$ucdVkMrRYLQ0LAeoXQsWhrD36I9nnop8rRIh3dNmBhvg7Wc4Cwu3h9Petvp1dN3x",
"ttl": 600,
"phoneNumbers": [
"xkQeXzSDFj2xP6JBUMK0pA==.PfUHEa9QZv8h7JnUoBlmWw=="
"$aes-256-cbc/pbkdf2-sha1$i=75000$ZWdiSMvGWJo/jixYGk+s+w==$tfP6sEeC4r/ux/JAglincQ=="
],
"simNumber": 1,
"withDeliveryReport": true,

View File

@ -11,7 +11,6 @@ import (
"github.com/capcom6/go-infra-fx/validator"
appconfig "github.com/capcom6/sms-gateway/internal/config"
"github.com/capcom6/sms-gateway/internal/sms-gateway/handlers"
"github.com/capcom6/sms-gateway/internal/sms-gateway/models"
"github.com/capcom6/sms-gateway/internal/sms-gateway/repositories"
"github.com/capcom6/sms-gateway/internal/sms-gateway/services"
"github.com/capcom6/sms-gateway/internal/sms-gateway/tasks"
@ -30,7 +29,6 @@ var Module = fx.Module(
handlers.Module,
services.Module,
repositories.Module,
models.Module,
db.Module,
tasks.Module,
)

View File

@ -3,10 +3,14 @@ package handlers
import (
"github.com/capcom6/go-infra-fx/http"
"go.uber.org/fx"
"go.uber.org/zap"
)
var Module = fx.Module(
"handlers",
fx.Decorate(func(log *zap.Logger) *zap.Logger {
return log.Named("handlers")
}),
fx.Provide(
http.AsRootHandler(newRootHandler),
http.AsApiHandler(newThirdPartyHandler),

View File

@ -2,11 +2,6 @@ package models
import (
"github.com/capcom6/go-infra-fx/db"
"go.uber.org/fx"
)
var Module = fx.Module(
"models",
)
func init() {

View File

@ -1,9 +1,15 @@
package repositories
import "go.uber.org/fx"
import (
"go.uber.org/fx"
"go.uber.org/zap"
)
var Module = fx.Module(
"repositories",
fx.Decorate(func(log *zap.Logger) *zap.Logger {
return log.Named("repositories")
}),
fx.Provide(
NewDevicesRepository,
NewMessagesRepository,

View File

@ -1,9 +1,15 @@
package services
import "go.uber.org/fx"
import (
"go.uber.org/fx"
"go.uber.org/zap"
)
var Module = fx.Module(
"services",
fx.Decorate(func(log *zap.Logger) *zap.Logger {
return log.Named("services")
}),
fx.Provide(
NewAuthService,
NewMessagesService,