Выполнение работы на 4.
This commit is contained in:
@@ -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);
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user