Implemented DLSiteClient.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using JSMR.Application.Integrations.Ports;
|
||||
using JSMR.Infrastructure.Integrations.DLSite.Serialization;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace JSMR.Infrastructure.Integrations.DLSite;
|
||||
|
||||
public static class DLSiteClientRegistration
|
||||
{
|
||||
//public static IServiceCollection AddDLSiteClient(this IServiceCollection services, Uri baseAddress)
|
||||
//{
|
||||
// // Build per-client JSON options with the DLSite-specific converters
|
||||
// var json = DLSiteJsonContext.CreateOptions();
|
||||
|
||||
// services.AddHttpClient<IDLSiteClient, DLSiteClient>(client =>
|
||||
// {
|
||||
// client.BaseAddress = baseAddress; // e.g., new Uri("https://www.dlsite.com/")
|
||||
// client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
||||
// client.Timeout = TimeSpan.FromSeconds(20);
|
||||
// })
|
||||
// .AddPolicyHandler(ResiliencePolicies.DefaultRetry()); // optional Polly
|
||||
|
||||
// // Provide the options to the client via DI
|
||||
// services.AddSingleton(json);
|
||||
|
||||
// return services;
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user