-
Notifications
You must be signed in to change notification settings - Fork 52
Уваров Никита Лаб. 3 Группа 6513 #86
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
Rifinn-crypto
wants to merge
28
commits into
itsecd:main
Choose a base branch
from
Rifinn-crypto:main
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
28 commits
Select commit
Hold shift + click to select a range
9e2d2ae
создал необходимые проекты для архитектуры
Rifinn-crypto 0b417eb
Реализация Application
Rifinn-crypto 5fdc84a
Создал Generator
Rifinn-crypto 50fa1f5
Кеширование
Rifinn-crypto 494e372
Попытка выжить в этом жестоком мире
Rifinn-crypto 871d798
Исправления
Rifinn-crypto c8e701b
:)
Rifinn-crypto 5c5cb8e
Перелопатив весь код обнаружил, что надо было исправить всего одну пе…
Rifinn-crypto b0a7b6c
.
Rifinn-crypto 9f3a8f0
.
Rifinn-crypto 9d3bc73
.....
Rifinn-crypto 826be7d
.............
Rifinn-crypto a79906c
.....
Rifinn-crypto ef0152d
Update StudentCard.razor
Rifinn-crypto dee8451
Исправления в коде
Rifinn-crypto 4ec7b8f
Исправления с интеграцией redis, а так же дроп ненужных библиотек
Rifinn-crypto 2e1a15f
Удалил .http
Rifinn-crypto d0bc46f
Добавил недостающие саммари
Rifinn-crypto 2ec7c2c
+1
Rifinn-crypto e8abbf9
Настройка клиента
Rifinn-crypto 9144fcc
Переделал Балансировщик
Rifinn-crypto d46b2fe
Добавил summary
Rifinn-crypto e3056ed
Забыл подправить
Rifinn-crypto b6d2bb8
Правки
Rifinn-crypto 5298cf4
3 лабораторная
Rifinn-crypto c18f2f1
.
Rifinn-crypto 9675863
Забыл про защиту токена
Rifinn-crypto d9d1d27
.
Rifinn-crypto 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 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 |
|---|---|---|
|
|
@@ -416,3 +416,5 @@ FodyWeavers.xsd | |
| *.msix | ||
| *.msm | ||
| *.msp | ||
|
|
||
| **/appsettings.Development.json | ||
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
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 |
|---|---|---|
|
|
@@ -6,5 +6,5 @@ | |
| } | ||
| }, | ||
| "AllowedHosts": "*", | ||
| "BaseAddress": "" | ||
| "BaseAddress": "https://localhost:9002/api/Credit" | ||
| } | ||
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
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,61 @@ | ||
| using CreditApp.Api.Services; | ||
| using CreditApp.Domain.Data; | ||
| using Microsoft.AspNetCore.Mvc; | ||
|
|
||
| namespace CreditApp.Api.Controllers; | ||
|
|
||
| /// <summary> | ||
| /// Контроллер для работы с кредитными заявками | ||
| /// </summary> | ||
| [ApiController] | ||
| [Route("api/[controller]")] | ||
| public class CreditController( | ||
| ICreditService creditService, | ||
| ILogger<CreditController> logger) | ||
| : ControllerBase | ||
| { | ||
| /// <summary> | ||
| /// Получить кредитную заявку по идентификатору | ||
| /// </summary> | ||
| [HttpGet] | ||
| [ProducesResponseType(typeof(CreditApplication), StatusCodes.Status200OK)] | ||
| [ProducesResponseType(StatusCodes.Status400BadRequest)] | ||
| [ProducesResponseType(StatusCodes.Status404NotFound)] | ||
| [ProducesResponseType(StatusCodes.Status500InternalServerError)] | ||
| public async Task<ActionResult<CreditApplication>> Get( | ||
| int id, | ||
| CancellationToken cancellationToken) | ||
| { | ||
| try | ||
| { | ||
| if (id <= 0) | ||
| { | ||
| logger.LogWarning("Invalid credit application ID: {CreditId}", id); | ||
| return BadRequest("Id must be positive number"); | ||
| } | ||
|
|
||
| logger.LogInformation("Requesting credit application {CreditId}", id); | ||
|
|
||
| var result = await creditService.GetAsync(id, cancellationToken); | ||
|
|
||
| if (result == null) | ||
| { | ||
| logger.LogWarning("Credit application {CreditId} not found", id); | ||
| return NotFound($"Credit application with ID {id} not found"); | ||
| } | ||
|
|
||
| logger.LogInformation("Successfully retrieved credit application {CreditId}", id); | ||
| return Ok(result); | ||
| } | ||
| catch (OperationCanceledException) | ||
| { | ||
| logger.LogWarning("Request for credit application {CreditId} was cancelled", id); | ||
| return StatusCode(499, "Request cancelled by client"); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| logger.LogError(ex, "Error retrieving credit application {CreditId}: {ErrorMessage}", id, ex.Message); | ||
| return StatusCode(StatusCodes.Status500InternalServerError, "Internal server error"); | ||
| } | ||
| } | ||
| } |
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,24 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <Nullable>enable</Nullable> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Aspire.StackExchange.Redis.DistributedCaching" Version="13.1.1" /> | ||
| <PackageReference Include="AWSSDK.SQS" Version="4.0.2.22" /> | ||
| <PackageReference Include="Bogus" Version="35.6.5" /> | ||
| <PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Client.Wasm\Client.Wasm.csproj" /> | ||
| <ProjectReference Include="..\CreditApp.Domain\CreditApp.Domain.csproj" /> | ||
| <ProjectReference Include="..\CreditApp.Gateway\CreditApp.Gateway.csproj" /> | ||
| <ProjectReference Include="..\CreditApp.ServiceDefaults\CreditApp.ServiceDefaults.csproj" /> | ||
| <ProjectReference Include="..\CreditApp.Messaging\CreditApp.Messaging.csproj" /> | ||
| </ItemGroup> | ||
|
Comment on lines
+16
to
+22
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Большая часть этих референсов тебе не нужна |
||
|
|
||
| </Project> | ||
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,32 @@ | ||
| using Amazon.SQS; | ||
| using CreditApp.Api.Services; | ||
| using CreditApp.ServiceDefaults; | ||
|
|
||
| var builder = WebApplication.CreateBuilder(args); | ||
| builder.AddServiceDefaults(); | ||
|
|
||
| builder.AddRedisDistributedCache("redis"); | ||
|
|
||
| builder.Services.AddControllers(); | ||
| builder.Services.AddEndpointsApiExplorer(); | ||
| builder.Services.AddSwaggerGen(); | ||
|
|
||
| var localstackUrl = "http://sqs.us-east-1.localhost.localstack.cloud:4566"; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Этот параметр нужно получать из конфигурации аспаер |
||
| var sqsConfig = new AmazonSQSConfig { ServiceURL = localstackUrl }; | ||
| builder.Services.AddSingleton<IAmazonSQS>(new AmazonSQSClient("test", "test", sqsConfig)); | ||
| builder.Services.AddScoped<ICreditService, CreditService>(); | ||
| builder.Services.AddScoped<SqsProducer>(); | ||
|
|
||
| var app = builder.Build(); | ||
|
|
||
| if (app.Environment.IsDevelopment()) | ||
| { | ||
| app.UseSwagger(); | ||
| app.UseSwaggerUI(); | ||
| } | ||
|
|
||
| app.MapDefaultEndpoints(); | ||
| app.UseHttpsRedirection(); | ||
| app.UseAuthorization(); | ||
| app.MapControllers(); | ||
| app.Run(); | ||
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,41 @@ | ||
| { | ||
| "$schema": "http://json.schemastore.org/launchsettings.json", | ||
| "iisSettings": { | ||
| "windowsAuthentication": false, | ||
| "anonymousAuthentication": true, | ||
| "iisExpress": { | ||
| "applicationUrl": "http://localhost:50546", | ||
| "sslPort": 44330 | ||
| } | ||
| }, | ||
| "profiles": { | ||
| "http": { | ||
| "commandName": "Project", | ||
| "dotnetRunMessages": true, | ||
| "launchBrowser": false, | ||
| "launchUrl": "swagger", | ||
| "applicationUrl": "http://localhost:7401", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development" | ||
| } | ||
| }, | ||
| "https": { | ||
| "commandName": "Project", | ||
| "dotnetRunMessages": true, | ||
| "launchBrowser": false, | ||
| "launchUrl": "swagger", | ||
| "applicationUrl": "https://localhost:7401", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development" | ||
| } | ||
| }, | ||
| "IIS Express": { | ||
| "commandName": "IISExpress", | ||
| "launchBrowser": true, | ||
| "launchUrl": "swagger", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development" | ||
| } | ||
| } | ||
| } | ||
| } |
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.
Чтобы у меня точно твоя лаба не запустилась