Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/apl 1783 api v3 #1100

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 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 @@ -113,6 +113,7 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
Expand Down Expand Up @@ -149,6 +150,8 @@
</execution>
</executions>
</plugin>


</plugins>
</build>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion apl-api2/src/main/resources/yaml/apollo-api-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1255,4 +1255,4 @@ components:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
bearerFormat: JWT
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
```
184 changes: 184 additions & 0 deletions apl-api3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
<?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>1.48.2</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.20</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,AccountReq,AccountReqTest,AccountReqSendMoney,BlockchainInfo,BlockInfo,BlockchainState,CountResponse,CreateChildAccountResp,EmptyResponse,HealthResponse,ListResponse,QueryCountResult,QueryObject,QueryResult,TransactionInfo,TransactionInfoArrayResp,TransactionInfoResp,TxReceipt,TxRequest-->
<!-- </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>


</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.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>javax.validation</groupId>
<artifactId>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.
*/
yuriy-ln marked this conversation as resolved.
Show resolved Hide resolved

package com.apollocurrency.aplwallet.api.v3;

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

public NotFoundException(String msg) {
super(msg);
}
}
13 changes: 13 additions & 0 deletions apl-api3/src/main/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:weld="http://jboss.org/schema/weld/beans"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.1" bean-discovery-mode="all">
<decorators>
<class>org.jboss.weld.environment.se.threading.RunnableDecorator</class>
</decorators>
<weld:scan>
<weld:exclude name="org.jboss.weld.**" />
</weld:scan>
</beans>
Loading