-
Notifications
You must be signed in to change notification settings - Fork 42
Feature/apl 1783 api v3 #1100
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
Open
andrii-firstbridge
wants to merge
16
commits into
develop
Choose a base branch
from
feature/APL-1783_api_v3
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/apl 1783 api v3 #1100
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bdd6030
APL-1783 finish api blockchain part
andrii-firstbridge de8d312
APL-1783 finish api public node info
andrii-firstbridge 4b16320
APL-1783 finish api private getForgers getFullHealth
andrii-firstbridge c046b13
APL-1783 finish api private cache,threads,logs.
andrii-firstbridge 535a49e
APL-1783 finish api subscribe
andrii-firstbridge c08a66e
APL-1783 finish api getSubscriptionStatus
andrii-firstbridge 6f5a52b
APL-1783 refactoring api
andrii-firstbridge f6be9af
APL-1783 refactoring api-v2 after review
andrii-firstbridge a5a39d9
APL-1783 create new api version v3
andrii-firstbridge b9217d5
APL-1783 rollback api-v2, fix api-v3
andrii-firstbridge c335d45
APL-1783 api-v3 fix yaml
andrii-firstbridge 37bd380
APL-1783 comment subscribe end points
andrii-firstbridge 8b776d3
APL-1846 refactoring after the first iteration
andrii-firstbridge 5fde999
merged 'develop' branch
blandger 2b50ab4
minor update copyright
blandger e29bec2
minor update copyright
blandger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apl-api2/src/main/java/com/apollocurrency/aplwallet/api/v2/NotFoundException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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("/@@" value="@Path("/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> |
12 changes: 12 additions & 0 deletions
12
apl-api3/src/main/java/com/apollocurrency/aplwallet/api/v3/NotFoundException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } | ||
| } | ||
73 changes: 73 additions & 0 deletions
73
apl-api3/src/main/java/com/apollocurrency/aplwallet/api/v3/model/BaseResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 + | ||
| '}'; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.