Browse Source

Remove console demo app

pull/15/head
Halil İbrahim Kalkan 6 years ago
parent
commit
c330e85948
  1. 7
      eventhub/EventHub.sln
  2. 9
      eventhub/src/EventHub.DbMigrator/appsettings.json
  3. 4
      eventhub/src/EventHub.HttpApi.Host/appsettings.json
  4. 26
      eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs
  5. 26
      eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs
  6. 29
      eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/EventHub.HttpApi.Client.ConsoleTestApp.csproj
  7. 29
      eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/EventHubConsoleApiClientModule.cs
  8. 21
      eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/Program.cs
  9. 18
      eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/appsettings.json

7
eventhub/EventHub.sln

@ -35,8 +35,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.TestBase", "test\E
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.Domain.Tests", "test\EventHub.Domain.Tests\EventHub.Domain.Tests.csproj", "{E512F4D9-9375-480F-A2F6-A46509F9D824}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.HttpApi.Client.ConsoleTestApp", "test\EventHub.HttpApi.Client.ConsoleTestApp\EventHub.HttpApi.Client.ConsoleTestApp.csproj", "{EF480016-9127-4916-8735-D2466BDBC582}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.DbMigrator", "src\EventHub.DbMigrator\EventHub.DbMigrator.csproj", "{AA94D832-1CCC-4715-95A9-A483F23A1A5D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.Blazor", "src\EventHub.Blazor\EventHub.Blazor.csproj", "{27B2DDC7-8B75-4322-A312-25419C15D9D8}"
@ -105,10 +103,6 @@ Global
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.Build.0 = Release|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.Build.0 = Release|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -140,7 +134,6 @@ Global
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{E512F4D9-9375-480F-A2F6-A46509F9D824} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{EF480016-9127-4916-8735-D2466BDBC582} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{AA94D832-1CCC-4715-95A9-A483F23A1A5D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{27B2DDC7-8B75-4322-A312-25419C15D9D8} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{19F3FAD2-740F-4933-A394-4B030E2ABE6A} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}

9
eventhub/src/EventHub.DbMigrator/appsettings.json

@ -7,12 +7,7 @@
"EventHub_Web": {
"ClientId": "EventHub_Web",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44395"
},
"EventHub_App": {
"ClientId": "EventHub_App",
"ClientSecret": "1q2w3e*",
"RootUrl": "http://localhost:4200"
"RootUrl": "https://localhost:44308"
},
"EventHub_Blazor": {
"ClientId": "EventHub_Blazor",
@ -25,4 +20,4 @@
}
}
}
}
}

4
eventhub/src/EventHub.HttpApi.Host/appsettings.json

@ -1,6 +1,6 @@
{
"App": {
"CorsOrigins": "https://*.EventHub.com,https://localhost:44307"
"CorsOrigins": "https://*.EventHub.com,https://localhost:44307,https://localhost:44308"
},
"ConnectionStrings": {
"Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=EventHub;Trusted_Connection=True"
@ -28,4 +28,4 @@
"Abp.Mailing.DefaultFromAddress": "noreply@abp.io",
"Abp.Mailing.DefaultFromDisplayName": "ABP application"
}
}
}

26
eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs

@ -1,26 +0,0 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
namespace EventHub.HttpApi.Client.ConsoleTestApp
{
public class ClientDemoService : ITransientDependency
{
private readonly IProfileAppService _profileAppService;
public ClientDemoService(IProfileAppService profileAppService)
{
_profileAppService = profileAppService;
}
public async Task RunAsync()
{
var output = await _profileAppService.GetAsync();
Console.WriteLine($"UserName : {output.UserName}");
Console.WriteLine($"Email : {output.Email}");
Console.WriteLine($"Name : {output.Name}");
Console.WriteLine($"Surname : {output.Surname}");
}
}
}

26
eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs

@ -1,26 +0,0 @@
using Microsoft.Extensions.Hosting;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
namespace EventHub.HttpApi.Client.ConsoleTestApp
{
public class ConsoleTestAppHostedService : IHostedService
{
public async Task StartAsync(CancellationToken cancellationToken)
{
using (var application = AbpApplicationFactory.Create<EventHubConsoleApiClientModule>())
{
application.Initialize();
var demo = application.ServiceProvider.GetRequiredService<ClientDemoService>();
await demo.RunAsync();
application.Shutdown();
}
}
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
}

29
eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/EventHub.HttpApi.Client.ConsoleTestApp.csproj

@ -1,29 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="appsettings.json" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="4.2.0-rc.1" />
<ProjectReference Include="..\..\src\EventHub.HttpApi.Client\EventHub.HttpApi.Client.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.*" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="5.0.*" />
</ItemGroup>
</Project>

29
eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/EventHubConsoleApiClientModule.cs

@ -1,29 +0,0 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Polly;
using Volo.Abp.Http.Client;
using Volo.Abp.Http.Client.IdentityModel;
using Volo.Abp.Modularity;
namespace EventHub.HttpApi.Client.ConsoleTestApp
{
[DependsOn(
typeof(EventHubHttpApiClientModule),
typeof(AbpHttpClientIdentityModelModule)
)]
public class EventHubConsoleApiClientModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<AbpHttpClientBuilderOptions>(options =>
{
options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) =>
{
clientBuilder.AddTransientHttpErrorPolicy(
policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i)))
);
});
});
}
}
}

21
eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/Program.cs

@ -1,21 +0,0 @@
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace EventHub.HttpApi.Client.ConsoleTestApp
{
class Program
{
static async Task Main(string[] args)
{
await CreateHostBuilder(args).RunConsoleAsync();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<ConsoleTestAppHostedService>();
});
}
}

18
eventhub/test/EventHub.HttpApi.Client.ConsoleTestApp/appsettings.json

@ -1,18 +0,0 @@
{
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44362"
}
},
"IdentityClients": {
"Default": {
"GrantType": "password",
"ClientId": "EventHub_App",
"ClientSecret": "1q2w3e*",
"UserName": "admin",
"UserPassword": "1q2w3E*",
"Authority": "https://localhost:44313",
"Scope": "EventHub"
}
}
}
Loading…
Cancel
Save