Add Ping backend
.NET 10 solution for Ping, a Discord style chat app: Domain, Application and Infrastructure projects plus the Api host. SignalR for chat and presence, LiveKit for call tokens, EF Core on Postgres, S3 compatible storage for attachments, and OIDC auth shared with the Musify Zitadel instance. Includes the Compose stack for local development.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Ping.Application.Users.Responses;
|
||||
using Ping.Domain.Entities;
|
||||
|
||||
namespace Ping.Application.Messages.Responses
|
||||
{
|
||||
public record MessageResponse(
|
||||
Guid Id,
|
||||
Guid ChannelId,
|
||||
UserResponse Author,
|
||||
string Content,
|
||||
Guid? ReplyToMessageId,
|
||||
DateTime CreatedAt,
|
||||
DateTime? EditedAt,
|
||||
IReadOnlyList<AttachmentResponse> Attachments)
|
||||
{
|
||||
public static MessageResponse FromEntity(Message message) =>
|
||||
new(
|
||||
message.Id,
|
||||
message.ChannelId,
|
||||
UserResponse.FromEntity(message.Author!),
|
||||
message.Content,
|
||||
message.ReplyToMessageId,
|
||||
message.CreatedAt,
|
||||
message.EditedAt,
|
||||
message.Attachments.Select(AttachmentResponse.FromEntity).ToList());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user