import
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
// Домен уведомлений.
|
||||
// Этим файлом владеет команда уведомлений.
|
||||
//
|
||||
// Что внутри: отправка уведомлений, шаблоны, каналы доставки.
|
||||
// Что НЕ знает: как устроена авторизация, как устроены профили внутри.
|
||||
|
||||
import "go.uber.org/fx"
|
||||
|
||||
var NotificationModule = fx.Module("notification",
|
||||
fx.Provide(
|
||||
newNotificationRepo,
|
||||
newNotificationService,
|
||||
),
|
||||
)
|
||||
|
||||
// --- NotificationRepo ---
|
||||
|
||||
type notificationRepo struct{ db DB }
|
||||
|
||||
func newNotificationRepo(db DB) NotificationRepository {
|
||||
return ¬ificationRepo{db: db}
|
||||
}
|
||||
|
||||
// --- NotificationService ---
|
||||
|
||||
type notificationServiceImpl struct {
|
||||
notificationRepo NotificationRepository
|
||||
userService UserService
|
||||
events EventBus
|
||||
}
|
||||
|
||||
func newNotificationService(notificationRepo NotificationRepository, userService UserService, events EventBus) NotificationService {
|
||||
return ¬ificationServiceImpl{notificationRepo: notificationRepo, userService: userService, events: events}
|
||||
}
|
||||
Reference in New Issue
Block a user