-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Documentación de la api utilizando SpringDoc -Creación de README
- Loading branch information
1 parent
4cbd6cd
commit 34bce50
Showing
12 changed files
with
199 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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,37 @@ | ||
# [ExchangesRatesApi](https://github.com/Marc0Franc0/ExchangesRatesApi#exchangesratesapi) | ||
|
||
El proyecto tiene la posibilidad de consumir diferentes APIS con el objetivo de obtener los tipos de cambios en argentina y precios del mercado en dólares. | ||
|
||
## Características | ||
- Consumo de APIS externas | ||
|
||
## Tecnologías | ||
- Spring Boot 3.0 | ||
- Maven | ||
|
||
## Ejecución | ||
1. Clonar repositorio: git clone https://github.com/Marc0Franc0/ExchangesRatesApi | ||
2. Ir al directorio del proyecto: cd ExchangesRatesApi | ||
3. Seguir pasos para ejecución con Maven | ||
|
||
## Requerimientos para ejecutar con Maven | ||
|
||
Para construir y ejecutar la aplicación necesita: | ||
|
||
- [JDK 21+](https://www.oracle.com/java/technologies/downloads/#java21) | ||
- [Maven 3+](https://maven.apache.org) | ||
|
||
Configurar datos de la base de datos MySQL: [application.properties](https://github.com/Marc0Franc0/Forum/blob/main/src/main/resources/application-dev.properties) | ||
|
||
Ejecutar localmente | ||
|
||
```shell | ||
mvn clean install | ||
``` | ||
```shell | ||
mvn spring-boot:run | ||
``` | ||
|
||
Dirigirse a: | ||
- [Documentación en formato JSON](http://localhost:8080/api/v3/api-docs) | ||
- [Documentación Swagger con interfaz gráfica](http://localhost:8080/doc/swagger-ui/index.html) |
This file contains 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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/app/ExchangeRates/config/documentation/OpenApiConfiguration.java
This file contains 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,27 @@ | ||
package com.app.ExchangeRates.config.documentation; | ||
|
||
import io.swagger.v3.oas.annotations.OpenAPIDefinition; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import io.swagger.v3.oas.models.servers.Server; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.function.RouterFunction; | ||
import java.util.List; | ||
import static org.springdoc.webmvc.core.fn.SpringdocRouteBuilder.route; | ||
|
||
@OpenAPIDefinition | ||
@Configuration | ||
public class OpenApiConfiguration { | ||
@Bean | ||
public OpenAPI customOpenAPI ( | ||
@Value("${openapi.service.title}") String serviceTitle, | ||
@Value("${openapi.service.version}") String serviceVersion, | ||
@Value ("${openapi.service.url}") String url) { | ||
return new OpenAPI () | ||
.servers(List.of( new Server().url(url))) | ||
.info( new Info().title(serviceTitle ).version(serviceVersion)); | ||
} | ||
|
||
} |
This file contains 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 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 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 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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/app/ExchangeRates/model/DolarApi/MoneyDTO.java
This file contains 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,16 @@ | ||
package com.app.ExchangeRates.model.DolarApi; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class MoneyDTO { | ||
String money; | ||
String name; | ||
Double buyValue; | ||
Double saleValue; | ||
} |
This file contains 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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/app/ExchangeRates/model/FinnHub/QuoteDTO.java
This file contains 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,16 @@ | ||
package com.app.ExchangeRates.model.FinnHub; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Data | ||
public class QuoteDTO { | ||
private Double currencyPrice; | ||
private Double percentChange; | ||
private Double openPriceOfTheDay; | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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,17 @@ | ||
apiDolar: | ||
baseUrl: https://dolarapi.com/v1 | ||
finnHub: | ||
baseUrl: https://finnhub.io/api/v1 | ||
token: cljvmhhr01ql1cbg8bf0cljvmhhr01ql1cbg8bfg | ||
openapi: | ||
service: | ||
title: ExchangeRatesApi doc #title | ||
version: 1.0.0 | ||
url: http://localhost:8080 | ||
springDoc: | ||
apiDocs: | ||
enabled: true | ||
path: /api/v3/api-docs | ||
swaggerUi: | ||
enabled: true | ||
path: /doc/swagger-ui.html |