👽 Use pointer user id in stream request

⬆️ Re-sum go mod
This commit is contained in:
2024-08-23 19:42:30 +08:00
parent 9d075f862c
commit 31fcfa2bf5
3 changed files with 9 additions and 19 deletions

View File

@ -70,7 +70,7 @@ func PushNotification(notification models.Notification) error {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
_, err := proto.NewStreamControllerClient(gap.H.GetDealerGrpcConn()).PushStream(ctx, &proto.PushStreamRequest{
UserId: uint64(notification.AccountID),
UserId: lo.ToPtr(uint64(notification.AccountID)),
Body: models.UnifiedCommand{
Action: "notifications.new",
Payload: notification,
@ -133,7 +133,7 @@ func PushNotificationBatch(notifications []models.Notification) {
for _, notification := range notifications {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
_, _ = stream.PushStream(ctx, &proto.PushStreamRequest{
UserId: uint64(notification.AccountID),
UserId: lo.ToPtr(uint64(notification.AccountID)),
Body: models.UnifiedCommand{
Action: "notifications.new",
Payload: notification,