Skip to content

Commit

Permalink
Merge pull request #70 from PinguApps/65-internals-made-internal
Browse files Browse the repository at this point in the history
Made internal interfaces internal rather than public
  • Loading branch information
pingu2k4 authored Jul 13, 2024
2 parents 46919e4 + 6ce025b commit fff9ed9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/PinguApps.Appwrite.Client/Clients/AccountClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using PinguApps.Appwrite.Client.Clients;
using PinguApps.Appwrite.Client.Internals;
using PinguApps.Appwrite.Client.Utils;
Expand All @@ -14,9 +15,9 @@ public class AccountClient : IAccountClient, ISessionAware
{
private readonly IAccountApi _accountApi;

public AccountClient(IAccountApi accountApi)
public AccountClient(IServiceProvider services)
{
_accountApi = accountApi;
_accountApi = services.GetRequiredService<IAccountApi>();
}

string? ISessionAware.Session { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace PinguApps.Appwrite.Client.Internals;

public interface IAccountApi : IBaseApi
internal interface IAccountApi : IBaseApi
{
[Get("/account")]
Task<IApiResponse<User>> GetAccount([Header("x-appwrite-session")] string? session);
Expand Down
2 changes: 1 addition & 1 deletion src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace PinguApps.Appwrite.Client.Internals;
"x-sdk-language: dotnet",
"x-sdk-version: 0.0.1",
"X-Appwrite-Response-Format: 1.5.0")]
public interface IBaseApi
internal interface IBaseApi
{
}
2 changes: 1 addition & 1 deletion src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Refit;

namespace PinguApps.Appwrite.Server.Internals;
public interface IAccountApi : IBaseApi
internal interface IAccountApi : IBaseApi
{
[Post("/account")]
Task<IApiResponse<User>> CreateAccount(CreateAccountRequest request);
Expand Down
2 changes: 1 addition & 1 deletion src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace PinguApps.Appwrite.Server.Internals;
"x-sdk-language: dotnet",
"x-sdk-version: 0.0.1",
"X-Appwrite-Response-Format: 1.5.0")]
public interface IBaseApi
internal interface IBaseApi
{
}
5 changes: 3 additions & 2 deletions src/PinguApps.Appwrite.Server/Servers/AccountServer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using PinguApps.Appwrite.Server.Internals;
using PinguApps.Appwrite.Server.Utils;
using PinguApps.Appwrite.Shared;
Expand All @@ -11,9 +12,9 @@ public class AccountServer : IAccountServer
{
private readonly IAccountApi _accountApi;

public AccountServer(IAccountApi accountApi)
public AccountServer(IServiceProvider services)
{
_accountApi = accountApi;
_accountApi = services.GetRequiredService<IAccountApi>();
}

public async Task<AppwriteResult<User>> Create(CreateAccountRequest request)
Expand Down

0 comments on commit fff9ed9

Please sign in to comment.