Выполнениие лабораторной работы на 5, трек 2.
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
@@ -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