Externds the api endpoint interfaces by id and uuid qeuries

This commit is contained in:
Serraniel 2023-02-28 12:50:14 +01:00
parent e224723313
commit 4fd855f01d
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3
3 changed files with 25 additions and 2 deletions

View file

@ -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}";
}
}

View file

@ -3,4 +3,8 @@
public interface IApiEndpoint
{
string ApiUri();
string IdQuery(int id);
string UuidQuery(int uuid);
}

View file

@ -4,6 +4,15 @@ internal class SetEndpoint : IApiEndpoint
{
string IApiEndpoint.ApiUri()
{
return "card";
return "set";
}
}
string IApiEndpoint.IdQuery(int id)
{
return $"{((IApiEndpoint)this).ApiUri()}/{id}";
}
string IApiEndpoint.UuidQuery(int uuid)
{
return $"{((IApiEndpoint)this).ApiUri()}/uuid/{uuid}";
}