Выполнение 3 лабораторной работы

This commit is contained in:
2026-11-06 20:26:11 +03:00
parent 0ab3a341aa
commit 87f2a65448
105 changed files with 8359 additions and 25 deletions
+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,3 @@
namespace Messenger.Api.Models;
public sealed record CreateMessageRequest([property: System.Text.Json.Serialization.JsonRequired] string Text);
@@ -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);
}
+16
View File
@@ -0,0 +1,16 @@
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; }
}
}
@@ -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; }
}
}