From 4fd855f01d6c624b3551ae9860a3ac71e20d7529 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Tue, 28 Feb 2023 12:50:14 +0100 Subject: [PATCH] Externds the api endpoint interfaces by id and uuid qeuries --- src/Client/Endpoints/CardEndpoint.cs | 10 ++++++++++ src/Client/Endpoints/IApiEndpoint.cs | 4 ++++ src/Client/Endpoints/SetEndpoint.cs | 13 +++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/Client/Endpoints/CardEndpoint.cs b/src/Client/Endpoints/CardEndpoint.cs index 41ec19c..7d58460 100644 --- a/src/Client/Endpoints/CardEndpoint.cs +++ b/src/Client/Endpoints/CardEndpoint.cs @@ -6,4 +6,14 @@ internal class CardEndpoint : IApiEndpoint { return "card"; } + + string IApiEndpoint.IdQuery(int id) + { + return $"{((IApiEndpoint)this).ApiUri()}/id={id}"; + } + + string IApiEndpoint.UuidQuery(int uuid) + { + return $"{((IApiEndpoint)this).ApiUri()}/uuid={uuid}"; + } } \ No newline at end of file diff --git a/src/Client/Endpoints/IApiEndpoint.cs b/src/Client/Endpoints/IApiEndpoint.cs index 2d5945a..8f4dae0 100644 --- a/src/Client/Endpoints/IApiEndpoint.cs +++ b/src/Client/Endpoints/IApiEndpoint.cs @@ -3,4 +3,8 @@ public interface IApiEndpoint { string ApiUri(); + + string IdQuery(int id); + + string UuidQuery(int uuid); } \ No newline at end of file diff --git a/src/Client/Endpoints/SetEndpoint.cs b/src/Client/Endpoints/SetEndpoint.cs index 130c939..ee34379 100644 --- a/src/Client/Endpoints/SetEndpoint.cs +++ b/src/Client/Endpoints/SetEndpoint.cs @@ -4,6 +4,15 @@ internal class SetEndpoint : IApiEndpoint { string IApiEndpoint.ApiUri() { - return "card"; + return "set"; } -} \ No newline at end of file + + string IApiEndpoint.IdQuery(int id) + { + return $"{((IApiEndpoint)this).ApiUri()}/{id}"; + } + + string IApiEndpoint.UuidQuery(int uuid) + { + return $"{((IApiEndpoint)this).ApiUri()}/uuid/{uuid}"; + } \ No newline at end of file