Merge pull request 'Modification' (#7) from BranchTest into main
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Reviewed-on: #7pull/12/head
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" ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
namespace GraphQL_Project.Record;
|
||||||
|
|
||||||
|
public record AddJoueurInput(string Pseudo);
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue