Open
Conversation
Gwymlas
requested changes
Mar 19, 2026
| /// <param name="cancellationToken">Токен отмены операции</param> | ||
| /// <returns>Объект жилого строительства</returns> | ||
| [HttpGet] | ||
| public async Task<ActionResult<ResidentialPropertyEntity>> GetById([FromQuery] int id, CancellationToken cancellationToken) |
|
|
||
| public ResidentialPropertyGenerator() | ||
| { | ||
| var propertyTypes = new[] { "Квартира", "ИЖС", "Апартаменты", "Офис", "Коммерческая" }; |
There was a problem hiding this comment.
Вынести в private static readonly поле
| public ResidentialPropertyGenerator() | ||
| { | ||
| var propertyTypes = new[] { "Квартира", "ИЖС", "Апартаменты", "Офис", "Коммерческая" }; | ||
| var currentYear = DateTime.Now.Year; |
There was a problem hiding this comment.
Может лучше вычислять в момент генерации
| .RuleFor(p => p.Floor, (f, p) => | ||
| p.PropertyType == "ИЖС" ? null : f.Random.Number(1, p.TotalFloors)) | ||
| .RuleFor(p => p.CadastralNumber, f => | ||
| $"{f.Random.Number(1, 99):D2}.{f.Random.Number(1, 99):D2}.{f.Random.Number(1, 99):D2}.{f.Random.Number(1, 999999):D6}.{f.Random.Number(1, 9999):D4}") |
| @@ -0,0 +1,92 @@ | |||
| using Microsoft.Extensions.Caching.Distributed; | |||
| using ResidentialProperty.Api.Services.ResidentialPropertyGeneratorService; | |||
| /// <summary> | ||
| /// Сервис получения объекта жилого строительства: сначала ищет в кэше, при промахе — генерирует новый и сохраняет | ||
| /// </summary> | ||
| public class ResidentialPropertyGeneratorService( |
There was a problem hiding this comment.
Работу с кэшем выделить либо в отдельные методы, либо в отдельную службу
|
|
||
| // Добавляем клиентский проект с ссылкой на API | ||
| builder.AddProject<Projects.Client_Wasm>("client-wasm") | ||
| .WithReference(api) |
| @@ -0,0 +1,20 @@ | |||
| <Project Sdk="Aspire.AppHost.Sdk/13.1.0"> | |||
There was a problem hiding this comment.
До этого по коду использовалась версия 9.5.2, ее и оставим. Тут и ниже подправить
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.
ФИО: Абанин Иван
Номер группы: 6512
Номер лабораторной: 1
Номер варианта: 19
Краткое описание предметной области: «Объект жилого строительства»
Краткое описание добавленных фич: Добавлена модель данных, добавлен сервис генерации, сделан endpoint, добавлен кеш, оркестратор