diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 8e3cbe5a..eb967bfe 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -2366,6 +2366,9 @@ func (s *Service) ApiCreateMoment(ctx *gin.Context, req *momentproto.ApiCreateRe return } + // 发送通知 + DefaultNotifBuilderHandler.Handle(ctx)(consts.AudNotifTemp_MomentCreated)(req.Moment) + return } @@ -3204,6 +3207,9 @@ func (s *Service) ApiCreateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api } } + // 发送通知 + DefaultNotifBuilderHandler.Handle(ctx)(consts.AudNotifTemp_ZoneMomentCreated)(req.ZoneMoment) + return } @@ -3308,6 +3314,9 @@ func (s *Service) ApiUpdateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api } } + // 发送通知 + DefaultNotifBuilderHandler.Handle(ctx)(consts.AudNotifTemp_ZoneMomentReedited)(req.ZoneMoment) + return } diff --git a/app/mix/service/notif_builder_handler.go b/app/mix/service/notif_builder_handler.go index ee7789f1..12af48fb 100644 --- a/app/mix/service/notif_builder_handler.go +++ b/app/mix/service/notif_builder_handler.go @@ -305,3 +305,24 @@ func (handler *NotifBuilderHandler) handleAudStreamerDirectlyUpdated() { } } } + +func (handler *NotifBuilderHandler) handleAudMomentCreated() { + handler.handlerMap[consts.AudNotifTemp_MomentCreated] = func(ctx *gin.Context, args ...any) { + moment := args[0].(*dbstruct.Moment) + DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_MomentCreated, moment.GetMid()) + } +} + +func (handler *NotifBuilderHandler) handleAudZoneMomentCreated() { + handler.handlerMap[consts.AudNotifTemp_ZoneMomentCreated] = func(ctx *gin.Context, args ...any) { + zoneMoment := args[0].(*dbstruct.ZoneMoment) + DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_ZoneMomentCreated, zoneMoment.GetMid()) + } +} + +func (handler *NotifBuilderHandler) handleAudZoneMomentReedited() { + handler.handlerMap[consts.AudNotifTemp_ZoneMomentReedited] = func(ctx *gin.Context, args ...any) { + zoneMoment := args[0].(*dbstruct.ZoneMoment) + DefaultService.utilWriteNotifInfo(ctx, consts.AudNotifTemp_ZoneMomentReedited, zoneMoment.GetMid()) + } +}