Skip to content

Степанов Дмитрий Лаб. 1 Группа 6511#58

Open
negniy wants to merge 6 commits intoitsecd:mainfrom
negniy:main
Open

Степанов Дмитрий Лаб. 1 Группа 6511#58
negniy wants to merge 6 commits intoitsecd:mainfrom
negniy:main

Conversation

@negniy
Copy link

@negniy negniy commented Mar 15, 2026

ФИО: Степанов Дмитрий
Номер группы: 6511
Номер лабораторной: 1
Номер варианта: 14
Краткое описание предметной области: Медицинский пациент
Краткое описание добавленных фич:
Реализованы сервис генерации сотрудников с кешированием, оркестрация Aspire и логирование основных событий

@github-actions github-actions bot added In progress Код в процессе проверки Lab 1 Лабораторная №1. Кэширование labels Mar 15, 2026
@github-actions github-actions bot requested a review from danlla March 15, 2026 11:38
Copy link

@danlla danlla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Нет структурированных логов, нужно настроит serilog, для отправки логов в OpenTelemetry

Comment on lines +5 to +19
public int Id { get; set; }
public string FullName { get; set; }
public DateOnly Birthday { get; set; }
public string Address { get; set; }

public double Height { get; set; }
public double Weight { get; set; }

public int BloodType { get; set; }

public bool Resus { get; set; }

public DateOnly LastVisit { get; set; }

public bool Vactination { get; set; }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно добавить summary

А также сделать свойства либо nullable, либо required, а то сейчас все свойства строки подсвечиваются с:

Non-nullable property '...' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

{
private readonly Faker<Patient> _faker = new Faker<Patient>("ru")
.RuleFor(x => x.FullName, GeneratePatientFullName)
.RuleFor(x => x.Birthday, f => f.Date.PastDateOnly())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По дефолту первый параметр у этого метода равен 1, то есть день рождения будет браться за последний год

Comment on lines +14 to +15
.RuleFor(x => x.Weight, f => Round(f.Random.Double(5, 120), 2))
.RuleFor(x => x.Height, f => Round(f.Random.Double(50, 200), 2))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что вероятно неправильно, потому что в 1 год быть 120кг 200см тяжело

Но и 5кг и 50см тоже кстати тяжело, если там 1 месяц например
Нужно либо еще ограничить минимальную дату рождения, либо сделать вес и рост зависимыми от возраста


public Patient Generate(int id)
{
logger.LogInformation($"Generating Patient with ID: {id}");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Во всех операциях логирования убрать интерполяцию строк, нужно вот так:

logger.LogInformation("Generating Patient with ID: {id}", id);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот файл не нужен

Comment on lines +14 to +22
builder.Services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
{
policy.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader();
});
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно настроить cors так, чтобы делать запрос мог только клиент

Для этого лучше задать явный список origins в appsettings.json

var redis = builder.AddRedis("redis")
.WithRedisCommander();

var generator = builder.AddProject<Projects.PatientApp_Generator>("generator")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Генератору стоит подождать редис

Comment on lines +10 to +11
builder.AddProject<Projects.Client_Wasm>("client")
.WithReference(generator);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А клиенту подождать генератор

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In progress Код в процессе проверки Lab 1 Лабораторная №1. Кэширование

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants