- ./docker-compose-up.sh
- mvn flyway:migrate -Dflyway.url=jdbc:postgresql://localhost:5432/account_service -Dflyway.user=account-service -Dflyway.password=account-s3rv1c3
- Execute curl's commands listed below.
- ./docker-compose-only-db-up.sh
- mvn flyway:migrate -Dflyway.url=jdbc:postgresql://localhost:5432/account_service -Dflyway.user=account-service -Dflyway.password=account-s3rv1c3
Method | Url | Description |
---|---|---|
POST | /accounts | create an account with these required parameters. Ex request body: { document_number: '12345678900' , mobile: '11985733234', email: '[email protected]' } |
GET | /accounts/{id} | get account by id |
POST | /transactions | create a transaction with these required parameters. Ex request body: { account_id: 1 , operation_type_id: 4, amount: 123.45 } |
1- Create Account curl -d '{ "document_number": "12345678900" , "mobile": "11985733234", "email": "[email protected]" }' -H 'Content-Type: application/json' http://localhost:8300/accounts-service/accounts
2- Get Account By Id curl -v http://localhost:8300/accounts-service/accounts/5
3- Create Transaction curl -d '{ "account_id": 5 , "operation_type_id": 4, "amount": 123.45 }' -H 'Content-Type: application/json' http://localhost:8300/accounts-service/transactions
mvn spring-boot:build-image -DskipTests
mvn flyway:migrate -Dflyway.url=jdbc:postgresql://localhost:5432/account_service -Dflyway.user=account-service -Dflyway.password=account-s3rv1c3
1) Primeira vez rode:
mvn compile flyway:migrate
2) Para as proximas vezes rode
mvn clean flyway:migrate
A solution that uses devTools works : 1 - Adding devtools to your project org.springframework.boot spring-boot-devtools 2- Enabling automatic build Open the Settings --> Build-Execution-Deployment --> Compiler and enable : Build Project Automatically. 3- Update the value of compiler.automake.allow.when.app.running press ctrl+shift+A and search for the registry. In the registry, enable : compiler.automake.allow.when.app.running