Выполнение работы на 4.

This commit is contained in:
2026-11-13 21:41:50 +03:00
parent ec540a1a72
commit 6308f21ec7
104 changed files with 7310 additions and 13 deletions
+6
View File
@@ -0,0 +1,6 @@
namespace Messenger.Api.Models;
public sealed record Attachment(
Guid Id, Guid ChatId, Guid OwnerId, string Filename, string ContentType,
long SizeBytes, string Sha256, string Status, object[] Variants,
string? ErrorCode, DateTimeOffset CreatedAt, DateTimeOffset UpdatedAt);
+14
View File
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Messenger.Api.Models
{
public sealed class Chat
{
public Guid Id { get; init; }
public string Title { get; init; } = String.Empty;
public List<Guid> MemberIds { get; init; } = new List<Guid>();
public DateTimeOffset CreatedAt { get; init; }
}
}
@@ -0,0 +1,6 @@
namespace Messenger.Api.Models
{
public sealed record CreateChatRequest(
[property: System.Text.Json.Serialization.JsonRequired] string Title,
[property: System.Text.Json.Serialization.JsonRequired] List<Guid> MemberIds);
}
@@ -0,0 +1,6 @@
namespace Messenger.Api.Models;
public sealed record CreateMessageRequest([property: System.Text.Json.Serialization.JsonRequired] string Text)
{
public Guid[] AttachmentIds { get; init; } = [];
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Messenger.Api.Models
{
public sealed record CreateUserRequest(
[property: System.Text.Json.Serialization.JsonRequired] string Username,
[property: System.Text.Json.Serialization.JsonRequired] string DisplayName,
[property: System.Text.Json.Serialization.JsonRequired] string Password);
}
+17
View File
@@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Http.HttpResults;
using System;
using System.Collections.Generic;
using System.Text;
namespace Messenger.Api.Models
{
public sealed class Message
{
public Guid Id { get; init; }
public Guid ChatId { get; init; }
public Guid SenderId { get; init; }
public string Text { get; init; } = String.Empty;
public DateTimeOffset CreatedAt { get; init; }
public Guid[] AttachmentIds { get; init; } = [];
}
}
@@ -0,0 +1,7 @@
namespace Messenger.Api.Models;
public sealed record SessionResponse(
string Token,
string TokenType,
DateTimeOffset ExpiresAt,
User User);
+14
View File
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Messenger.Api.Models
{
public sealed class User
{
public Guid Id { get; init; }
public string Username { get; init; } = string.Empty;
public string DisplayName { get; init; } = string.Empty;
public DateTimeOffset CreatedAt { get; init; }
}
}