Skip to content

Горбунцова Александра Лаб. 1 Группа 6512#55

Open
litirnntir wants to merge 3 commits intoitsecd:mainfrom
litirnntir:main
Open

Горбунцова Александра Лаб. 1 Группа 6512#55
litirnntir wants to merge 3 commits intoitsecd:mainfrom
litirnntir:main

Conversation

@litirnntir
Copy link

ФИО: Горбунцова Александра
Номер группы: 6512
Номер лабораторной: 1
Номер варианта: 20
Краткое описание предметной области: Медицинский пациент
Краткое описание добавленных фич: Добавлена модель данных, добавлен сервис генерации, сделан endpoint, добавлен кеш, оркестратор
Снимок экрана 2026-03-14 в 21 55 02

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

Choose a reason for hiding this comment

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

Удалить служебные файлы IDE, добавить .idea в .gitignore

Comment on lines +111 to +121
var rows = new List<(int Number, string Name, string Value)>();

for (var i = 0; i < PropertyOrder.Length; i++)
{
var propertyKey = PropertyOrder[i];
var displayName = PropertyNames.GetValueOrDefault(propertyKey, propertyKey);
var displayValue = FormatValue(propertyKey, Value[propertyKey]);
rows.Add((i + 1, displayName, displayValue));
}

return rows;
Copy link

Choose a reason for hiding this comment

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

Можно так:

return PropertyOrder.Select((propertyKey, i) => (
      i + 1, 
      PropertyNames.GetValueOrDefault(propertyKey, propertyKey), 
      FormatValue(propertyKey, Value[propertyKey])
  )).ToList();

Comment on lines -7 to -10
<UnorderedListItem>Номер <Strong>№X "Название лабораторной"</Strong></UnorderedListItem>
<UnorderedListItem>Вариант <Strong>№Х "Название варианта"</Strong></UnorderedListItem>
<UnorderedListItem>Выполнена <Strong>Фамилией Именем 65ХХ</Strong> </UnorderedListItem>
<UnorderedListItem><Link To="https://puginarug.com/">Ссылка на форк</Link></UnorderedListItem>
Copy link

Choose a reason for hiding this comment

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

Здесь надо было просто проставить свои данные

using Client.Wasm;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
Copy link

Choose a reason for hiding this comment

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

Удалить неиспользуемые using

var cache = builder.AddRedis("patient-cache")
.WithRedisInsight(containerName: "patient-insight");

var generator = builder.AddProject("generator", "../Patient.Generator/Patient.Generator.csproj")
Copy link

Choose a reason for hiding this comment

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

Использовать дженерик версию AddProject() тут и ниже

{
var gender = f.PickRandom<Bogus.DataSets.Name.Gender>();
var firstName = f.Name.FirstName(gender);
var patronymicBase = f.Name.FirstName(gender);
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 +49 to +55
var today = DateOnly.FromDateTime(DateTime.Today);
var earliestBirthDate = today.AddYears(-MaxAgeYears);
var totalDays = today.DayNumber - earliestBirthDate.DayNumber;
var offset = f.Random.Int(0, totalDays);
var birthDate = earliestBirthDate.AddDays(offset);

return birthDate > today ? today : birthDate;
Copy link

Choose a reason for hiding this comment

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

Может так лучше:

var today = DateOnly.FromDateTime(DateTime.Today);
return f.Date.BetweenDateOnly(today.AddYears(-MaxAgeYears), today);

Comment on lines +65 to +69
var today = DateOnly.FromDateTime(DateTime.Today);
var totalDays = today.DayNumber - dto.BirthDate.DayNumber;
var offset = f.Random.Int(0, totalDays);
var examinationDate = dto.BirthDate.AddDays(offset);
return examinationDate < dto.BirthDate ? dto.BirthDate : examinationDate;
Copy link

Choose a reason for hiding this comment

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

var today = DateOnly.FromDateTime(DateTime.Today);
return f.Date.BetweenDateOnly(dto.BirthDate, today);

Copy link

Choose a reason for hiding this comment

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

Удалить

options.AddPolicy("AllowLocalDev", policy =>
{
policy
.AllowAnyOrigin()
Copy link

Choose a reason for hiding this comment

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

Можно настроить origin, чтобы только клиент мог обращаться к апи

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