CrazyIter 5 lat temu
rodzic
commit
4bdec6cd32

+ 0 - 27
TEAMModelOS.Grpc/Program.cs

@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.Hosting;
-
-namespace TEAMModelOS.Grpc
-{
-    public class Program
-    {
-        public static void Main(string[] args)
-        {
-            CreateHostBuilder(args).Build().Run();
-        }
-
-        // 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
-        public static IHostBuilder CreateHostBuilder(string[] args) =>
-            Host.CreateDefaultBuilder(args)
-                .ConfigureWebHostDefaults(webBuilder =>
-                {
-                    webBuilder.UseStartup<Startup>();
-                });
-    }
-}

+ 0 - 12
TEAMModelOS.Grpc/Properties/launchSettings.json

@@ -1,12 +0,0 @@
-{
-  "profiles": {
-    "TEAMModelOS.Grpc": {
-      "commandName": "Project",
-      "launchBrowser": false,
-      "applicationUrl": "https://localhost:5001",
-      "environmentVariables": {
-        "ASPNETCORE_ENVIRONMENT": "Development"
-      }
-    }
-  }
-}

+ 0 - 21
TEAMModelOS.Grpc/Protos/greet.proto

@@ -1,21 +0,0 @@
-syntax = "proto3";
-
-option csharp_namespace = "TEAMModelOS.Grpc";
-
-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;
-}

+ 0 - 28
TEAMModelOS.Grpc/Services/GreeterService.cs

@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Grpc.Core;
-using Microsoft.Extensions.Logging;
-
-namespace TEAMModelOS.Grpc
-{
-    public class GreeterService : Greeter.GreeterBase
-    {
-        private readonly ILogger<GreeterService> _logger;
-        public GreeterService(ILogger<GreeterService> logger  )
-        {
-            _logger = logger;
-        }
-
-        public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
-        {
-
-
-            return Task.FromResult(new HelloReply
-            {
-                Message = "Hello " + request.Name
-            });
-        }
-    }
-}

+ 0 - 43
TEAMModelOS.Grpc/Startup.cs

@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-
-namespace TEAMModelOS.Grpc
-{
-    public class Startup
-    {
-        // This method gets called by the runtime. Use this method to add services to the container.
-        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
-        public void ConfigureServices(IServiceCollection services)
-        {
-            services.AddGrpc();
-        }
-
-        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
-        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
-        {
-            if (env.IsDevelopment())
-            {
-                app.UseDeveloperExceptionPage();
-            }
-
-            app.UseRouting();
-
-            app.UseEndpoints(endpoints =>
-            {
-                endpoints.MapGrpcService<GreeterService>();
-
-                endpoints.MapGet("/", async context =>
-                {
-                    await context.Response.WriteAsync("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");
-                });
-            });
-        }
-    }
-}

+ 0 - 15
TEAMModelOS.Grpc/TEAMModelOS.Grpc.csproj

@@ -1,15 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk.Web">
-
-  <PropertyGroup>
-    <TargetFramework>netcoreapp3.1</TargetFramework>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Protobuf Include="Protos\greet.proto" GrpcServices="Server" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Grpc.AspNetCore" Version="2.25.0" />
-  </ItemGroup>
-
-</Project>

+ 0 - 10
TEAMModelOS.Grpc/appsettings.Development.json

@@ -1,10 +0,0 @@
-{
-  "Logging": {
-    "LogLevel": {
-      "Default": "Debug",
-      "System": "Information",
-      "Grpc": "Information",
-      "Microsoft": "Information"
-    }
-  }
-}

+ 0 - 14
TEAMModelOS.Grpc/appsettings.json

@@ -1,14 +0,0 @@
-{
-  "Logging": {
-    "LogLevel": {
-      "Default": "Warning",
-      "Microsoft.Hosting.Lifetime": "Information"
-    }
-  },
-  "AllowedHosts": "*",
-  "Kestrel": {
-    "EndpointDefaults": {
-      "Protocols": "Http2"
-    }
-  }
-}

+ 0 - 6
TEAMModelOS.sln

@@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TEAMModelOS", "TEAMModelOS\
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TEAMModelOS.Service", "TEAMModelOS.Service\TEAMModelOS.Service.csproj", "{04508AB6-CD54-46B4-B96D-9672EB66761B}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TEAMModelOS.Grpc", "TEAMModelOS.Grpc\TEAMModelOS.Grpc.csproj", "{75C46F80-6FDB-4589-A045-1C10F3FCD225}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{53913D96-CC85-4698-9241-84761C58EAC3}"
 EndProject
 Global
@@ -31,10 +29,6 @@ Global
 		{04508AB6-CD54-46B4-B96D-9672EB66761B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{04508AB6-CD54-46B4-B96D-9672EB66761B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{04508AB6-CD54-46B4-B96D-9672EB66761B}.Release|Any CPU.Build.0 = Release|Any CPU
-		{75C46F80-6FDB-4589-A045-1C10F3FCD225}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{75C46F80-6FDB-4589-A045-1C10F3FCD225}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{75C46F80-6FDB-4589-A045-1C10F3FCD225}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{75C46F80-6FDB-4589-A045-1C10F3FCD225}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE