ms-productos
-
API version: 0.0.1
-
Build date: 2022-03-15T13:44:13.089166500+01:00[Europe/Paris]
Microservice for products in bar
Automatically generated by the OpenAPI Generator
Building the API client library requires:
- Java 1.8+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>openapi-java-client</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "org.openapitools:openapi-java-client:0.0.1"
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/openapi-java-client-0.0.1.jar
target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import rest.elchoco.mesas.openAPI.client.*;
import rest.elchoco.mesas.openAPI.client.auth.*;
import rest.elchoco.mesas.openAPI.dto.products.*;
import rest.elchoco.mesas.openAPI.api.ProductApi;
public class ProductApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
// Configure API key authorization: x-jwt-assertion
ApiKeyAuth x-jwt-assertion = (ApiKeyAuth) defaultClient.getAuthentication("x-jwt-assertion");
x-jwt-assertion.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//x-jwt-assertion.setApiKeyPrefix("Token");
ProductApi apiInstance = new ProductApi(defaultClient);
ProductCreateRDTO body = new ProductCreateRDTO(); // ProductCreateRDTO | Product object that needs to be added
try {
ProductCreateRDTO result = apiInstance.addProduct(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductApi#addProduct");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
ProductApi | addProduct | POST /products | Add a new product |
ProductApi | findAllProducts | GET /products | Find all products |
ProductApi | findAllProductsByPlace | GET /products/byPlace/{terraceOrSalon} | Find all products by place |
ProductApi | findAllProductsByPlaceAndFamilyCode | GET /products/byPlaceAndFamilyCode/{terraceOrSalon}/{familyCode} | Find all products by place and family |
ProductApi | findProductsByFamily | GET /products/byFamily/{familyCode} | Find products by familyCode |
ProductApi | findProductsByName | GET /products/byName/{name} | Find product by name |
ProductApi | findProductsByPlaceAndName | GET /products/byPlaceAndName/{terraceOrSalon}/{name} | Find product by name and place |
ProductApi | productsByNameNameDelete | DELETE /products/byName/{name} | Delete product by name |
ProductApi | updateProduct | PUT /products | Update or create an existing product |
- ErrorResponseErrorRDTO
- ErrorResponseRDTO
- FamilyRDTO
- ParametersRDTO
- ProductCreateRDTO
- ProductPlaceRDTO
- ScaleRDTO
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: x-jwt-assertion
- Location: HTTP header
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.