refactor(push): change created_at format from Unix milliseconds to ISO8601
All checks were successful
Build Backend / build (push) Successful in 4m32s
Build Backend / build-docker (push) Successful in 2m18s

This commit is contained in:
lafay
2026-04-25 00:40:00 +08:00
parent 3e90eefd51
commit 323f872aa9

View File

@@ -1,4 +1,4 @@
package service
package service
import (
"context"
@@ -153,7 +153,7 @@ func (s *pushServiceImpl) pushViaWebSocket(ctx context.Context, userID string, m
"type": string(message.SystemType),
"content": content,
"extra": map[string]any{},
"created_at": message.CreatedAt.UnixMilli(),
"created_at": message.CreatedAt.Format("2006-01-02T15:04:05Z07:00"),
}
// 填充额外数据
@@ -454,7 +454,7 @@ func (s *pushServiceImpl) pushSystemViaWebSocket(ctx context.Context, userID str
"title": title,
"content": content,
"data": data,
"created_at": time.Now().UnixMilli(),
"created_at": time.Now().Format("2006-01-02T15:04:05Z07:00"),
}
s.wsHub.PublishToUser(userID, "system_notification", sysMsg)
return true
@@ -483,7 +483,7 @@ func (s *pushServiceImpl) pushSystemNotificationViaWebSocket(ctx context.Context
"title": notification.Title,
"content": notification.Content,
"extra": map[string]any{},
"created_at": notification.CreatedAt.UnixMilli(),
"created_at": notification.CreatedAt.Format("2006-01-02T15:04:05Z07:00"),
}
// 填充额外数据