Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@Data
@Schema(name = "CacheStats", description = "Statistics about the performance of a Cache.")
public class CacheStatsDTO {
@Schema(name = "cacheName", description = "The cahce name.")
@Schema(name = "cacheName", description = "The cache name.")
private String cacheName;
@NonNull
@Schema(name = "hitCount", description = "The number of times Cache lookup methods have returned a cached value.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class PeerDTO extends BaseDTO {
private Integer state;
private String announcedAddress;
private Boolean sharedAddress;
private String halmark;
private String hallmark;
private Integer weight;
private Long downloadedVolume;
private Long uploadedVolume;
Expand Down
3 changes: 3 additions & 0 deletions apl-api2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
Expand Down Expand Up @@ -179,6 +180,8 @@
<regex>false</regex>
</configuration>
</plugin>


</plugins>
</build>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020. Apollo Foundation.
* Copyright (c) 2018-2023. Apollo Foundation.
*/

package com.apollocurrency.aplwallet.api.v2;
Expand Down
14 changes: 14 additions & 0 deletions apl-api3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
The Swagger Codegen project - https://github.com/swagger-api/swagger-codegen/tree/3.0.0

To build package, please execute the following:

```
mvn clean package
```

To run swagger editor from DockerHub, please execute the following:

```
docker pull swaggerapi/swagger-editor
docker run -d -p 80:8080 swaggerapi/swagger-editor
```
214 changes: 214 additions & 0 deletions apl-api3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.apollocurrency</groupId>
<artifactId>apollo-blockchain</artifactId>
<version>2.0.1</version>
</parent>

<artifactId>apl-api3</artifactId>
<name>apl-api3</name>
<packaging>jar</packaging>

<properties>
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<swagger-core-version>2.0.0</swagger-core-version>
<jetty-version>9.2.9.v20150224</jetty-version>
<resteasy-version>3.0.11.Final</resteasy-version>
<slf4j-version>1.6.3</slf4j-version>
<junit-version>4.8.1</junit-version>
<servlet-api-version>2.5</servlet-api-version>
<swagger-codegen-maven-plugin.version>3.0.36</swagger-codegen-maven-plugin.version>
</properties>

<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- to resolve swagger codegen issue on windows -->
<excludes>
<exclude>com/apollocurrency/aplwallet/api/impl/v3/*</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>
src/gen/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<configuration>
<tasks>
<!-- @Path("/@@ @Path("/v2/ -->
<replace token= "@Path(&#34;/&#64;&#64;" value="@Path(&#34;/v3/" dir="src/gen/java">
<include name="**/*Api.java"/>
</replace>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
<executions>
<execution>
<id>clean-webapp</id>
<phase>process-sources</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp</directory>
</fileset>
<fileset>
<directory>src/genimpl</directory>
</fileset>
</filesets>
</configuration>
</execution>
<execution>
<id>clean-source</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<filesets>
<fileset>
<directory>src/gen/java</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>${swagger-codegen-maven-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/yaml/apollo-api-v3.yaml</inputSpec>
<output>${project.basedir}</output>
<language>jaxrs-resteasy</language>
<artifactId>apl-api3</artifactId>
<groupId>com.apollocurrency</groupId>
<apiPackage>com.apollocurrency.aplwallet.api.v3</apiPackage>
<modelPackage>com.apollocurrency.aplwallet.api.v3.model</modelPackage>
<invokerPackage>com.apollocurrency.aplwallet.api</invokerPackage>
<skipOverwrite>true</skipOverwrite>
<generateApiTests>true</generateApiTests>
<generateSupportingFiles>false</generateSupportingFiles>
<supportingFilesToGenerate>ApiException.java,NotFoundException.java</supportingFilesToGenerate>
<modelsToGenerate>
AccountInfo,AccountInfoResp,AccountAssetsResp,AccountCurrenciesResp,AccountReq,AccountReqTest,AccountReqSendMoney,AssetBalance,BlockchainInfo,BlockInfo,BlockchainState,BlockInfoResponse,BlockInfoListResponse,Currency,CountResponse,CacheInfo,CacheInfoResponse,CreateChildAccountResp,EmptyResponse,ForgerInfo,ForgersInfoResponse,FullHealthInfo,FullPeerInfo,HealthPrivateInfo,HealthPublicInfo,HealthResponse,NetworkResponse,NodeStatusInfo,ListLogs,ListResponse,PeerPublicInfo,PeerPrivateInfo,PrivateHealthResponse,PublicHealthResponse,TasksInfoResponse,ThreadsInfoResponse,QueryCountResult,QueryObject,QueryResult,TasksInfo,TransactionInfo,TransactionInfoArrayResp,TransactionInfoResp,ThreadsInfo,ThreadsInfoResponse,TxReceipt,TxRequest,PublishContractReq,CallContractMethodReq,ContractListResponse,ContractDetails,ContractDetailsResponse,ContractStateResponse,ContractMethod,CallMethodResult,TransactionArrayResp,CallViewMethodReq,ResultValueResponse,MemberSpec,PropertySpec,ArgSpec,ContractSpecResponse,CurrencyBurningTxCreationRequest,TransactionCreationRequest,TransactionCreationResponse,UnconfirmedTransactionInfo,CurrencyBurningTxParams,AddressSpec,AddressSpecResponse,TransactionVerificationResponse,LastTransactionVerificationResponse,TransactionVerification,StringListResponse,ModuleSourceResponse,ModuleListResponse,AsrSpec,AsrSpecResponse,AsrMemberSpec,ContractEventsRequest,ContractEventsResponse,ContractEventDetails,X509Response
</modelsToGenerate>
<configHelp>false</configHelp>
<configOptions>
<sourceFolder>src/gen/java</sourceFolder>
<implFolder>src/genimpl/java</implFolder>
<hideGenerationTimestamp>true</hideGenerationTimestamp>
<fullJavaUtil>true</fullJavaUtil>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>${project.basedir}/src/gen/java/**/*.java</include>
</includes>
<replacements>
<replacement>
<token>javax.inject</token>
<value>jakarta.inject</value>
</replacement>
<replacement>
<token>javax.validation</token>
<value>jakarta.validation</value>
</replacement>
<replacement>
<token>javax.ws</token>
<value>jakarta.ws</value>
</replacement>
</replacements>
<regex>false</regex>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-shaded</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2</artifactId>
</dependency>
<!-- Bean Validation API support -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2018-2020. Apollo Foundation.
*/

package com.apollocurrency.aplwallet.api.v3;

public class NotFoundException extends jakarta.ws.rs.NotFoundException {

public NotFoundException(String msg) {
super(msg);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright (c) 2018-2023. Apollo Foundation.
*/

package com.apollocurrency.aplwallet.api.v3.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Objects;


public class BaseResponse {
private static final String PROTOCOL_VERSION = "2";
private String protocol = PROTOCOL_VERSION;
private Long requestProcessingTime = 0L;

/**
* Protocol version
**/

@Schema(example = "2", description = "Protocol version")
@JsonProperty("protocol")
public String getProtocol() {
return protocol;
}

public void setProtocol(String protocol) {
this.protocol = protocol;
}

/**
* Time in milliseconds that took from incoming request to response
**/

@Schema(example = "12", description = "Time in milliseconds that took from incoming request to response")
@JsonProperty("requestProcessingTime")
public Long getRequestProcessingTime() {
return requestProcessingTime;
}

public void setRequestProcessingTime(Long requestProcessingTime) {
this.requestProcessingTime = requestProcessingTime;
}


@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BaseResponse baseResponse = (BaseResponse) o;
return Objects.equals(protocol, baseResponse.protocol) &&
Objects.equals(requestProcessingTime, baseResponse.requestProcessingTime);
}

@Override
public int hashCode() {
return Objects.hash(protocol, requestProcessingTime);
}

@Override
public String toString() {

return "BaseResponse{" +
"protocol= '" + protocol + '\'' +
", requestProcessingTime= " + requestProcessingTime +
'}';
}
}
Loading