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
15 changes: 15 additions & 0 deletions API-cerverzas.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="jpa" name="JPA">
<configuration>
<setting name="validation-enabled" value="true" />
<setting name="provider-name" value="Hibernate" />
<datasource-mapping>
<factory-entry name="entityManagerFactory" value="0261e58a-572c-4ce9-a87f-66b9160a524c" />
</datasource-mapping>
<naming-strategy-map />
</configuration>
</facet>
</component>
</module>
19 changes: 19 additions & 0 deletions ComoUsarLaAPI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Como usar la API

Para lanzar la API sera necesario tener Docker iniciado, una vez este iniciado se podra lanzar la ApiCervezasApplication.

Para hacer uso de esta API Los endopoints de las rutas disponibles son los siguientes:

| Endpoints | Resultado |
|-------------------------------- |------------------------------------------------------------|
|`/api/beers/beers` | Muestra todas las cervezas. |
|`/api/beers/beer` | Añade una cerveza a partir de un JSON. |
|`/api/beers/beer/{id}` | Muestra la cerveza con el id `{id}`. |
|`/api/beers/beer/{id}` | Elimina una cerveza con el id `{id}`. |
|`/api/beers/beer/{id}` | Modifica una cerveza con el id `{id}` a partir de un JSON. |
|`/api/breweries/breweries` | Lista todas las cervecerias. |
|`/api/breweries/brewerie/{id}` | Muestra la cerveceria con el id `{id}`. |
|`/api/categories/categories` | Lista todas las categorías. |
|`/api/categories/categorie/{id}` | Mostrar la categoría con el id `{id}`. |
|`/api/styles/styles` | Lista todos los estilos. |
|`/api/styles/style/{id}` | Muestra el estilo con el id `{id}`. |
36 changes: 36 additions & 0 deletions HELP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Read Me First
The following was discovered as part of building this project:

* The original package name 'com.example.API-cerverzas' is invalid and this project uses 'com.example.APIcerverzas' instead.

# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.2.0/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.2.0/maven-plugin/reference/html/#build-image)
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.2.0/reference/htmlsingle/index.html#using.devtools)
* [Thymeleaf](https://docs.spring.io/spring-boot/docs/3.2.0/reference/htmlsingle/index.html#web.servlet.spring-mvc.template-engines)
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.2.0/reference/htmlsingle/index.html#web)
* [Validation](https://docs.spring.io/spring-boot/docs/3.2.0/reference/htmlsingle/index.html#io.validation)
* [Docker Compose Support](https://docs.spring.io/spring-boot/docs/3.2.0/reference/htmlsingle/index.html#features.docker-compose)

### Guides
The following guides illustrate how to use some features concretely:

* [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/)
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
* [Validation](https://spring.io/guides/gs/validating-form-input/)

### Docker Compose support
This project contains a Docker Compose file named `compose.yaml`.
In this file, the following services have been defined:

* mariadb: [`mariadb:latest`](https://hub.docker.com/_/mariadb)

Please review the tags of the used images and set them to the same as you're running in production.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,5 @@ Ir más lejos
[saphirevert-shield]: https://badgen.net/badge/Github/SaphireVert/green?icon=https://svgshare.com/i/Srf.svg
[saphirevert-url]: https://github.com/saphirevert/


- Autor: Victor Jiménez Corada 2º DAW
1 change: 1 addition & 0 deletions Resultados/PeticionesBeers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_type":"export","__export_format":4,"__export_date":"2023-12-01T09:07:18.454Z","__export_source":"insomnia.desktop.app:v8.3.0","resources":[{"_id":"req_02dd7cff1de94d61b21d2dfd548539f1","parentId":"wrk_eed59316c816422f9418042f26bd3de2","modified":1701418015737,"created":1701256345783,"url":"localhost:8080/api/beer/beers?page=0","name":"Todas las cervezas","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701258857772,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_eed59316c816422f9418042f26bd3de2","parentId":null,"modified":1701256341613,"created":1701256341613,"name":"Beers","description":"","scope":"collection","_type":"workspace"},{"_id":"req_425e8f70baa14ac0a3414e8e4d280842","parentId":"wrk_eed59316c816422f9418042f26bd3de2","modified":1701421121821,"created":1701258857722,"url":"localhost:8080/api/beer/beer","name":"Cerveza by id","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"id\": 1,\n \"brewery_id\": 0,\n \"name\": \"Nombre de la cerveza\",\n \"cat_id\": 0,\n \"style_id\": 0,\n \"abv\": 0.0,\n \"ibu\": 0.0,\n \"srm\": 0.0,\n \"upc\": 0,\n \"filepath\": \"ruta/del/archivo\",\n \"descript\": \"Descripción de la cerveza\",\n \"add_user\": 0,\n \"last_mod\": \"2023-12-01\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701258857722,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_2d70c15ea2f546b69057e94c9ca8210f","parentId":"wrk_eed59316c816422f9418042f26bd3de2","modified":1701421131427,"created":1701263067816,"url":"localhost:8080/api/beer/beer/1","name":"Cerveza by id","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701258857672,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_e114311580314efbb7d2239a0e9ba134","parentId":"wrk_eed59316c816422f9418042f26bd3de2","modified":1701415381136,"created":1701261450170,"url":"localhost:8080/api/beer/beer/1","name":"Cerveza by id","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n \"id\": 1,\n \"brewery_id\": null,\n \"name\": \"nuevoNombre\",\n \"cat_id\": 1,\n \"style_id\": 1,\n \"abv\": 1.0,\n \"ibu\": 2.0,\n \"srm\": 3.0,\n \"upc\": 1,\n \"filepath\": \"nuevoFilepath\",\n \"descript\": \"nuevaDescripción\",\n \"add_user\": 1,\n \"last_mod\": \"2023-11-29\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701258857622,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_eafef8a47082427e8c8da62daaea7c6d","parentId":"wrk_eed59316c816422f9418042f26bd3de2","modified":1701263665506,"created":1701263614525,"url":"localhost:8080/api/beer/beer/1","name":"Cerveza by id","description":"","method":"DELETE","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701258857522,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_3201ea864cb9390bd9f6bbb4dd072ad56ecb388b","parentId":"wrk_eed59316c816422f9418042f26bd3de2","modified":1701256341616,"created":1701256341616,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1701256341616,"_type":"environment"},{"_id":"jar_3201ea864cb9390bd9f6bbb4dd072ad56ecb388b","parentId":"wrk_eed59316c816422f9418042f26bd3de2","modified":1701256341618,"created":1701256341618,"name":"Default Jar","cookies":[],"_type":"cookie_jar"}]}
1 change: 1 addition & 0 deletions Resultados/PeticionesBreweries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_type":"export","__export_format":4,"__export_date":"2023-12-01T09:07:41.362Z","__export_source":"insomnia.desktop.app:v8.3.0","resources":[{"_id":"req_e661d78ef2ae4343933c707ad3d62e20","parentId":"wrk_761d80ea0d1c41e7868efd9be33fc32f","modified":1701416088928,"created":1701415717438,"url":"localhost:8080/api/breweries/breweries?page=0","name":"Todas las Cervecerias","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701415717438,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_761d80ea0d1c41e7868efd9be33fc32f","parentId":null,"modified":1701415711577,"created":1701415711577,"name":"Breweries","description":"","scope":"collection","_type":"workspace"},{"_id":"req_2fd0bfa89de6464aabb2f8732c776a03","parentId":"wrk_761d80ea0d1c41e7868efd9be33fc32f","modified":1701416285525,"created":1701416271271,"url":"localhost:8080/api/breweries/brewerie/1","name":"Cervveceria by Id","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701337287630,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_dc6260fd48880fa0aff064498b76b11f8e77e472","parentId":"wrk_761d80ea0d1c41e7868efd9be33fc32f","modified":1701415711579,"created":1701415711579,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1701415711579,"_type":"environment"},{"_id":"jar_dc6260fd48880fa0aff064498b76b11f8e77e472","parentId":"wrk_761d80ea0d1c41e7868efd9be33fc32f","modified":1701415711582,"created":1701415711582,"name":"Default Jar","cookies":[],"_type":"cookie_jar"}]}
1 change: 1 addition & 0 deletions Resultados/PeticionesCategories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_type":"export","__export_format":4,"__export_date":"2023-12-01T09:08:06.304Z","__export_source":"insomnia.desktop.app:v8.3.0","resources":[{"_id":"req_32f6443c3ea946389f1b13dab809fffa","parentId":"wrk_bd2af6c802f047d1b0261f8b17c4c5db","modified":1701417240033,"created":1701416888167,"url":"localhost:8080/api/categories/categories?page=1","name":"Todas las categorias","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701416888167,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_bd2af6c802f047d1b0261f8b17c4c5db","parentId":null,"modified":1701416690664,"created":1701416690664,"name":"Categories","description":"","scope":"collection","_type":"workspace"},{"_id":"req_036db1d171fa40859f44f20e15455647","parentId":"wrk_bd2af6c802f047d1b0261f8b17c4c5db","modified":1701416922601,"created":1701416723842,"url":"localhost:8080/api/categories/category/1","name":"Categoria by Id","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701416723842,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_20e230089497744105b00ba72c56d947488f6f9e","parentId":"wrk_bd2af6c802f047d1b0261f8b17c4c5db","modified":1701416690666,"created":1701416690666,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1701416690666,"_type":"environment"},{"_id":"jar_20e230089497744105b00ba72c56d947488f6f9e","parentId":"wrk_bd2af6c802f047d1b0261f8b17c4c5db","modified":1701416690668,"created":1701416690668,"name":"Default Jar","cookies":[],"_type":"cookie_jar"}]}
1 change: 1 addition & 0 deletions Resultados/PeticionesStyles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"_type":"export","__export_format":4,"__export_date":"2023-12-01T09:08:23.004Z","__export_source":"insomnia.desktop.app:v8.3.0","resources":[{"_id":"req_e17dfc36cf4649a7a65a4e17af1d038d","parentId":"wrk_2040ff656f934296bb1ef638061045d6","modified":1701417354376,"created":1701417195539,"url":"localhost:8080/api/styles/styles?page=0","name":"Todos los estilos","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701416888167,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_2040ff656f934296bb1ef638061045d6","parentId":null,"modified":1701417195526,"created":1701417195526,"name":"Styles","description":"","scope":"collection","_type":"workspace"},{"_id":"req_d65ab213ce0c49e6a7a0ff7483cdd1cf","parentId":"wrk_2040ff656f934296bb1ef638061045d6","modified":1701417288848,"created":1701417195536,"url":"localhost:8080/api/styles/style/1","name":"Estilo by Id","description":"","method":"GET","body":{},"parameters":[],"headers":[{"name":"User-Agent","value":"insomnia/8.3.0"}],"authentication":{},"metaSortKey":-1701416723842,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_7e38e257a8c644909cc6c20eb9e7bd9c","parentId":"wrk_2040ff656f934296bb1ef638061045d6","modified":1701417195527,"created":1701417195527,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1701416690666,"_type":"environment"},{"_id":"jar_0d4ba00e0d3843c2b5101e0f23e73d7b","parentId":"wrk_2040ff656f934296bb1ef638061045d6","modified":1701417195531,"created":1701417195531,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_6612605e770846058228be474b073dd9","parentId":"wrk_2040ff656f934296bb1ef638061045d6","modified":1701417195547,"created":1701417195546,"fileName":"Styles","contents":"","contentType":"yaml","_type":"api_spec"}]}
Loading