Skip to content

Commit

Permalink
universal code generator
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Dec 4, 2018
1 parent d16109f commit 1b8ff40
Show file tree
Hide file tree
Showing 42 changed files with 1,270 additions and 6,116 deletions.
9 changes: 1 addition & 8 deletions MagicOnion.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget", "nuget", "{7F61607D
nuget\push.bat = nuget\push.bat
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicOnion.CodeGenerator", "src\MagicOnion.CodeGenerator\MagicOnion.CodeGenerator.csproj", "{9633B452-A984-46A6-9A92-B6291561BA09}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnion.HttpGateway", "src\MagicOnion.HttpGateway\MagicOnion.HttpGateway.csproj", "{FCE03661-803E-4629-944F-45DB6B444320}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedProjectLibrary", "sandbox\SharedProjectLibrary\SharedProjectLibrary.shproj", "{5526FA31-4F38-4FF7-96EE-A73BF495E1EE}"
Expand All @@ -47,7 +45,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicCodeDumper", "sandbo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnion.Redis", "src\MagicOnion.Redis\MagicOnion.Redis.csproj", "{5637ED33-7EB8-4C30-94EE-947C58FDE363}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicOnion.UniversalCodeGenerator", "src\MagicOnion.UniversalCodeGenerator\MagicOnion.UniversalCodeGenerator.csproj", "{4D10B1BA-494D-4FAF-ADC8-FA5156533EDB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MagicOnion.UniversalCodeGenerator", "src\MagicOnion.UniversalCodeGenerator\MagicOnion.UniversalCodeGenerator.csproj", "{4D10B1BA-494D-4FAF-ADC8-FA5156533EDB}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Expand Down Expand Up @@ -79,10 +77,6 @@ Global
{26D5411C-460A-489A-A1E8-B7CC0B4D05BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26D5411C-460A-489A-A1E8-B7CC0B4D05BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26D5411C-460A-489A-A1E8-B7CC0B4D05BB}.Release|Any CPU.Build.0 = Release|Any CPU
{9633B452-A984-46A6-9A92-B6291561BA09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9633B452-A984-46A6-9A92-B6291561BA09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9633B452-A984-46A6-9A92-B6291561BA09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9633B452-A984-46A6-9A92-B6291561BA09}.Release|Any CPU.Build.0 = Release|Any CPU
{FCE03661-803E-4629-944F-45DB6B444320}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCE03661-803E-4629-944F-45DB6B444320}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCE03661-803E-4629-944F-45DB6B444320}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -129,7 +123,6 @@ Global
{59C4CF2E-964B-460A-BCCA-33F434DD11EF} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
{A6F79DDC-B0FF-4337-9B24-8D5E768A8340} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
{26D5411C-460A-489A-A1E8-B7CC0B4D05BB} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
{9633B452-A984-46A6-9A92-B6291561BA09} = {1987061F-8970-4018-8D58-6932961C9EB4}
{FCE03661-803E-4629-944F-45DB6B444320} = {1987061F-8970-4018-8D58-6932961C9EB4}
{5526FA31-4F38-4FF7-96EE-A73BF495E1EE} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
{A9E28AFD-4FEC-416A-9F85-C64F05605B22} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
Expand Down
2 changes: 1 addition & 1 deletion sandbox/Sandbox.NetCoreServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static async Task Main(string[] args)
//Environment.SetEnvironmentVariable("GRPC_TRACE", "all");

Environment.SetEnvironmentVariable("SETTINGS_MAX_HEADER_LIST_SIZE", "1000000");

GrpcEnvironment.SetLogger(new ConsoleLogger());

var service = MagicOnionEngine.BuildServerServiceDefinition(new MagicOnionOptions(true)
Expand Down
41 changes: 35 additions & 6 deletions sandbox/Sandbox.NetCoreServer/Services/UnaryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using MagicOnion;
using MagicOnion.Server;
using MessagePack;
using System;
using System.Collections.Generic;
using System.Text;
Expand All @@ -11,18 +12,46 @@ namespace Sandbox.NetCoreServer.Services
{
public interface IMyFirstService : IService<IMyFirstService>
{
UnaryResult<Nil> ZeroAsync();
UnaryResult<TestEnum> OneAsync(int z);
UnaryResult<string> SumAsync(int x, int y);
UnaryResult<OreOreResponse> OreOreAsync(OreOreRequest z);
UnaryResult<OreOreResponse[]> OreOre2Async(OreOreRequest z);
UnaryResult<List<OreOreResponse>> OreOre3Async(OreOreRequest z);

// use hub instead:)

Task<ClientStreamingResult<int, string>> ClientStreamingSampleAsync();
Task<ServerStreamingResult<string>> ServertSreamingSampleAsync(int x, int y, int z);
Task<DuplexStreamingResult<int, string>> DuplexStreamingSampleAync();
}

public class UnaryService : ServiceBase<IMyFirstService>, IMyFirstService
public enum TestEnum
{
[MyFirstFilter]
public async UnaryResult<string> SumAsync(int x, int y)
{
return (x + y).ToString();
}

}


public class OreOreRequest
{

}


public class OreOreResponse
{

}

//public class UnaryService : ServiceBase<IMyFirstService>, IMyFirstService
//{
// [MyFirstFilter]
// public async UnaryResult<string> SumAsync(int x, int y)
// {
// return (x + y).ToString();
// }
//}

public class MyFirstFilter : MagicOnionFilterAttribute
{
public MyFirstFilter()
Expand Down
70 changes: 0 additions & 70 deletions src/MagicOnion.CodeGenerator/App.config

This file was deleted.

Loading

0 comments on commit 1b8ff40

Please sign in to comment.