feat: add notification events handling and MQTT integration
- Implemented notification event publishing with a new NotificationEventPublisher interface. - Created a noopNotificationEventPublisher for testing purposes. - Added functionality to publish notification created events via MQTT. - Introduced a new stream event publisher for handling job logs and updates. - Added database migration for popup_ads table. - Created tests for notification events and popup ads functionality. - Established MQTT connection and publishing helpers for event messages.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package service
|
||||
|
||||
import appv1 "stream.api/internal/api/proto/app/v1"
|
||||
import "stream.api/internal/database/model"
|
||||
import (
|
||||
appv1 "stream.api/internal/api/proto/app/v1"
|
||||
"stream.api/internal/database/model"
|
||||
)
|
||||
|
||||
func toProtoDomain(item *model.Domain) *appv1.Domain {
|
||||
if item == nil {
|
||||
@@ -33,6 +35,22 @@ func toProtoAdTemplate(item *model.AdTemplate) *appv1.AdTemplate {
|
||||
}
|
||||
}
|
||||
|
||||
func toProtoPopupAd(item *model.PopupAd) *appv1.PopupAd {
|
||||
if item == nil {
|
||||
return nil
|
||||
}
|
||||
return &appv1.PopupAd{
|
||||
Id: item.ID,
|
||||
Type: item.Type,
|
||||
Label: item.Label,
|
||||
Value: item.Value,
|
||||
IsActive: boolValue(item.IsActive),
|
||||
MaxTriggersPerSession: func() int32 { if item.MaxTriggersPerSession != nil { return *item.MaxTriggersPerSession }; return 0 }(),
|
||||
CreatedAt: timeToProto(item.CreatedAt),
|
||||
UpdatedAt: timeToProto(item.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func toProtoPlayerConfig(item *model.PlayerConfig) *appv1.PlayerConfig {
|
||||
if item == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user