This commit is contained in:
parent
0f112e34d8
commit
611848a8f7
@ -185,15 +185,6 @@ func (r *subscriptionResolver) MessageStream(ctx context.Context, userID int) (<
|
||||
|
||||
// Преобразование proto-сообщения в domain-модель
|
||||
func protoMessageToDomain(msg *proto.Message) *domain.Message {
|
||||
if msg == nil {
|
||||
return &domain.Message{} // Возвращаем пустую структуру вместо nil
|
||||
}
|
||||
|
||||
createdAt := time.Now()
|
||||
if msg.CreatedAt != nil {
|
||||
createdAt = msg.CreatedAt.AsTime()
|
||||
}
|
||||
|
||||
return &domain.Message{
|
||||
ID: int(msg.Id),
|
||||
ChatID: int(msg.ChatId),
|
||||
@ -201,7 +192,7 @@ func protoMessageToDomain(msg *proto.Message) *domain.Message {
|
||||
ReceiverID: int(msg.ReceiverId),
|
||||
Content: msg.Content,
|
||||
Status: msg.Status,
|
||||
CreatedAt: createdAt,
|
||||
CreatedAt: msg.CreatedAt.AsTime(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user