-
Notifications
You must be signed in to change notification settings - Fork 76
6412 Лаб.3 Ксеневич Максим #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maeosha
wants to merge
53
commits into
itsecd:main
Choose a base branch
from
maeosha:lab3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
3d9fdf1
feat: add enums: BloodGroup, Gender and RhesusFactor
maeosha b6a1c23
feat: add contract Appointment
maeosha 44a437e
feat: add reference book Specialisation
maeosha 628947b
feat: add entities: Doctor and Patient
maeosha e96ed1c
feat: add main class Clinic
maeosha 7cd6a44
feat: add dataseed for unit-tests
maeosha 95cf9fe
feat: add unit-tests
maeosha 594985e
feat: add build configuration for C# project
maeosha f2e2575
feat: add solution
maeosha ab3db8c
add summary and chage blood goup names
maeosha faba51e
feat: extracted identical variables and functions from the doctors an…
maeosha 3e1eda4
feat: Now these classes inherit the basic characteristics from Person…
maeosha 06d6b89
fix: add summary
maeosha 2fa6ec7
fix: Rewrite the tests and datasid, bring them to an adequate form.
maeosha b7a94a7
fix: delete old Contracts/Appointment
maeosha e2c2f53
fix: delete SpecialiSation.cs
maeosha 5027d2e
feat: implement Patient management functionality with CRUD operations…
maeosha 9fa5d71
feat: add Specialization management functionality with CRUD operation…
maeosha 2c79b53
feat: implement Doctor management functionality with CRUD operations …
maeosha 8223f2f
feat: implement Appointment management functionality with CRUD operat…
maeosha 3f5f1aa
feat: implement ClinicDataBase with CRUD operations for patients, doc…
maeosha 4f9e9a7
feat: add DataSeed class to populate the database with test data for …
maeosha ad3ca39
feat: add DateConverter for JSON serialization of DateOnly type
maeosha 62c75e7
feat: add AutoMapper profile for mapping between DTOs and entity mode…
maeosha beb4bcb
feat: initialize Clinic API with main program setup, including servic…
maeosha 272ee8c
feat: add TestServices and TestControllers for enhanced patient and d…
maeosha a602e50
feat: update DataSeed
maeosha ca81d9a
fix: change DateOnly to DateTime in GetAppointmentDto for correct dat…
maeosha 6957ee2
fix: The Clinic.APi folder has been moved
maeosha ee57321
fix: Now Specialization is also an entity
maeosha 91e7fbd
refactor: remove obsolete clinic model and associated test files
maeosha 99b29a7
fix: update solution file to include Clinic.Api project and remove Cl…
maeosha 42861b1
fix: remove custom mapping for DateTime in GetAppointmentDto
maeosha 3a6d5da
feat: add service interfaces for appointment, doctor, patient, and sp…
maeosha 20bb967
refactor: implement service interfaces for Appointment, Doctor, Patie…
maeosha a72bf0b
feat: add base and specific controller interfaces for appointment, do…
maeosha 4e48065
feat: add UpdateSpecialization method to ClinicDataBase and update in…
maeosha 65a26b1
refactor: implement base controller for appointment, doctor, patient,…
maeosha 18fe57d
refactor: update service registrations to use interfaces for Patient,…
maeosha e84698d
feat: implement Entity Framework data access classes for Appointment,…
maeosha 0c1363c
feat: add interfaces for appointment, doctor, patient, and specializa…
maeosha 0d1a0be
Add initial database setup and seed data for clinic management system
maeosha 7d33040
feat: implement analytics controller and refactor existing controller…
maeosha 95f8bcf
Refactor clinic database structure and services
maeosha f48a48b
feat: add unit tests and project configuration for Clinic.Tests
maeosha 557ee16
feat: add CI workflow for build and test automation
maeosha 1202cae
feat: configure Swagger UI and enable automatic launch in development…
maeosha 257dd06
chore: remove outdated issue and discussion templates, and PR template
maeosha 670e4fd
feat: update DTO namespaces and add service defaults for improved str…
maeosha 33b472c
feat: refactor repository interfaces and implementations for better s…
maeosha 28438c0
fix: changed the database from MySQL to PostgreSQL
maeosha c81f41c
feat: add in-memory repositories for appointments, doctors, patients,…
maeosha 0dc0c2a
Fix project SDK declaration in csproj file
maeosha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| # GitHub Actions Workflows | ||
|
|
||
| Данный репозиторий содержит набор GitHub Actions workflows для автоматизации CI/CD процессов для ASP.NET Core проекта клиники. | ||
|
|
||
| ## Доступные Workflows | ||
|
|
||
| ### 1. CI Pipeline (`ci.yml`) | ||
| **Триггеры:** Push в `main`/`develop`, Pull Request в `main`/`develop` | ||
|
|
||
| **Функции:** | ||
| - Сборка .NET 9.0 проектов | ||
| - Восстановление NuGet зависимостей | ||
| - Запуск тестов (если есть) | ||
| - Кэширование NuGet пакетов для ускорения сборки | ||
|
|
||
| **Использование:** | ||
| ```bash | ||
| # Локальная сборка | ||
| dotnet restore Clinic/Clinic.sln | ||
| dotnet build Clinic/Clinic.sln --configuration Release | ||
| dotnet test Clinic/Clinic.sln --configuration Release | ||
| ``` | ||
|
|
||
| ### 2. Docker Build and Deploy (`docker.yml`) | ||
| **Триггеры:** Push в `main`, теги `v*`, Pull Request в `main` | ||
|
|
||
| **Функции:** | ||
| - Создание Docker образа для API | ||
| - Публикация образа в GitHub Container Registry | ||
| - Поддержка версионирования образов | ||
|
|
||
| **Использование:** | ||
| ```bash | ||
| # Сборка Docker образа | ||
| docker build -f Clinic/Clinic.Api/Dockerfile -t clinic-api:latest . | ||
|
|
||
| # Запуск контейнера | ||
| docker run -p 8080:8080 clinic-api:latest | ||
| ``` | ||
|
|
||
| ### 3. Azure Deploy (`azure-deploy.yml`) | ||
| **Триггеры:** Push в `main`, ручной запуск | ||
|
|
||
| **Функции:** | ||
| - Публикация .NET проекта | ||
| - Деплой в Azure App Service | ||
|
|
||
| **Необходимые Secrets:** | ||
| - `AZURE_WEBAPP_NAME` - имя Azure App Service | ||
| - `AZURE_WEBAPP_PUBLISH_PROFILE` - профиль публикации | ||
|
|
||
| **Настройка Azure:** | ||
| 1. Создайте Azure App Service | ||
| 2. Скачайте профиль публикации | ||
| 3. Добавьте Secrets в GitHub репозиторий | ||
|
|
||
| ## Структура файлов | ||
|
|
||
| ``` | ||
| .github/ | ||
| ├── workflows/ | ||
| │ ├── ci.yml # Основной CI pipeline | ||
| │ ├── docker.yml # Docker сборка и деплой | ||
| │ ├── azure-deploy.yml # Azure App Service деплой | ||
| │ └── setup_pr.yml # Автоматическая настройка PR | ||
| ├── ISSUE_TEMPLATE/ | ||
| │ └── вопрос-по-лабораторной.md | ||
| ├── PULL_REQUEST_TEMPLATE.md | ||
| └── DISCUSSION_TEMPLATE/ | ||
| └── questions.yml | ||
|
|
||
| Clinic/ | ||
| ├── Clinic.Api/ | ||
| │ ├── Dockerfile # Docker образ для API | ||
| │ └── .dockerignore # Исключения для Docker сборки | ||
| └── ... | ||
| ``` | ||
|
|
||
| ## Настройка проекта | ||
|
|
||
| ### Для локальной разработки: | ||
| ```bash | ||
| # Восстановление зависимостей | ||
| dotnet restore Clinic/Clinic.sln | ||
|
|
||
| # Сборка проекта | ||
| dotnet build Clinic/Clinic.sln | ||
|
|
||
| # Запуск API | ||
| dotnet run --project Clinic/Clinic.Api | ||
|
|
||
| # Запуск с настройками разработки | ||
| cd Clinic/Clinic.Api | ||
| dotnet run | ||
| ``` | ||
|
|
||
| ### Для Docker: | ||
| ```bash | ||
| # Сборка образа | ||
| docker build -f Clinic/Clinic.Api/Dockerfile -t clinic-api . | ||
|
|
||
| # Запуск с базой данных (пример) | ||
| docker run -p 8080:8080 -e ConnectionStrings__DefaultConnection="Server=host.docker.internal;Database=ClinicDb;User=sa;Password=YourPassword;" clinic-api | ||
| ``` | ||
|
|
||
| ## Переменные окружения | ||
|
|
||
| Для работы проекта необходимо настроить следующие переменные окружения: | ||
|
|
||
| ### Development: | ||
| - `ASPNETCORE_ENVIRONMENT=Development` | ||
| - `ConnectionStrings__DefaultConnection` - строка подключения к БД | ||
|
|
||
| ### Production: | ||
| - `ASPNETCORE_ENVIRONMENT=Production` | ||
| - `ConnectionStrings__DefaultConnection` - строка подключения к продакшн БД | ||
|
|
||
| ## Дополнительные возможности | ||
|
|
||
| ### Добавление тестов: | ||
| 1. Создайте тестовый проект: `dotnet new xunit -n Clinic.Tests` | ||
| 2. Добавьте ссылку на основной проект | ||
| 3. CI pipeline автоматически запустит тесты | ||
|
|
||
| ### Мониторинг: | ||
| - Логи Azure App Service доступны через Azure Portal | ||
| - Docker контейнеры можно мониторить через Docker Desktop или Azure Container Instances | ||
|
|
||
| ### Безопасность: | ||
| - Используйте GitHub Secrets для хранения чувствительных данных | ||
| - Не коммитьте ключи подключения к БД в репозиторий |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: Build Check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 8.0.x | ||
|
|
||
| - name: Restore dependencies | ||
| run: dotnet restore Clinic/Clinic.sln | ||
|
|
||
| - name: Build solution | ||
| run: dotnet build Clinic/Clinic.sln --configuration Release --no-restore | ||
|
|
||
| - name: Test solution | ||
| run: dotnet test ./Clinic/Clinic.Tests/Clinic.Tests.csproj --configuration Release --no-build --verbosity normal | ||
|
|
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <Nullable>enable</Nullable> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Swashbuckle.AspNetCore" Version="8.0.0" /> | ||
| <PackageReference Include="AutoMapper" Version="13.0.1" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Clinic.Models\Clinic.Models.csproj" /> | ||
| <ProjectReference Include="..\Clinic.Application\Clinic.Application.csproj" /> | ||
| <ProjectReference Include="..\Clinic.DataBase\Clinic.DataBase.csproj" /> | ||
| <ProjectReference Include="..\Clinic.ServiceDefaults\Clinic.ServiceDefaults.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Потому что ее никто не билдит