All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.AsyncAPI.tpl Maven / Gradle / Ivy

The newest version!
<#if service.javaPackage?has_content>
  <#assign package = service.javaPackage>
<#else>
  <#assign package = service.packageName>

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 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>
  
import ${msgPackage?c_lower_case}.${msgClass};


/**
 * 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}"})
    CompletionStage<${method.outputType.name}> ${method.name[0]?c_lower_case + method.name[1..]}(RpcContext context, ${method.inputType.name} request);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy