mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
re-org some interfaces
This commit is contained in:
parent
320d3f6a22
commit
5943b697c2
20 changed files with 54 additions and 36 deletions
|
|
@ -0,0 +1,15 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Octokit;
|
||||
|
||||
namespace FilterLists.Agent.Core.Interfaces.Clients
|
||||
{
|
||||
public interface IAgentGitHubClient
|
||||
{
|
||||
Task<IReadOnlyList<Issue>> GetAllIssues(RepositoryIssueRequest repositoryIssueRequest);
|
||||
|
||||
Task<Issue> CreateIssue(NewIssue newIssue);
|
||||
|
||||
Task<Issue> UpdateIssue(int issueNumber, IssueUpdate issueUpdate);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using System.Net.Http;
|
||||
|
||||
namespace FilterLists.Agent.Core.Interfaces.Clients
|
||||
{
|
||||
public interface IAgentHttpClient
|
||||
{
|
||||
HttpClient HttpClient { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Threading.Tasks;
|
||||
using RestSharp;
|
||||
|
||||
namespace FilterLists.Agent.Core.Interfaces.Clients
|
||||
{
|
||||
public interface IFilterListsApiClient
|
||||
{
|
||||
Task<TResponse> ExecuteAsync<TResponse>(IRestRequest request);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Entities;
|
||||
|
||||
namespace FilterLists.Agent.Core.Interfaces
|
||||
namespace FilterLists.Agent.Core.Interfaces.Repositories
|
||||
{
|
||||
public interface IListInfoRepository
|
||||
{
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FilterLists.Agent.Core.Interfaces
|
||||
namespace FilterLists.Agent.Core.Interfaces.Repositories
|
||||
{
|
||||
public interface IUrlRepository
|
||||
{
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FilterLists.Agent.Extensions
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
using System.Net.Http;
|
||||
using CommandLine;
|
||||
using FilterLists.Agent.AppSettings;
|
||||
using FilterLists.Agent.Core.Interfaces;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using FilterLists.Agent.Core.Interfaces.Repositories;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using FilterLists.Agent.Infrastructure.Repositories;
|
||||
using LibGit2Sharp;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Interfaces;
|
||||
using FilterLists.Agent.Core.Interfaces.Repositories;
|
||||
using MediatR;
|
||||
|
||||
namespace FilterLists.Agent.Features.Lists
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Entities;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using FilterLists.Agent.Extensions;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Entities;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SharpCompress.Archives;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Entities;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SharpCompress.Common;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using FilterLists.Agent.Extensions;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using MediatR;
|
||||
using Octokit;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using FilterLists.Agent.Extensions;
|
||||
using FilterLists.Agent.Features.Urls.Models.ValidationResults;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using MediatR;
|
||||
using Octokit;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Interfaces;
|
||||
using FilterLists.Agent.Core.Interfaces.Repositories;
|
||||
using FilterLists.Agent.Features.Urls.Models.DataFileUrls;
|
||||
using FilterLists.Agent.Features.Urls.Models.ValidationResults;
|
||||
using MediatR;
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks.Dataflow;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using FilterLists.Agent.Extensions;
|
||||
using FilterLists.Agent.Features.Urls.Models.ValidationResults;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.AppSettings;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
|
@ -8,15 +9,6 @@
|
|||
|
||||
namespace FilterLists.Agent.Infrastructure.Clients
|
||||
{
|
||||
public interface IAgentGitHubClient
|
||||
{
|
||||
Task<IReadOnlyList<Issue>> GetAllIssues(RepositoryIssueRequest repositoryIssueRequest);
|
||||
|
||||
Task<Issue> CreateIssue(NewIssue newIssue);
|
||||
|
||||
Task<Issue> UpdateIssue(int issueNumber, IssueUpdate issueUpdate);
|
||||
}
|
||||
|
||||
public class AgentGitHubClient : IAgentGitHubClient
|
||||
{
|
||||
private readonly IGitHubClient _gitHubClient;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Agent.Infrastructure.Clients
|
||||
{
|
||||
public interface IAgentHttpClient
|
||||
{
|
||||
HttpClient HttpClient { get; }
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
public class AgentHttpClient : IAgentHttpClient
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RestSharp;
|
||||
|
||||
namespace FilterLists.Agent.Infrastructure.Clients
|
||||
{
|
||||
public interface IFilterListsApiClient
|
||||
{
|
||||
Task<TResponse> ExecuteAsync<TResponse>(IRestRequest request);
|
||||
}
|
||||
|
||||
public class FilterListsApiClient : IFilterListsApiClient
|
||||
{
|
||||
private const string FilterListsApiBaseUrl = "https://filterlists.com/api/v1";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Entities;
|
||||
using FilterLists.Agent.Core.Interfaces;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using FilterLists.Agent.Core.Interfaces.Repositories;
|
||||
using RestSharp;
|
||||
|
||||
namespace FilterLists.Agent.Infrastructure.Repositories
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Core.Interfaces;
|
||||
using FilterLists.Agent.Core.Interfaces.Clients;
|
||||
using FilterLists.Agent.Core.Interfaces.Repositories;
|
||||
using FilterLists.Agent.Features.Urls.Models.DataFileUrls;
|
||||
using FilterLists.Agent.Infrastructure.Clients;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RestSharp;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue