templates.AsyncAPI.tpl Maven / Gradle / Ivy
<#if service.javaPackage?has_content>
<#assign package = service.javaPackage>
<#else>
<#assign package = service.packageName>
#if>
package ${package?c_lower_case};
import com.tencent.trpc.core.rpc.RpcContext;
import com.tencent.trpc.core.rpc.anno.TRpcMethod;
import com.tencent.trpc.core.rpc.anno.TRpcService;
import java.util.concurrent.CompletionStage;
<#list service.messageTypes as name, msgType>
<#if msgType.javaPackage?has_content>
<#assign msgPackage = msgType.javaPackage>
<#else>
<#assign msgPackage = msgType.packageName>
#if>
<#if msgType.multipleClasses>
<#assign msgClass = msgType.name?cap_first>
<#elseif msgType.javaOuterClass?has_content>
<#assign msgClass = msgType.javaOuterClass + '.' + msgType.name?cap_first>
<#else>
<#assign msgClass = msgType.fallbackClassname + '.' + msgType.name?cap_first>
#if>
import ${msgPackage?c_lower_case}.${msgClass};
#list>
/**
* Generated by trpc-java-codegen
*/
@TRpcService(name = "${service.packageName}.${service.name}")
public interface ${service.interfaceNamePrefix}AsyncAPI {
<#list service.methods as method>
/**
* ${method.name}
*
* @param context context
* @param request request
* @return {@link CompletionStage} of {@link ${method.outputType.name}}
*/
@TRpcMethod(name = "${method.name}"<#if method.alias?has_content>, alias = {"${method.alias}"}#if>)
CompletionStage<${method.outputType.name}> ${method.name[0]?c_lower_case + method.name[1..]}(RpcContext context, ${method.inputType.name} request);
#list>
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy