Merge pull request 'Modification' (#7) from BranchTest into main
continuous-integration/drone/push Build is failing Details

Reviewed-on: #7
pull/12/head
Victor Perez NGOUNOU 2 years ago
commit 2967fff3f5

@ -0,0 +1,28 @@
{
"Routes": [
{
"DownstreamPathTemplate": "/api/joueur",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5001
}
],
"UpstreamPathTemplate": "/rest/joueur",
"UpstreamHttpMethod": [ "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/graphql",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5002
}
],
"UpstreamPathTemplate": "/graphql",
"UpstreamHttpMethod": [ "get" ]
}
]
}

@ -27,6 +27,15 @@
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
}, },
"RestFull": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:5001",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
"launchBrowser": true, "launchBrowser": true,

@ -0,0 +1,13 @@
using DTOs;
namespace GraphQL_Project.Data;
public class JoueurAddedPayload
{
public JoueurDTO Joueur { get; }
public JoueurAddedPayload(JoueurDTO joueur)
{
Joueur = joueur ?? throw new ArgumentNullException(nameof(joueur));
}
}

@ -0,0 +1,18 @@
using BowlingService.Interfaces;
using DTOs;
using GraphQL_Project.Record;
namespace GraphQL_Project.Data;
public class Mutation
{
public async Task<JoueurAddedPayload> AddjoueurAsync(AddJoueurInput input, [Service] IJoueurService joueurService)
{
JoueurDTO joueurDto = new JoueurDTO
{
Pseudo = input.Pseudo
};
var result = await joueurService.Add(joueurDto);
return new JoueurAddedPayload(result);
}
}

@ -3,6 +3,7 @@ using BowlingRepository.Interface;
using BowlingService; using BowlingService;
using BowlingService.Interfaces; using BowlingService.Interfaces;
using GraphQL_Project; using GraphQL_Project;
using GraphQL_Project.Data;
using Mapper; using Mapper;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@ -10,11 +11,14 @@ var builder = WebApplication.CreateBuilder(args);
// Add services to the container. // Add services to the container.
builder.Services.AddRazorPages(); builder.Services.AddRazorPages();
builder.Services.AddGraphQLServer() builder.Services.AddGraphQLServer()
.AddQueryType<Query>(); .AddQueryType<Query>()
.AddMutationType<Mutation>();
builder.Services.AddAutoMapper(typeof(JoueurProfile)); builder.Services.AddAutoMapper(typeof(JoueurProfile));
builder.Services.AddScoped<IJoueurService, JoueurService>(); builder.Services.AddScoped<IJoueurService, JoueurService>();
builder.Services.AddScoped<IJoueurRepository, JoueurRepository>(); builder.Services.AddScoped<IJoueurRepository, JoueurRepository>();
var app = builder.Build(); var app = builder.Build();
// Configure the HTTP request pipeline. // Configure the HTTP request pipeline.

@ -16,6 +16,15 @@
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
}, },
"GraphQL": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:5002",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
"launchBrowser": true, "launchBrowser": true,

@ -0,0 +1,3 @@
namespace GraphQL_Project.Record;
public record AddJoueurInput(string Pseudo);

@ -37,6 +37,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BowlingAPITest", "Tests\Bow
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphQL Project", "GraphQL Project\GraphQL Project.csproj", "{F8016AE7-A927-4E68-A7CF-303AB3B8C2C3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphQL Project", "GraphQL Project\GraphQL Project.csproj", "{F8016AE7-A927-4E68-A7CF-303AB3B8C2C3}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API Gateway", "API Gateway\API Gateway.csproj", "{20E9E8DF-B3CA-4F4C-9B16-5E880158C43C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiBowlingGateway", "ApiBowlingGateway\ApiBowlingGateway.csproj", "{C3274794-8D2A-4695-B8B5-7B0B7B65C917}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -87,6 +91,14 @@ Global
{F8016AE7-A927-4E68-A7CF-303AB3B8C2C3}.Debug|Any CPU.Build.0 = Debug|Any CPU {F8016AE7-A927-4E68-A7CF-303AB3B8C2C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8016AE7-A927-4E68-A7CF-303AB3B8C2C3}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8016AE7-A927-4E68-A7CF-303AB3B8C2C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8016AE7-A927-4E68-A7CF-303AB3B8C2C3}.Release|Any CPU.Build.0 = Release|Any CPU {F8016AE7-A927-4E68-A7CF-303AB3B8C2C3}.Release|Any CPU.Build.0 = Release|Any CPU
{20E9E8DF-B3CA-4F4C-9B16-5E880158C43C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20E9E8DF-B3CA-4F4C-9B16-5E880158C43C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20E9E8DF-B3CA-4F4C-9B16-5E880158C43C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20E9E8DF-B3CA-4F4C-9B16-5E880158C43C}.Release|Any CPU.Build.0 = Release|Any CPU
{C3274794-8D2A-4695-B8B5-7B0B7B65C917}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3274794-8D2A-4695-B8B5-7B0B7B65C917}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3274794-8D2A-4695-B8B5-7B0B7B65C917}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3274794-8D2A-4695-B8B5-7B0B7B65C917}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

Loading…
Cancel
Save