Замотохина Мария. Лаб. 1. Группа 6511#54
Open
ZamotohinaMaria wants to merge 9 commits intoitsecd:mainfrom
Open
Замотохина Мария. Лаб. 1. Группа 6511#54ZamotohinaMaria wants to merge 9 commits intoitsecd:mainfrom
ZamotohinaMaria wants to merge 9 commits intoitsecd:mainfrom
Conversation
danlla
requested changes
Mar 17, 2026
danlla
left a comment
There was a problem hiding this comment.
- Папка
wwwrootне нужна в проекте с генератором - При запуске aspire приложение запускается лишний браузер с клиентом, чтобы этого не происходило можно в профиле запуска клиента в
launchsettings.jsonпроставитьlaunchBrowserвfalse - Нет ни структурированных логов, ни обычных логов в консоли, если использовать serilog, то его нужно настроить на вывод логов в консоль и на отправку логов в
OpenTelemetry, откуда они потом попадают в структурированные логи в дашбордах aspire
| /// <summary> | ||
| /// Вес - округляется до двух знаков после запятой | ||
| /// </summary> | ||
| public required double Width { get; set; } |
| /// <param name="faker">Генератор случайных данных</param> | ||
| /// <param name="height">Рост</param> | ||
| /// <returns>Вес пациента, округленный до 2х знаков после запятой</returns> | ||
| private static double GenerateWidth(Faker faker, double height) |
| private static double GenerateWidth(Faker faker, double height) | ||
| { | ||
| var bmi = faker.Random.Double(15, 40); | ||
| return (int)(bmi * height * height); |
There was a problem hiding this comment.
Здесь не нужно приводить к int, но нужно округлить до 2 знаков
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Bogus" Version="35.6.5" /> | ||
| <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.5" /> |
There was a problem hiding this comment.
Лучше использовать пакет Aspire.StackExchange.Redis.DistributedCaching
Comment on lines
+25
to
+33
| builder.Services.AddCors(options => | ||
| { | ||
| options.AddDefaultPolicy(policy => | ||
| { | ||
| policy.AllowAnyOrigin() | ||
| .AllowAnyMethod() | ||
| .AllowAnyHeader(); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
cors лучше настроить так, чтобы только клиент мог делать запросы
например передавать нужные origins в appsettings.json
Author
There was a problem hiding this comment.
Не совем понимаю, как это сделать, с cors не очень дружу...
MedicalPatient.Generator/Program.cs
Outdated
| ILogger<Program> logger, | ||
| CancellationToken cancellationToken) => | ||
| { | ||
| logger.LogInformation("������� ������ �� ���������� �������� � ID: {Id}", id); |
Comment on lines
+3
to
+16
| <Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" /> | ||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <IsAspireHost>true</IsAspireHost> | ||
| <UserSecretsId>fe743bf2-08eb-41c7-817b-f144b739dce3</UserSecretsId> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Aspire.Hosting.AppHost" Version="13.1.2" /> | ||
| <PackageReference Include="Aspire.Hosting.Redis" Version="13.1.2" /> | ||
| </ItemGroup> |
There was a problem hiding this comment.
Версия aspire 9.0.0, а версии пакетов 13.1.2, нужно прийти к одной версии здесь
Лучше всего наверно это версия 9.5.2
Comment on lines
+6
to
+8
| var generator = builder.AddProject<Projects.MedicalPatient_Generator>("medicalpatient-generator") | ||
| .WithReference(redis) | ||
| .WithExternalHttpEndpoints(); |
Comment on lines
+10
to
+11
| builder.AddProject<Projects.Client_Wasm>("client") | ||
| .WithReference(generator); |
| using Bogus.DataSets; | ||
| using MedicalPatient.Generator.Models; | ||
| using Microsoft.AspNetCore.Mvc.RazorPages; | ||
| using Microsoft.Extensions.Logging; |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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