Skip to content

Лаб.4 6412 Ксеневич Максим#287

Open
maeosha wants to merge 56 commits intoitsecd:mainfrom
maeosha:lab4
Open

Лаб.4 6412 Ксеневич Максим#287
maeosha wants to merge 56 commits intoitsecd:mainfrom
maeosha:lab4

Conversation

@maeosha
Copy link

@maeosha maeosha commented Feb 24, 2026

ФИО: Ксеневич Максим Станиславович
Номер группы: 6412
Номер лабораторной: 4
Номер варианта: 36
Краткое описание предметной области: Поликлиника
Краткое описание добавленных фич: Добавлена доменная модель/юнит-тесты/т.д.В ходе лабораторной работы спроектирован и внедрён сервис автоматической генерации пациентов, обменивающийся данными с основным сервером посредством потокового gRPC-канала. Вся система, включая генератор данных оркестрируется через .NET Aspire. Так же изменил структуру DTO, вместо отдельный CreateDto UpdateDto, создал один общий DTO CreateUpdate*Dto.
Немного структурировал проект.

maeosha added 30 commits October 2, 2025 19:31
…patients, doctors, specializations, and appointments
maeosha and others added 24 commits November 27, 2025 23:58
…nt, and Specialization services, enhancing method naming and documentation
…ctor, patient, and specialization management in the Clinic API
…terface to include specialization update functionality
… and specialization management, consolidating common CRUD operations and enhancing code reusability
… Doctor, Specialization, and Appointment services, and add mapping for UpdateSpecializationDto
… Doctor, Patient, and Specialization management
- Created ClinicDbFactory for design-time DbContext instantiation.
- Added initial migration (20251219134315_InitialCreate) to set up database schema for Doctors, Patients, Specializations, Appointments, and DoctorSpecialization tables.
- Implemented seed data migration (20251219134336_SeedData) to populate initial records for specializations, doctors, patients, and appointments.
- Updated model snapshot to reflect the current state of the database schema.
- Removed IClinicDataBase interface and its implementation.
- Deleted DataSeed class for test data.
- Updated Program.cs to configure Entity Framework and database context.
- Created AnalyticsServices for analytics-related functionalities.
- Refactored AppointmentServices, DoctorServices, PatientServices, and SpecializationServices to use specific data interfaces.
- Updated appsettings for database connection strings and logging levels.
- Created CreateUpdateDoctorDto and GetDoctorDto for doctor management.
- Added CreateUpdatePatientDto and GetPatientDto for patient management.
- Introduced CreateUpdateSpecializationDto and GetSpecializationDto for specialization handling.
- Implemented service interfaces for appointment, doctor, patient, and specialization management.
- Established base service interface for CRUD operations.
- Updated in-memory repositories to implement new interfaces.
- Removed obsolete ServiceDefaults project and related files.
- Added gRPC contract for appointment ingestion.
- Updated solution file to reflect new project structure and references.
@github-actions github-actions bot added In progress Код в процессе проверки Lab 4 Лабораторная №4. Инфраструктура labels Feb 24, 2026
@github-actions github-actions bot requested a review from alxmcs February 24, 2026 11:57
Copy link
Contributor

@alxmcs alxmcs left a comment

Choose a reason for hiding this comment

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

Если подводить итог:

  • в проектах выбраны некорректные sdk,
  • в проектах инвертирован информационный обмен по grpc,
  • генератор контрактов не стартует,
  • нарушена архитектура - независимые друг от друга сервисы вместо общей библиотеки контрактов имеют еще и общую базу.
  • пересдача состоится завтра, а пул-риквест ты открыл сегодня.

Я понимаю, что это жест отчаяния, и рассчитан он был на то, что я скорее осведомлюсь о наличии кода, чем о его качестве. К общему нашему сожалению, я осведомился о качестве.

Очевидно, что исправить такие существенные архитектурные проблемы за оставшееся время ты не успеешь (или помрешь пытаясь, а мне потом посреди ночи это ревьюировать). Так что давай встретимся на комиссии.

Copy link
Contributor

Choose a reason for hiding this comment

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

Тебе темплейты чем мешали? Будь добр, верни все обратно

Comment on lines +20 to +21
[HttpGet("doctors/experience")]
[ProducesResponseType(typeof(IReadOnlyList<GetDoctorDto>), StatusCodes.Status200OK)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Здесь и далее по коду - нет атрибутов с респонс кодами метода контроллера

Comment on lines +9 to +14
/// <summary>
/// Controller for analytics and business logic queries about doctors, patients, and appointments.
/// </summary>
[ApiController]
[Route("api/analytics")]
public class AnalyticsController(AnalyticsServices testServices) : ControllerBase
Copy link
Contributor

Choose a reason for hiding this comment

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

Здесь и далее по коду - нет описания параметров службы в саммари

/// gRPC service that ingests appointment contracts from a client stream
/// and persists mapped appointments to storage.
/// </summary>
public class ContractIngestService : ContractIngestor.ContractIngestorBase
Copy link
Contributor

Choose a reason for hiding this comment

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

Image

Я уверен, что есть более расхожие термины, которые передадут ту же мысль о функционале службы

Comment on lines 12 to 13
.WithReference(postgresql)
.WithReference(api)
Copy link
Contributor

Choose a reason for hiding this comment

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

Генератору контрактов не нужны референсы ни к серверу апи, ни тем более к базе данных. Это полностью независимый сервис, который разделяет с апи сервером только контракты

Copy link
Contributor

Choose a reason for hiding this comment

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

Я в каждом втором pr твоим одногруппникам писал, что сервис генерации не должен знать про базу. В итоге ты каплишь его и сервер апи по базе. Потрясающе.
На всякий случай - все pr твоих одногруппников находятся в этом же репозитории, они лежат в тут в открытом виде, на них можно посмотреть, чтобы не наступать на те же грабли, что и твои предшественники.

Говорить о том ,что этот класс нарушает SRP я уже не буду, потому что в том виде, в котором он существует сейчас, он существовать не должен

Copy link
Contributor

Choose a reason for hiding this comment

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

Хотя бы запускай в отладке код, перед тем как пытаться отправить его на ревью
Image

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Version="2.64.0" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Генератор контрактов - не grpc-клиент, а grpc-сервер, так как он является источником данных. У тебя перепутано направление информационного обмена

</ItemGroup>

<ItemGroup>
<Protobuf Include="Proto/appointment.proto" GrpcServices="Both" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Это не лучшее место для генерации контрактов - проекты, которые будут референсить эту библиотеку, получат лишний функционал - проекту, которому требуется grpc клиент достанется еще и сервер, проекту, которому требуется grpc сервер достанется еще и клиент

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.0.0" />
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="Grpc.AspNetCore" Version="2.64.0" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Соответственно, сервер рестового апи в информационном обмене по grpc выступает клиентом. У тебя наоборот

@maeosha maeosha requested a review from alxmcs February 24, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In progress Код в процессе проверки Lab 4 Лабораторная №4. Инфраструктура

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants