adds interfaces to structure the piwigo api parts

This commit is contained in:
Philipp Häfelfinger 2022-10-15 00:23:49 +02:00
parent e5ba4c6e4a
commit cae3f94e39
7 changed files with 33 additions and 3 deletions

View File

@ -0,0 +1,3 @@
namespace Piwigo.Client;
public interface IGroupApi {}

View File

@ -0,0 +1,3 @@
namespace Piwigo.Client;
public interface IImageApi {}

View File

@ -0,0 +1,3 @@
namespace Piwigo.Client;
public interface IPermissionApi {}

View File

@ -2,6 +2,11 @@
public interface IPiwigoClient public interface IPiwigoClient
{ {
IGroupApi Group { get; }
IImageApi Image { get; }
IPermissionApi Permission { get; }
ITagApi Tag { get; }
IUserApi User { get; }
ISessionApi Session { get; } ISessionApi Session { get; }
ICategoryApi Category { get; } ICategoryApi Category { get; }
} }

View File

@ -0,0 +1,3 @@
namespace Piwigo.Client;
public interface ITagApi {}

View File

@ -0,0 +1,3 @@
namespace Piwigo.Client;
public interface IUserApi {}

View File

@ -2,12 +2,22 @@ namespace Piwigo.Client;
public class PiwigoClient : IPiwigoClient public class PiwigoClient : IPiwigoClient
{ {
public PiwigoClient(ISessionApi session, ICategoryApi category) public PiwigoClient(IGroupApi group, IImageApi image, IPermissionApi permission, ITagApi tag, IUserApi user, ISessionApi session, ICategoryApi category)
{ {
Session = session; Group = group ?? throw new ArgumentNullException(nameof(group));
Category = category; Image = image ?? throw new ArgumentNullException(nameof(image));
Permission = permission ?? throw new ArgumentNullException(nameof(permission));
Tag = tag ?? throw new ArgumentNullException(nameof(tag));
User = user ?? throw new ArgumentNullException(nameof(user));
Session = session ?? throw new ArgumentNullException(nameof(session));
Category = category ?? throw new ArgumentNullException(nameof(category));
} }
public IGroupApi Group { get; }
public IImageApi Image { get; }
public IPermissionApi Permission { get; }
public ITagApi Tag { get; }
public IUserApi User { get; }
public ISessionApi Session { get; } public ISessionApi Session { get; }
public ICategoryApi Category { get; } public ICategoryApi Category { get; }
} }