Skip to content

Commit 91d01e1

Browse files
authored
Merge pull request #56 from felipementel/feature/update-csproj
Feature/update csproj
2 parents e956d85 + dcb1608 commit 91d01e1

34 files changed

+143
-35
lines changed

.github/workflows/pull-request-sonar.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
pull_request:
44
types: [opened, synchronize, reopened]
55
paths:
6-
- "src/*"
6+
- "src/**"
77
workflow_dispatch:
88

99
# defaults:

.github/workflows/push-image.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Image
33
on:
44
push:
55
paths:
6-
- 'src/*'
6+
- 'src/**'
77
branches:
88
- main
99
workflow_dispatch:

docker/docker-compose.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# docker-compose -f ../docker/docker-compose.yml up -d --build
33
# docker-compose -f ../docker/docker-compose.yml down --remove-orphans
44

5-
version: '3.8'
65
services:
76
# cachorro.api:
87
# hostname: cachorro-api
@@ -43,15 +42,15 @@ services:
4342
ports:
4443
- 1433:1433
4544

46-
sonarqube:
47-
image: sonarqube:10.4.1-community
48-
hostname: sonar-canal-deploy
49-
container_name: sonar-canal-deploy
50-
restart: always
51-
networks:
52-
- cachorro-net
53-
ports:
54-
- 9044:9000
45+
# sonarqube:
46+
# image: sonarqube:10.4.1-community
47+
# hostname: sonar-canal-deploy
48+
# container_name: sonar-canal-deploy
49+
# restart: always
50+
# networks:
51+
# - cachorro-net
52+
# ports:
53+
# - 9044:9000
5554

5655
networks:
5756
cachorro-net:

src/DEPLOY.Cachorro.Api/Controllers/TestsResourcesController.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
using Azure.Security.KeyVault.Secrets;
44
using DEPLOY.Cachorro.Api.Extensions.AppConfiguration.Configs;
55
using Microsoft.AspNetCore.Mvc;
6+
using Microsoft.Extensions.Configuration;
67
using Microsoft.Extensions.Options;
78
using Microsoft.FeatureManagement;
9+
using System;
810
using System.Diagnostics.CodeAnalysis;
11+
using System.Threading.Tasks;
912

1013
namespace DEPLOY.Cachorro.Api.Controllers
1114
{
@@ -34,7 +37,7 @@ public TestsResourcesController(
3437
}
3538

3639
[HttpGet("keyvault/withoptions/{key}")]
37-
public async Task<IActionResult> GetAsync(string key)
40+
public async Task<IActionResult> GetKeyAsync(string key)
3841
{
3942
SecretClientOptions options = new SecretClientOptions()
4043
{

src/DEPLOY.Cachorro.Api/Controllers/v1/AdocoesController.cs

+5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
using Asp.Versioning;
22
using DEPLOY.Cachorro.Application.Interfaces.Services;
33
using Microsoft.AspNetCore.Authorization;
4+
using Microsoft.AspNetCore.Http;
45
using Microsoft.AspNetCore.Mvc;
56
using Swashbuckle.AspNetCore.Annotations;
7+
using System;
8+
using System.Linq;
9+
using System.Threading;
10+
using System.Threading.Tasks;
611

712
namespace DEPLOY.Cachorro.Api.Controllers.v1
813
{

src/DEPLOY.Cachorro.Api/Controllers/v1/CachorrosController.cs

+6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
using DEPLOY.Cachorro.Application.Dtos;
44
using DEPLOY.Cachorro.Application.Interfaces.Services;
55
using Microsoft.AspNetCore.Authorization;
6+
using Microsoft.AspNetCore.Http;
67
using Microsoft.AspNetCore.Mvc;
78
using Swashbuckle.AspNetCore.Annotations;
9+
using System;
10+
using System.Collections.Generic;
11+
using System.Linq;
12+
using System.Threading;
13+
using System.Threading.Tasks;
814

915
namespace DEPLOY.Cachorro.Api.Controllers.v1
1016
{

src/DEPLOY.Cachorro.Api/Controllers/v1/TutoresController.cs

+13-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
using DEPLOY.Cachorro.Application.Dtos;
33
using DEPLOY.Cachorro.Application.Interfaces.Services;
44
using Microsoft.AspNetCore.Authorization;
5-
using Microsoft.AspNetCore.Http.HttpResults;
5+
using Microsoft.AspNetCore.Http;
66
using Microsoft.AspNetCore.Mvc;
77
using Swashbuckle.AspNetCore.Annotations;
8+
using System.Collections.Generic;
9+
using System.Linq;
10+
using System.Threading;
11+
using System.Threading.Tasks;
812

913
namespace DEPLOY.Cachorro.Api.Controllers.v1
1014
{
@@ -82,19 +86,21 @@ public async Task<IActionResult> CreateAsync(
8286
CancellationToken cancellationToken = default)
8387
{
8488
var item = await _tutorAppServices.InsertAsync(
85-
tutorDto,
89+
tutorDto,
8690
cancellationToken);
8791

8892
if (item.Erros.Any())
8993
return UnprocessableEntity(item.Erros);
9094

9195
return CreatedAtAction("GetById",
92-
new {
96+
new
97+
{
9398
id = item.Id,
9499
version = new ApiVersion(
95100
1,
96101
0)
97-
.ToString() },
102+
.ToString()
103+
},
98104
item);
99105
}
100106

@@ -119,11 +125,11 @@ public async Task<IActionResult> UpdateAsync(
119125

120126
var retorned = await _tutorAppServices.UpdateAsync(
121127
id,
122-
tutorDto,
128+
tutorDto,
123129
cancellationToken);
124130

125-
return !retorned.Any() ? NoContent()
126-
: UnprocessableEntity(retorned);
131+
return !retorned.Any() ? NoContent()
132+
: UnprocessableEntity(retorned);
127133
}
128134

129135
[HttpDelete("{id:long}")]

src/DEPLOY.Cachorro.Api/DEPLOY.Cachorro.Api.csproj

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
<NoWarn>$(NoWarn);1591</NoWarn>
77
<NoWarn>$(NoWarn);8604</NoWarn>
88
<NoWarn>$(NoWarn);8603</NoWarn>
9-
<ImplicitUsings>enable</ImplicitUsings>
10-
<UserSecretsId>CachorroAPI_Local</UserSecretsId>
11-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
9+
<NoWarn>$(NoWarn);8602</NoWarn>
10+
<UserSecretsId>CachorroAPI_MVP</UserSecretsId>
11+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1212
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
13-
<ApplicationInsightsResourceId>/subscriptions/f4574f09-7fab-45bd-8eb5-508b8c6aa04a/resourceGroups/rg-canaldeploy-dev/providers/microsoft.insights/components/appi-cachorroapi-dev</ApplicationInsightsResourceId>
1413
<Version>2.3.0</Version>
1514
</PropertyGroup>
1615

src/DEPLOY.Cachorro.Api/Extensions/AppConfiguration/AppConfigurationExtension.cs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
using DEPLOY.Cachorro.Api.Extensions.AppConfiguration.Configs;
2+
using Microsoft.Extensions.Configuration;
23
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
4+
using Microsoft.Extensions.DependencyInjection;
35
using Microsoft.FeatureManagement;
6+
using System;
47
using System.Diagnostics.CodeAnalysis;
58

69
namespace DEPLOY.Cachorro.Api.Extensions.AppConfiguration

src/DEPLOY.Cachorro.Api/Extensions/Auth/AuthExtension.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Azure.Identity;
22
using Microsoft.AspNetCore.Authentication.JwtBearer;
33
using Microsoft.Extensions.Azure;
4+
using Microsoft.Extensions.Configuration;
5+
using Microsoft.Extensions.DependencyInjection;
46
using Microsoft.Identity.Web;
57
using System.Diagnostics.CodeAnalysis;
68

src/DEPLOY.Cachorro.Api/Extensions/Database/DatabaseExtension.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
using DEPLOY.Cachorro.Infra.Repository;
22
using Microsoft.EntityFrameworkCore;
3-
using Microsoft.EntityFrameworkCore.Diagnostics;
3+
using Microsoft.Extensions.Configuration;
4+
using Microsoft.Extensions.DependencyInjection;
5+
using Microsoft.Extensions.Logging;
6+
using System;
47
using System.Diagnostics.CodeAnalysis;
58

69
namespace DEPLOY.Cachorro.Api.Extensions.Database

src/DEPLOY.Cachorro.Api/Extensions/KeyVault/KeyVaultExtension.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using Azure.Identity;
22
using Microsoft.Extensions.Azure;
3+
using Microsoft.Extensions.Configuration;
4+
using Microsoft.Extensions.DependencyInjection;
35
using System.Diagnostics.CodeAnalysis;
46

57
namespace DEPLOY.Cachorro.Api.Extensions.KeyVault

src/DEPLOY.Cachorro.Api/Extensions/Swagger/ConfigureSwaggerOptions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using Asp.Versioning;
22
using Asp.Versioning.ApiExplorer;
33
using Microsoft.AspNetCore.Authentication.JwtBearer;
4+
using Microsoft.Extensions.DependencyInjection;
45
using Microsoft.Extensions.Options;
56
using Microsoft.OpenApi.Models;
67
using Swashbuckle.AspNetCore.SwaggerGen;
8+
using System;
79
using System.Diagnostics.CodeAnalysis;
810
using System.Reflection;
911
using System.Text;

src/DEPLOY.Cachorro.Api/Extensions/Swagger/SwaggerDefaultValues.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
using Microsoft.AspNetCore.Mvc.ModelBinding;
33
using Microsoft.OpenApi.Models;
44
using Swashbuckle.AspNetCore.SwaggerGen;
5+
using System;
56
using System.Diagnostics.CodeAnalysis;
7+
using System.Linq;
68
using System.Text.Json;
79

810
namespace DEPLOY.Cachorro.Api.Extensions.Swagger

src/DEPLOY.Cachorro.Api/Extensions/Swagger/SwaggerExtension.cs

+5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Builder;
3+
using Microsoft.Extensions.DependencyInjection;
24
using Microsoft.Extensions.Options;
35
using Swashbuckle.AspNetCore.SwaggerGen;
6+
using System;
47
using System.Diagnostics.CodeAnalysis;
8+
using System.IO;
9+
using System.Linq;
510

611
namespace DEPLOY.Cachorro.Api.Extensions.Swagger
712
{

src/DEPLOY.Cachorro.Api/Extensions/Telemetria/AppInsightsExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using Microsoft.ApplicationInsights.DependencyCollector;
22
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse;
3+
using Microsoft.Extensions.Configuration;
4+
using Microsoft.Extensions.DependencyInjection;
35
using System.Diagnostics.CodeAnalysis;
46

57
namespace DEPLOY.Cachorro.Api.Extensions.Telemetria

src/DEPLOY.Cachorro.Api/Extensions/Telemetria/LoggingExtensions.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using System.Diagnostics.CodeAnalysis;
1+
using Microsoft.Extensions.Configuration;
2+
using Microsoft.Extensions.Logging;
3+
using System.Diagnostics.CodeAnalysis;
24

35
namespace DEPLOY.Cachorro.Api.Extensions.Telemetria
46
{

src/DEPLOY.Cachorro.Api/Program.cs

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
using System.Diagnostics.CodeAnalysis;
88
using System.Text.Json.Serialization;
99
using DEPLOY.Cachorro.Infra.CrossCutting;
10+
using System.Threading.Tasks;
11+
using Microsoft.AspNetCore.Builder;
12+
using Microsoft.Extensions.DependencyInjection;
1013
namespace DEPLOY.Cachorro.Api
1114
{
1215
[ExcludeFromCodeCoverage]

src/DEPLOY.Cachorro.MinimalApi/DEPLOY.Cachorro.MinimalApi.csproj

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
<NoWarn>$(NoWarn);8604</NoWarn>
88
<NoWarn>$(NoWarn);8603</NoWarn>
99
<NoWarn>$(NoWarn);8602</NoWarn>
10-
<ImplicitUsings>enable</ImplicitUsings>
11-
<UserSecretsId>CachorroAPI_Local</UserSecretsId>
10+
<UserSecretsId>CachorroAPI_MVP</UserSecretsId>
1211
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1312
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
14-
<ApplicationInsightsResourceId>/subscriptions/f4574f09-7fab-45bd-8eb5-508b8c6aa04a/resourceGroups/rg-canaldeploy-dev/providers/microsoft.insights/components/appi-cachorroapi-dev</ApplicationInsightsResourceId>
15-
<Version>1.1.0-MinimalApi</Version>
13+
<Version>1.3.0-MinimalApi</Version>
1614
</PropertyGroup>
1715

1816
<ItemGroup>

src/DEPLOY.Cachorro.MinimalApi/Endpoints/TestResourcesEndpoints.cs

+14-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@
22
using Azure.Core;
33
using Azure.Identity;
44
using Azure.Security.KeyVault.Secrets;
5+
using DEPLOY.Cachorro.Application.Dtos;
56
using DEPLOY.Cachorro.MinimalApi.Configs;
7+
using Microsoft.AspNetCore.Builder;
8+
using Microsoft.AspNetCore.Http;
9+
using Microsoft.AspNetCore.Http.HttpResults;
10+
using Microsoft.AspNetCore.Mvc;
11+
using Microsoft.AspNetCore.Routing;
12+
using Microsoft.Extensions.Configuration;
613
using Microsoft.Extensions.Options;
714
using Microsoft.FeatureManagement;
815
using Microsoft.OpenApi.Models;
16+
using System;
17+
using System.Collections.Generic;
18+
using System.Threading;
19+
using System.Threading.Tasks;
920

1021
namespace DEPLOY.Cachorro.MinimalApi.Endpoints
1122
{
@@ -30,7 +41,7 @@ public static void MapTestResourcesEndpoints(this IEndpointRouteBuilder app)
3041
IConfiguration configuration,
3142
CancellationToken cancellationToken) =>
3243
{
33-
async Task<IResult> GetAsync(
44+
async Task<IResult> GetKeyAsync(
3445
string key)
3546
{
3647
SecretClientOptions options = new SecretClientOptions()
@@ -56,7 +67,7 @@ async Task<IResult> GetAsync(
5667
return TypedResults.Ok(secretValue);
5768
}
5869

59-
return await GetAsync(key);
70+
return await GetKeyAsync(key);
6071
})
6172
.WithOpenApi(operation => new(operation)
6273
{
@@ -99,7 +110,7 @@ string key
99110
IOptions<Settings> settings,
100111
CancellationToken cancellationToken) =>
101112
{
102-
async Task<IResult> GetAsync()
113+
async Task<Ok<string>> GetAsync()
103114
{
104115
return TypedResults.Ok(settings.Value.ValorDaMensagem);
105116
}

src/DEPLOY.Cachorro.MinimalApi/Endpoints/v1/AdocoesEndpoints.cs

+8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
using Asp.Versioning;
22
using DEPLOY.Cachorro.Application.Interfaces.Services;
3+
using Microsoft.AspNetCore.Builder;
4+
using Microsoft.AspNetCore.Http;
5+
using Microsoft.AspNetCore.Routing;
36
using Microsoft.OpenApi.Models;
7+
using System;
8+
using System.Collections.Generic;
49
using System.Diagnostics.CodeAnalysis;
10+
using System.Linq;
11+
using System.Threading;
12+
using System.Threading.Tasks;
513

614
namespace DEPLOY.Cachorro.MinimalApi.Endpoints.v1
715
{

src/DEPLOY.Cachorro.MinimalApi/Endpoints/v1/CachorroEndpoints.cs

+8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
using Asp.Versioning;
22
using DEPLOY.Cachorro.Application.Dtos;
33
using DEPLOY.Cachorro.Application.Interfaces.Services;
4+
using Microsoft.AspNetCore.Builder;
5+
using Microsoft.AspNetCore.Http;
46
using Microsoft.AspNetCore.Http.HttpResults;
7+
using Microsoft.AspNetCore.Routing;
58
using Microsoft.OpenApi.Models;
9+
using System;
10+
using System.Collections.Generic;
611
using System.Diagnostics.CodeAnalysis;
12+
using System.Linq;
13+
using System.Threading;
14+
using System.Threading.Tasks;
715

816
namespace DEPLOY.Cachorro.MinimalApi.Endpoints.v1
917
{

src/DEPLOY.Cachorro.MinimalApi/Endpoints/v1/TutorEndpoints.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
using Asp.Versioning;
22
using DEPLOY.Cachorro.Application.Dtos;
33
using DEPLOY.Cachorro.Application.Interfaces.Services;
4+
using Microsoft.AspNetCore.Builder;
5+
using Microsoft.AspNetCore.Http;
46
using Microsoft.AspNetCore.Mvc;
7+
using Microsoft.AspNetCore.Routing;
58
using Microsoft.OpenApi.Models;
9+
using System;
10+
using System.Collections.Generic;
611
using System.Diagnostics.CodeAnalysis;
12+
using System.Linq;
13+
using System.Threading;
14+
using System.Threading.Tasks;
715

816
namespace DEPLOY.Cachorro.MinimalApi.Endpoints.v1
917
{
@@ -113,7 +121,7 @@ async Task<IResult> CreateTutorAsync()
113121
Description = "Operação para cadastrar tutor",
114122
Tags = new List<OpenApiTag> { new() { Name = "Tutores" } }
115123
});
116-
124+
117125
tutores.MapPut("/{id:long}", async (
118126
long id,
119127
TutorDto tutorDto,

0 commit comments

Comments
 (0)