core.src.api.ContractLifecycle.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of web3j-openapi-codegen Show documentation
Show all versions of web3j-openapi-codegen Show documentation
web3j-openapi project code generators
package {{packageName}}.core.{{contractName}}
import org.web3j.openapi.core.CONTRACT_ADDRESS
import org.web3j.openapi.core.CONTRACT_ADDRESS_PATH
import {{packageName}}.core.{{contractName}}.model.{{#contractDetails}}{{capitalizedContractName}}{{/contractDetails}}DeployParameters
import org.web3j.protocol.core.methods.response.TransactionReceipt
import javax.annotation.Generated
import io.swagger.v3.oas.annotations.Operation
import javax.ws.rs.Consumes
import javax.ws.rs.POST
import javax.ws.rs.Path
import javax.ws.rs.PathParam
import javax.ws.rs.Produces
import javax.ws.rs.core.MediaType
@Generated
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
{{#contractDetails}}
interface {{capitalizedContractName}}Lifecycle {
@POST
@Operation(
tags = ["{{capitalizedContractName}} Methods"],
summary = "Deploys the {{capitalizedContractName}} contract"
)
fun deploy{{deployParameters}}: TransactionReceipt
@Path(CONTRACT_ADDRESS_PATH)
@Operation(
tags = ["{{capitalizedContractName}} Methods"],
summary = "Loads the {{capitalizedContractName}} contract"
)
fun load(@PathParam(CONTRACT_ADDRESS) contractAddress: String): {{capitalizedContractName}}Resource
@Path("default")
@Operation(
tags = ["{{capitalizedContractName}} Methods"],
summary = "Loads the {{capitalizedContractName}} contract with predefined address"
)
fun load(): {{capitalizedContractName}}Resource
}
{{/contractDetails}}