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 Piwigo.Client.Albums;
using Piwigo.Client.Images;
using Piwigo.Client.Session;
using Piwigo.Client.Tags;
namespace Piwigo.Client.Autofac;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client.Contract;
namespace Piwigo.Client.Albums;
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
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
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,
[property: JsonProperty("total_count")]

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json;
namespace Piwigo.Client.Contract;
namespace Piwigo.Client.Images;
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
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
namespace Piwigo.Client.Contract;
namespace Piwigo.Client.Images;
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;
public class PiwigoClient : IPiwigoClient

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json;
namespace Piwigo.Client.Contract;
namespace Piwigo.Client.Session;
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
{