Skip to content

Commit

Permalink
Merge pull request #9 from IliyanIlievPH/8
Browse files Browse the repository at this point in the history
Closes #8
  • Loading branch information
thelittledevops authored May 11, 2020
2 parents 5b81f44 + 25af61d commit 30bf5a0
Show file tree
Hide file tree
Showing 29 changed files with 69 additions and 70 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using Autofac;
using JetBrains.Annotations;
using Lykke.HttpClientGenerator;
using Lykke.HttpClientGenerator.Infrastructure;
using System;

namespace Lykke.Service.SmsProviderInfobip.Client
namespace MAVN.Service.SmsProviderInfobip.Client
{
/// <summary>
/// Extension for client registration
Expand All @@ -30,7 +30,7 @@ public static void RegisterSmsProviderInfobipClient(
if (string.IsNullOrWhiteSpace(settings.ServiceUrl))
throw new ArgumentException("Value cannot be null or whitespace.", nameof(SmsProviderInfobipServiceClientSettings.ServiceUrl));

var clientBuilder = HttpClientGenerator.HttpClientGenerator.BuildForUrl(settings.ServiceUrl)
var clientBuilder = Lykke.HttpClientGenerator.HttpClientGenerator.BuildForUrl(settings.ServiceUrl)
.WithAdditionalCallsWrapper(new ExceptionHandlerCallsWrapper());

clientBuilder = builderConfigure?.Invoke(clientBuilder) ?? clientBuilder.WithoutRetries();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using JetBrains.Annotations;

namespace Lykke.Service.SmsProviderInfobip.Client
namespace MAVN.Service.SmsProviderInfobip.Client
{
/// <summary>
/// SmsProviderInfobip client API interface.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using JetBrains.Annotations;

namespace Lykke.Service.SmsProviderInfobip.Client
namespace MAVN.Service.SmsProviderInfobip.Client
{
/// <summary>
/// SmsProviderInfobip client interface.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<None Remove="Lykke.Service.SmsProviderInfobip.Client.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Falcon.Service.NotificationSystemBroker.SmsProviderClient" Version="1.0.1" />
<PackageReference Include="Lykke.HttpClientGenerator" Version="2.5.0" />
<PackageReference Include="Lykke.SettingsReader" Version="5.2.0" />
<PackageReference Include="Refit" Version="4.6.107" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Lykke.HttpClientGenerator;

namespace Lykke.Service.SmsProviderInfobip.Client
namespace MAVN.Service.SmsProviderInfobip.Client
{
/// <summary>
/// SmsProviderInfobip API aggregating interface.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Lykke.SettingsReader.Attributes;
using Lykke.SettingsReader.Attributes;

namespace Lykke.Service.SmsProviderInfobip.Client
namespace MAVN.Service.SmsProviderInfobip.Client
{
/// <summary>
/// SmsProviderInfobip client settings.
/// </summary>
public class SmsProviderInfobipServiceClientSettings
public class SmsProviderInfobipServiceClientSettings
{
/// <summary>Service url.</summary>
[HttpCheck("api/isalive")]
public string ServiceUrl {get; set;}
public string ServiceUrl { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Threading.Tasks;
using Lykke.Service.SmsProviderInfobip.InfobipClient.Models.Requests;
using Lykke.Service.SmsProviderInfobip.InfobipClient.Models.Responses;
using MAVN.Service.SmsProviderInfobip.InfobipClient.Models.Requests;
using MAVN.Service.SmsProviderInfobip.InfobipClient.Models.Responses;
using Refit;

namespace Lykke.Service.SmsProviderInfobip.InfobipClient
namespace MAVN.Service.SmsProviderInfobip.InfobipClient
{
/// <summary>
/// Interface that describes Infobip SMS client access
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Lykke.Service.SmsProviderInfobip.InfobipClient
namespace MAVN.Service.SmsProviderInfobip.InfobipClient
{
/// <summary>
/// Infobip API client
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using Lykke.HttpClientGenerator.Infrastructure;
using Lykke.HttpClientGenerator.Retries;
using Lykke.Service.SmsProviderInfobip.InfobipClient.Infrastructure;
using MAVN.Service.SmsProviderInfobip.InfobipClient.Infrastructure;

namespace Lykke.Service.SmsProviderInfobip.InfobipClient
namespace MAVN.Service.SmsProviderInfobip.InfobipClient
{
/// <summary>
/// Infobip API client
Expand Down Expand Up @@ -71,7 +69,7 @@ public InfobipClient(string serviceUrl, int timeoutMs, int retries, string infob

private void InitializeClient()
{
var clientBuilder = HttpClientGenerator.HttpClientGenerator.BuildForUrl(ServiceUrl)
var clientBuilder = Lykke.HttpClientGenerator.HttpClientGenerator.BuildForUrl(ServiceUrl)
.WithAdditionalCallsWrapper(new ExceptionHandlerCallsWrapper())
.WithoutRetries()
.WithAdditionalDelegatingHandler(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace Lykke.Service.SmsProviderInfobip.InfobipClient.Infrastructure
namespace MAVN.Service.SmsProviderInfobip.InfobipClient.Infrastructure
{
public class AuthorizationHeaderHttpClientHandler : DelegatingHandler
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Newtonsoft.Json;
using Newtonsoft.Json;

namespace Lykke.Service.SmsProviderInfobip.InfobipClient.Models.Requests
namespace MAVN.Service.SmsProviderInfobip.InfobipClient.Models.Requests
{
/// <summary>
/// Model used to send SMS
Expand All @@ -27,5 +27,4 @@ public class SendSmsRequestModel
[JsonProperty("text")]
public string Text { get; set; }
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Lykke.Service.SmsProviderInfobip.InfobipClient.Models.Responses
namespace MAVN.Service.SmsProviderInfobip.InfobipClient.Models.Responses
{
/// <summary>
/// Model that represents SMS response details
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Lykke.Service.SmsProviderInfobip.InfobipClient.Models.Responses
namespace MAVN.Service.SmsProviderInfobip.InfobipClient.Models.Responses
{
/// <summary>
/// Model that represents SMS response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Lykke.Service.SmsProviderInfobip.InfobipClient.Models.Responses
namespace MAVN.Service.SmsProviderInfobip.InfobipClient.Models.Responses
{
/// <summary>
/// Model that represents status response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Falcon.Service.NotificationSystem.Contract" Version="1.0.3" />
<PackageReference Include="Falcon.Service.NotificationSystemBroker.SmsProviderClient" Version="1.0.1" />
<PackageReference Include="Lykke.Common" Version="7.4.0" />
<PackageReference Include="MAVN.Service.NotificationSystem.Contract" Version="1.3.0" />
<PackageReference Include="MAVN.Service.NotificationSystemBroker.Contract" Version="1.1.1" />
<PackageReference Include="MAVN.Service.NotificationSystemBroker.SmsProviderClient" Version="1.1.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Lykke.Service.NotificationSystemBroker.SmsProviderClient;
using MAVN.Service.NotificationSystemBroker.SmsProviderClient;

namespace Lykke.Service.SmsProviderInfobip.Domain.Services
namespace MAVN.Service.SmsProviderInfobip.Domain.Services
{
public interface ISmsService : ISmsProvider
public interface ISmsService : ISmsProviderApi
{
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Falcon.Service.NotificationSystem.Contract" Version="1.0.3" />
<PackageReference Include="Lykke.RabbitMqBroker" Version="7.8.1" />
<PackageReference Include="MAVN.Service.NotificationSystem.Contract" Version="1.3.0" />
<PackageReference Include="MAVN.Service.NotificationSystemBroker.Contract" Version="1.1.1" />
<PackageReference Include="MAVN.Service.NotificationSystemBroker.SmsProviderClient" Version="1.1.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\client\MAVN.Service.SmsProviderInfobip.Client\MAVN.Service.SmsProviderInfobip.Client.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System;
using System;
using System.Linq;
using System.Threading.Tasks;
using Common.Log;
using Lykke.Common.Log;
using Lykke.Service.NotificationSystemBroker.SmsProviderClient;
using Lykke.Service.NotificationSystemBroker.SmsProviderClient.Enums;
using Lykke.Service.SmsProviderInfobip.Domain.Services;
using Lykke.Service.SmsProviderInfobip.InfobipClient;
using SendSmsRequestModel = Lykke.Service.SmsProviderInfobip.InfobipClient.Models.Requests.SendSmsRequestModel;
using MAVN.Service.NotificationSystemBroker.SmsProviderClient;
using MAVN.Service.NotificationSystemBroker.SmsProviderClient.Enums;
using MAVN.Service.SmsProviderInfobip.Domain.Services;
using MAVN.Service.SmsProviderInfobip.InfobipClient;
using SendSmsRequestModel = MAVN.Service.SmsProviderInfobip.InfobipClient.Models.Requests.SendSmsRequestModel;

namespace Lykke.Service.SmsProviderInfobip.DomainServices.Services
namespace MAVN.Service.SmsProviderInfobip.DomainServices.Services
{
public class SmsService : ISmsService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Net;
using System.Net;
using System.Threading.Tasks;
using Lykke.Service.NotificationSystemBroker.SmsProviderClient;
using Lykke.Service.SmsProviderInfobip.Domain.Services;
using MAVN.Service.NotificationSystemBroker.SmsProviderClient;
using MAVN.Service.SmsProviderInfobip.Domain.Services;
using Microsoft.AspNetCore.Mvc;

namespace Lykke.Service.SmsProviderInfobip.Controllers
namespace MAVN.Service.SmsProviderInfobip.Controllers
{
[Route("/api/")]
[ApiController]
public class InfobipSmsController : Controller, ISmsProvider
public class InfobipSmsController : Controller, ISmsProviderApi
{
private readonly ISmsService _smsService;

Expand Down
10 changes: 5 additions & 5 deletions src/MAVN.Service.SmsProviderInfobip/Modules/ServiceModule.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Autofac;
using Lykke.Service.SmsProviderInfobip.Domain.Services;
using Lykke.Service.SmsProviderInfobip.DomainServices.Services;
using Lykke.Service.SmsProviderInfobip.InfobipClient;
using Lykke.Service.SmsProviderInfobip.Settings;
using Lykke.SettingsReader;
using MAVN.Service.SmsProviderInfobip.Domain.Services;
using MAVN.Service.SmsProviderInfobip.DomainServices.Services;
using MAVN.Service.SmsProviderInfobip.InfobipClient;
using MAVN.Service.SmsProviderInfobip.Settings;

namespace Lykke.Service.SmsProviderInfobip.Modules
namespace MAVN.Service.SmsProviderInfobip.Modules
{
public class ServiceModule : Module
{
Expand Down
4 changes: 2 additions & 2 deletions src/MAVN.Service.SmsProviderInfobip/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Lykke.Sdk;
using System.Threading.Tasks;
using Lykke.Sdk;

namespace Lykke.Service.SmsProviderInfobip
namespace MAVN.Service.SmsProviderInfobip
{
internal sealed class Program
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using JetBrains.Annotations;
using Lykke.Sdk.Settings;

namespace Lykke.Service.SmsProviderInfobip.Settings
namespace MAVN.Service.SmsProviderInfobip.Settings
{
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
public class AppSettings : BaseAppSettings
Expand Down
2 changes: 1 addition & 1 deletion src/MAVN.Service.SmsProviderInfobip/Settings/DbSettings.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Lykke.SettingsReader.Attributes;

namespace Lykke.Service.SmsProviderInfobip.Settings
namespace MAVN.Service.SmsProviderInfobip.Settings
{
public class DbSettings
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Lykke.Service.SmsProviderInfobip.Settings
namespace MAVN.Service.SmsProviderInfobip.Settings
{
public class InfobipSettings
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using JetBrains.Annotations;

namespace Lykke.Service.SmsProviderInfobip.Settings
namespace MAVN.Service.SmsProviderInfobip.Settings
{
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
public class SmsProviderInfobipSettings
Expand Down
6 changes: 3 additions & 3 deletions src/MAVN.Service.SmsProviderInfobip/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using JetBrains.Annotations;
using Lykke.Sdk;
using Lykke.Service.SmsProviderInfobip.Settings;
using MAVN.Service.SmsProviderInfobip.Settings;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace Lykke.Service.SmsProviderInfobip
namespace MAVN.Service.SmsProviderInfobip
{
[UsedImplicitly]
public class Startup
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System;
using FluentValidation;
using Lykke.Service.NotificationSystemBroker.SmsProviderClient;
using MAVN.Service.NotificationSystemBroker.Contract.SmsProvider;

namespace Lykke.Service.SmsProviderInfobip.Validation
namespace MAVN.Service.SmsProviderInfobip.Validation
{
public class SendSmsRequestModelValidator : AbstractValidator<SendSmsRequestModel>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Lykke.Service.SmsProviderInfobip.Client;
using MAVN.Service.SmsProviderInfobip.Client;
using Microsoft.AspNetCore.Mvc;
using Refit;
using Xunit;

namespace Lykke.Service.SmsProviderInfobip.Tests
namespace MAVN.Service.SmsProviderInfobip.Tests
{
public class ClientHttpPathsAreMatchedInControllersTest
{
Expand Down
10 changes: 5 additions & 5 deletions tests/MAVN.Service.SmsProviderInfobip.Tests/SmsServiceTests.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Threading.Tasks;
using AutoFixture;
using Lykke.Logs;
using Lykke.Service.SmsProviderInfobip.DomainServices.Services;
using Lykke.Service.SmsProviderInfobip.InfobipClient;
using Lykke.Service.SmsProviderInfobip.InfobipClient.Models.Responses;
using MAVN.Service.SmsProviderInfobip.DomainServices.Services;
using MAVN.Service.SmsProviderInfobip.InfobipClient;
using MAVN.Service.SmsProviderInfobip.InfobipClient.Models.Responses;
using Moq;
using Xunit;
using SendSmsRequestModel = Lykke.Service.SmsProviderInfobip.InfobipClient.Models.Requests.SendSmsRequestModel;
using SendSmsRequestModel = MAVN.Service.SmsProviderInfobip.InfobipClient.Models.Requests.SendSmsRequestModel;

namespace Lykke.Service.SmsProviderInfobip.Tests
namespace MAVN.Service.SmsProviderInfobip.Tests
{
public class SmsServiceTests
{
Expand Down

0 comments on commit 30bf5a0

Please sign in to comment.