From 7895ef0663fc77896c9c01613eb44f21de55f034 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Sun, 7 Apr 2024 16:49:49 +0300 Subject: [PATCH] Experimenting with request/response struct names for non global RPCs --- tpl/macro.twig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tpl/macro.twig b/tpl/macro.twig index 756a9da..4deaeb6 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -349,13 +349,20 @@ public enum {{o.name}} } {% endmacro %} -{% macro decl_rpc(o) %} +{% macro decl_rpc(o, is_global = true) %} +{% if is_global %} {{_self.decl_struct(o.req)}} {{_self.decl_struct(o.rsp)}} +{% endif %} public class {{o.name}} : IRpc { +{% if not is_global %} + {{_self.decl_struct(o.req)}} + {{_self.decl_struct(o.rsp)}} +{% endif %} + public IRpcError error = null; public {{o.req.name}} req = new {{o.req.name}}(); public {{o.rsp.name}} rsp = new {{o.rsp.name}}();