restructured client to provide one namespace per functionality

This commit is contained in:
Philipp Häfelfinger 2022-10-27 22:39:23 +02:00
parent 9470bb6686
commit af5d269e10
47 changed files with 60 additions and 56 deletions

View File

@ -1,4 +1,8 @@
using Autofac; using Autofac;
using Piwigo.Client.Albums;
using Piwigo.Client.Images;
using Piwigo.Client.Session;
using Piwigo.Client.Tags;
namespace Piwigo.Client.Autofac; namespace Piwigo.Client.Autofac;

View File

@ -1,5 +1,5 @@
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Piwigo.Client.Contract; using Piwigo.Client.Albums;
namespace Piwigo.Client.Tests; namespace Piwigo.Client.Tests;

View File

@ -4,7 +4,6 @@ using Flurl.Http.Content;
using Flurl.Http.Testing; using Flurl.Http.Testing;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Newtonsoft.Json; using Newtonsoft.Json;
using Piwigo.Client.Contract;
namespace Piwigo.Client.Tests; namespace Piwigo.Client.Tests;

View File

@ -1,6 +1,6 @@
using System.Text; using System.Text;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Piwigo.Client.Contract; using Piwigo.Client.Images;
namespace Piwigo.Client.Tests; namespace Piwigo.Client.Tests;

View File

@ -1,5 +1,5 @@
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Piwigo.Client.Contract; using Piwigo.Client.Session;
namespace Piwigo.Client.Tests; namespace Piwigo.Client.Tests;

View File

@ -1,7 +1,7 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Albums;
[SuppressMessage("ReSharper", "StringLiteralTypo")] [SuppressMessage("ReSharper", "StringLiteralTypo")]
public record Album public record Album

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Albums;
internal record AlbumAdded internal record AlbumAdded
{ {

View File

@ -1,8 +1,7 @@
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Piwigo.Client.Contract;
namespace Piwigo.Client; namespace Piwigo.Client.Albums;
public class AlbumApi : IAlbumApi public class AlbumApi : IAlbumApi
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Albums;
internal record AlbumList internal record AlbumList
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Albums;
public record AlbumOrphans public record AlbumOrphans
{ {

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Albums;
public enum AlbumPosition public enum AlbumPosition
{ {

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Albums;
public enum AlbumStatus public enum AlbumStatus
{ {

View File

@ -1,6 +1,4 @@
using Piwigo.Client.Contract; namespace Piwigo.Client.Albums;
namespace Piwigo.Client;
public interface IAlbumApi public interface IAlbumApi
{ {

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Albums;
public enum ThumbnailSize public enum ThumbnailSize
{ {

View File

@ -1,4 +1,9 @@
namespace Piwigo.Client; using Piwigo.Client.Albums;
using Piwigo.Client.Images;
using Piwigo.Client.Session;
using Piwigo.Client.Tags;
namespace Piwigo.Client;
public interface IPiwigoClient public interface IPiwigoClient
{ {

View File

@ -1,5 +1,4 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Piwigo.Client.Contract;
namespace Piwigo.Client; namespace Piwigo.Client;

View File

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

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record CheckFilesResult public record CheckFilesResult
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
internal record CheckUpload internal record CheckUpload
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record Comment public record Comment
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
internal record CommentAdded internal record CommentAdded
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record CommentPagingInfo([property: JsonProperty("page")] int Page, [property: JsonProperty("per_page")] int PageSize, [property: JsonProperty("count")] int Count, public record CommentPagingInfo([property: JsonProperty("page")] int Page, [property: JsonProperty("per_page")] int PageSize, [property: JsonProperty("count")] int Count,
[property: JsonProperty("total_count")] [property: JsonProperty("total_count")]

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record CommentPost public record CommentPost
{ {

View File

@ -1,6 +1,6 @@
using Piwigo.Client.Contract; using Piwigo.Client.Session;
namespace Piwigo.Client; namespace Piwigo.Client.Images;
public interface IImageApi public interface IImageApi
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record Image public record Image
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record ImageAlbum public record ImageAlbum
{ {

View File

@ -1,8 +1,7 @@
using System.Globalization; using System.Globalization;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Piwigo.Client.Contract;
namespace Piwigo.Client; namespace Piwigo.Client.Images;
public class ImageApi : IImageApi public class ImageApi : IImageApi
{ {

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public enum ImageCheckStatus public enum ImageCheckStatus
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record ImageDerivative public record ImageDerivative
{ {

View File

@ -1,6 +1,6 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public record ImageFilter public record ImageFilter

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record ImageInfo public record ImageInfo
{ {

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public enum ImageOrder public enum ImageOrder
{ {

View File

@ -1,5 +1,5 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record ImagePagingInfo([property: JsonProperty("page")] int Page, [property: JsonProperty("per_page")] int PageSize, [property: JsonProperty("count")] int TotalItems); public record ImagePagingInfo([property: JsonProperty("page")] int Page, [property: JsonProperty("per_page")] int PageSize, [property: JsonProperty("count")] int TotalItems);

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record ImageRating public record ImageRating
{ {

View File

@ -1,3 +1,3 @@
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record ImageUpload(string OriginalSum) : ImageInfo; public record ImageUpload(string OriginalSum) : ImageInfo;

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record ImageUploaded public record ImageUploaded
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record OrphanImagesDeleted public record OrphanImagesDeleted
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public record PagedImages public record PagedImages
{ {

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Images;
public enum ValueUpdateMode public enum ValueUpdateMode
{ {

View File

@ -1,3 +1,8 @@
using Piwigo.Client.Albums;
using Piwigo.Client.Images;
using Piwigo.Client.Session;
using Piwigo.Client.Tags;
namespace Piwigo.Client; namespace Piwigo.Client;
public class PiwigoClient : IPiwigoClient public class PiwigoClient : IPiwigoClient

View File

@ -2,7 +2,6 @@ using System.Net;
using Flurl.Http; using Flurl.Http;
using Flurl.Http.Content; using Flurl.Http.Content;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Piwigo.Client.Contract;
namespace Piwigo.Client; namespace Piwigo.Client;

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client;
public record PiwigoResponse public record PiwigoResponse
{ {

View File

@ -1,6 +1,4 @@
using Piwigo.Client.Contract; namespace Piwigo.Client.Session;
namespace Piwigo.Client;
public interface ISessionApi public interface ISessionApi
{ {

View File

@ -1,7 +1,6 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Piwigo.Client.Contract;
namespace Piwigo.Client; namespace Piwigo.Client.Session;
public class SessionApi : ISessionApi public class SessionApi : ISessionApi
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Piwigo.Client.Contract; namespace Piwigo.Client.Session;
public record SessionStatus public record SessionStatus
{ {

View File

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

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client; namespace Piwigo.Client.Tags;
public class TagApi : ITagApi public class TagApi : ITagApi
{ {