Simpel Spring Boot project implementerar AOP and OpenApi
Spring Boot 2.2.2.RELEASE
Java 11
-
Att bygga: mvn clean package
-
Att köra: mvn spring-boot:run (java -jar target\spring-openApi-0.0.1-SNAPSHOT.jar)
-
Debug: mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5000 -Dserver.port=8080" och sen i Eclipse meny -välj "Debug configurations..." -> och skapa en "Remote Java Application",
sätt parametrarna Host: localhost, Port: 5000
swagger-ui.html
---------------------
see: http://localhost:8080/index.html
Driver Class: org.h2.Driver
JDBC URL: jdbc:h2:mem:testdb
User Name: sa
Password: password
http://localhost:8080/h2-console/login.do
Endpoints
--------------
GET:
curl http://localhost:8080/customer/get/1
POST:
curl -X POST -d "{"firstName":"Graham","lastName":"Bell","email":"[email protected]","email1":"[email protected]","age":38}" -H "Content-Type: application/json" http://localhost:8080/customer/add
DELETE:
curl -X DELETE http://localhost:8080/customer/delete/3
Ex på record
-----------------
{"firstName":"Graham","lastName":"Bell","email":"[email protected]","email1":"[email protected]","age":38}
{"firstName":"Thomas","lastName":"Edison","email":"[email protected]","email1":"[email protected]","age":33}