diff --git a/Arkadia.sln b/Arkadia.sln index 96e721f..be63239 100644 --- a/Arkadia.sln +++ b/Arkadia.sln @@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notifications", "sources\No EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cdn", "sources\Cdn\Cdn.csproj", "{F5F8C40C-6CA8-467D-8E39-0CA2CFB268CE}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Schedules", "sources\Schedules\Schedules.csproj", "{AEB22862-3DCE-4EC9-A9E6-1779ECC76707}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -78,6 +80,14 @@ Global {F5F8C40C-6CA8-467D-8E39-0CA2CFB268CE}.Release|Any CPU.Build.0 = Release|Any CPU {F5F8C40C-6CA8-467D-8E39-0CA2CFB268CE}.Release|x64.ActiveCfg = Release|Any CPU {F5F8C40C-6CA8-467D-8E39-0CA2CFB268CE}.Release|x64.Build.0 = Release|Any CPU + {AEB22862-3DCE-4EC9-A9E6-1779ECC76707}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AEB22862-3DCE-4EC9-A9E6-1779ECC76707}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AEB22862-3DCE-4EC9-A9E6-1779ECC76707}.Debug|x64.ActiveCfg = Debug|Any CPU + {AEB22862-3DCE-4EC9-A9E6-1779ECC76707}.Debug|x64.Build.0 = Debug|Any CPU + {AEB22862-3DCE-4EC9-A9E6-1779ECC76707}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AEB22862-3DCE-4EC9-A9E6-1779ECC76707}.Release|Any CPU.Build.0 = Release|Any CPU + {AEB22862-3DCE-4EC9-A9E6-1779ECC76707}.Release|x64.ActiveCfg = Release|Any CPU + {AEB22862-3DCE-4EC9-A9E6-1779ECC76707}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {09F1856B-4098-453B-9378-9DF22D066A7B} = {DC9DF7BF-8063-4E8B-8128-B5292BEE3EAA} @@ -86,5 +96,6 @@ Global {FD59610D-0828-40E5-910E-A86D4A86B5C9} = {DC9DF7BF-8063-4E8B-8128-B5292BEE3EAA} {07432867-17EB-41B6-83E3-4FD8EDC86997} = {DC9DF7BF-8063-4E8B-8128-B5292BEE3EAA} {F5F8C40C-6CA8-467D-8E39-0CA2CFB268CE} = {DC9DF7BF-8063-4E8B-8128-B5292BEE3EAA} + {AEB22862-3DCE-4EC9-A9E6-1779ECC76707} = {DC9DF7BF-8063-4E8B-8128-B5292BEE3EAA} EndGlobalSection EndGlobal diff --git a/sources/Schedules/Program.cs b/sources/Schedules/Program.cs new file mode 100644 index 0000000..659c190 --- /dev/null +++ b/sources/Schedules/Program.cs @@ -0,0 +1,17 @@ +using Schedules.Services; + +var builder = WebApplication.CreateBuilder(args); + +// Additional configuration is required to successfully run gRPC on macOS. +// For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682 + +// Add services to the container. +builder.Services.AddGrpc(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +app.MapGrpcService(); +app.MapGet("/", () => "Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909"); + +app.Run(); diff --git a/sources/Schedules/Properties/launchSettings.json b/sources/Schedules/Properties/launchSettings.json new file mode 100644 index 0000000..ea6e2ae --- /dev/null +++ b/sources/Schedules/Properties/launchSettings.json @@ -0,0 +1,13 @@ +{ + "profiles": { + "Schedules": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://localhost:5276;https://localhost:7276", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/sources/Schedules/Protos/greet.proto b/sources/Schedules/Protos/greet.proto new file mode 100644 index 0000000..122081a --- /dev/null +++ b/sources/Schedules/Protos/greet.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +option csharp_namespace = "Schedules"; + +package greet; + +// The greeting service definition. +service Greeter { + // Sends a greeting + rpc SayHello (HelloRequest) returns (HelloReply); +} + +// The request message containing the user's name. +message HelloRequest { + string name = 1; +} + +// The response message containing the greetings. +message HelloReply { + string message = 1; +} diff --git a/sources/Schedules/Schedules.csproj b/sources/Schedules/Schedules.csproj new file mode 100644 index 0000000..ce9f628 --- /dev/null +++ b/sources/Schedules/Schedules.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/sources/Schedules/Services/GreeterService.cs b/sources/Schedules/Services/GreeterService.cs new file mode 100644 index 0000000..26e14ed --- /dev/null +++ b/sources/Schedules/Services/GreeterService.cs @@ -0,0 +1,22 @@ +using Grpc.Core; +using Schedules; + +namespace Schedules.Services; + +public class GreeterService : Greeter.GreeterBase +{ + private readonly ILogger _logger; + + public GreeterService(ILogger logger) + { + _logger = logger; + } + + public override Task SayHello(HelloRequest request, ServerCallContext context) + { + return Task.FromResult(new HelloReply + { + Message = "Hello " + request.Name + }); + } +} diff --git a/sources/Schedules/appsettings.Development.json b/sources/Schedules/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/sources/Schedules/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/sources/Schedules/appsettings.json b/sources/Schedules/appsettings.json new file mode 100644 index 0000000..1aef507 --- /dev/null +++ b/sources/Schedules/appsettings.json @@ -0,0 +1,14 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "Kestrel": { + "EndpointDefaults": { + "Protocols": "Http2" + } + } +}